[JBossWS] - Re: MTOM With JBOSSWS and WSCOMPILE
by greenbean
I changed my schema to type="xmlmime:base64Binary" from xmlmime:type="xmlmime:base64Binary" and got alittle farther. The jbossws client now sends the data to the jboss server. However, the server has this problem.
We are using JBoss 4.0.5GA.
Any ideas?
java.rmi.RemoteException: Call invocation failed with code [Client] because of: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: Failed to set value 'javax.activation.DataHandler@109b4cb' for property 'xxx' defined in com.xxx.xxx.xxx.xxx@3c938d on instance com.xxx.xxx.xxx.xxx@3c938d; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: Failed to set value 'javax.activation.DataHandler@109b4cb' for property 'afrData' defined in com.ngc.ident1.sissiba.SearchData@3c938d on instance com.ngc.ident1.sissiba.SearchData@3c938d
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:713)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
at $Proxy2.search(Unknown Source)
at com.ngc.ident1.client.Client.main(Client.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.ve.internal.java.vce.launcher.remotevm.JavaBeansLauncher.main(JavaBeansLauncher.java:79)
Caused by: javax.xml.rpc.soap.SOAPFaultException: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: Failed to set value 'javax.activation.DataHandler@109b4cb' for property 'xxx' defined in com.xxx.xxx.xxx.xxx@3c938d on instance com.xxx.xxx.xxx.xxx@3c938d
at org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper.getSOAPFaultException(SOAPFaultExceptionHelper.java:100)
at org.jboss.ws.binding.soap.SOAPBindingProvider.unbindResponseMessage(SOAPBindingProvider.java:486)
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:702)
... 9 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981390#3981390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981390
18 years, 2 months
[JBossWS] - MTOM With JBOSSWS and WSCOMPILE
by greenbean
I am attempting to use MTOM with JBossWS. We currently use WSCompile to generate the java objects from the wsdl/xsd. It generates a Base64Binary object to hold the binary attachment data. However, when I run a JBossWS client, I get the following exception. How do I fix this?
java.rmi.RemoteException: Call invocation failed: Could not transmit message; nested exception is:
javax.xml.soap.SOAPException: Could not transmit message
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:718)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
at $Proxy2.search(Unknown Source)
at com.ngc.ident1.client.Client.main(Client.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.ve.internal.java.vce.launcher.remotevm.JavaBeansLauncher.main(JavaBeansLauncher.java:79)
Caused by: javax.xml.soap.SOAPException: Could not transmit message
at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:204)
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:687)
... 9 more
Caused by: javax.xml.rpc.JAXRPCException: java.lang.ClassCastException: com.test.Base64Binary
at org.jboss.ws.soap.SOAPContentElement.write(SOAPContentElement.java:986)
at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:171)
at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
at org.jboss.ws.soap.SAAJElementWriter.printInternal(SAAJElementWriter.java:163)
at org.jboss.ws.soap.SAAJElementWriter.print(SAAJElementWriter.java:142)
at org.jboss.ws.soap.SAAJElementWriter.printSOAPElement(SAAJElementWriter.java:91)
at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:177)
... 10 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981374#3981374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981374
18 years, 2 months
[JBossWS] - Re: web services samples
by rayymlai
I fixed Xerces in ANT and add JUnit in the classpath (could JBoss add this to the installation/release notes?). However, I have different issues when running the WS examples.
1. wss (e.g. encrypt, sign) failed with no detailed errors
2. in the simpleSign test case, there is a cryptic MBean exception due to reflectedDispatcher error.
3. my colleague told me the wsuid is missing in the SOAP message when he intercepts the SOAP message via TCPSPY.
could you provide some pointer? thanks.
HOW I RUN THE SAMPLE
1. install jboss 4.0.5 and jbossws-samples-1.0.3
2. fix Xerces in ANT
3. add ANT and JUnit in classpath
4. deploy jbossws to jboss server, and jboss-client as per installation/release notes
5. go to the jbossws-samples-1.0.3 directory and run "ant"
then run "ant tests" upon previous success
DETAILS
tests:
init:
[echo] jboss.home = c:/tools/jboss
[echo] tomcat.home = c:/tools/tomcat55
[echo] java.home = C:\Program Files\Java\jdk1.5.0_08\jre
[echo] node0 = MTVL04AL3M0346
test:
[junit] Running org.jboss.test.ws.samples.wssecurity.SimpleEncryptTestCase
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 7.969 sec
[junit] Test org.jboss.test.ws.samples.wssecurity.SimpleEncryptTestCase FAIL
ED
[junit] Running org.jboss.test.ws.samples.wssecurity.SimpleSignTestCase
[junit] javax.management.MBeanException
[junit] at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocation
Exceptions(ReflectedDispatcher.java:180)
[junit] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
Dispatcher.java:163)
[junit] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
[junit] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractI
nterceptor.java:133)
[junit] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
[junit] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invok
e(ModelMBeanOperationInterceptor.java:142)
[junit] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
[junit] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
Invoker.java:264)
[junit] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
va:659)
[junit] at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(
InvokerAdaptorService.java:266)
[junit] at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
Dispatcher.java:155)
[junit] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
[junit] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractI
nterceptor.java:133)
[junit] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
[junit] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invok
e(ModelMBeanOperationInterceptor.java:142)
[junit] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
[junit] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
Invoker.java:264)
[junit] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
va:659)
[junit] at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMP
ProxyFactory.java:179)
[junit] at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
Dispatcher.java:155)
[junit] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
[junit] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
[junit] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
Invoker.java:264)
[junit] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
va:659)
[junit] at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerActio
n.invoke(JRMPInvoker.java:819)
[junit] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvok
er.java:420)
[junit] at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav
a:294)
[junit] at sun.rmi.transport.Transport$1.run(Transport.java:153)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
[junit] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor
t.java:466)
[junit] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
ransport.java:707)
[junit] at java.lang.Thread.run(Thread.java:595)
[junit] Caused by: org.jboss.deployment.DeploymentException: Could not creat
e deployment: file:/C:/tools/jboss/jbossws-samples-1.0.3.GA/output/libs/jbossws-
samples-wssecurity-sign.war; - nested throwable: (org.jboss.ws.WSException: Serv
ice already registerd: jboss.ws:context=jbossws-samples-wssecurity-sign,endpoint
=HelloService)
[junit] at org.jboss.deployment.DeploymentException.rethrowAsDeploymentE
xception(DeploymentException.java:53)
[junit] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:99
1)
[junit] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:81
8)
[junit] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:78
2)
[junit] at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Reflected
Dispatcher.java:155)
[junit] ... 43 more
[junit] Caused by: org.jboss.ws.WSException: Service already registerd: jbos
s.ws:context=jbossws-samples-wssecurity-sign,endpoint=HelloService
[junit] at org.jboss.ws.server.ServiceEndpointManager.createServiceEndpo
int(ServiceEndpointManager.java:501)
[junit] at org.jboss.ws.deployment.ServiceEndpointDeployer.create(Servic
eEndpointDeployer.java:120)
[junit] at org.jboss.ws.integration.jboss.DeployerInterceptor.create(Dep
loyerInterceptor.java:80)
[junit] at org.jboss.ws.integration.jboss.DeployerInterceptorJSE.create(
DeployerInterceptorJSE.java:74)
[junit] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInte
rceptor.create(SubDeployerInterceptorSupport.java:180)
[junit] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeploye
rInterceptor.java:91)
[junit] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
[junit] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBean
Invoker.java:264)
[junit] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.ja
va:659)
[junit] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210
)
[junit] at $Proxy39.create(Unknown Source)
[junit] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:96
9)
[junit] ... 49 more
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 7.891 sec
[junit] Test org.jboss.test.ws.samples.wssecurity.SimpleSignTestCase FAILED
[junit] Running org.jboss.test.ws.samples.wssecurity.StorePassEncryptTestCas
e
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 7.984 sec
[junit] Test org.jboss.test.ws.samples.wssecurity.StorePassEncryptTestCase F
AILED
init:
[echo] jboss.home = c:/tools/jboss
[echo] tomcat.home = c:/tools/tomcat55
[echo] java.home = C:\Program Files\Java\jdk1.5.0_08\jre
[echo] node0 = MTVL04AL3M0346
tests-report:
[junitreport] Transform time: 1578ms
BUILD SUCCESSFUL
Total time: 3 minutes 50 seconds
C:\tools\jboss\jbossws-samples-1.0.3.GA>
C:\tools\jboss\jbossws-samples-1.0.3.GA>
C:\tools\jboss\jbossws-samples-1.0.3.GA>cd wssec*
C:\tools\jboss\jbossws-samples-1.0.3.GA\wssecurity>ant tests
Buildfile: build.xml
init:
[echo] jboss.home = c:/tools/jboss
[echo] tomcat.home = c:/tools/tomcat55
[echo] java.home = C:\Program Files\Java\jdk1.5.0_08\jre
[echo] node0 = MTVL04AL3M0346
compile:
copy-resources:
generate-sources:
[wstools] log4j:WARN No appenders could be found for logger (org.jboss.ws.tool
s.WSTools).
[wstools] log4j:WARN Please initialize the log4j system properly.
compile-generated:
copy-generated:
[copy] Copying 3 files to C:\tools\jboss\jbossws-samples-1.0.3.GA\output\re
sources
jars:
[war] Building war: C:\tools\jboss\jbossws-samples-1.0.3.GA\output\libs\jb
ossws-samples-wssecurity-sign.war
[jar] Building jar: C:\tools\jboss\jbossws-samples-1.0.3.GA\output\libs\jb
ossws-samples-wssecurity-sign-client.jar
[war] Building war: C:\tools\jboss\jbossws-samples-1.0.3.GA\output\libs\jb
ossws-samples-wssecurity-encrypt.war
[jar] Building jar: C:\tools\jboss\jbossws-samples-1.0.3.GA\output\libs\jb
ossws-samples-wssecurity-encrypt-client.jar
[war] Building war: C:\tools\jboss\jbossws-samples-1.0.3.GA\output\libs\jb
ossws-samples-store-pass-encrypt.war
[jar] Building jar: C:\tools\jboss\jbossws-samples-1.0.3.GA\output\libs\jb
ossws-samples-store-pass-encrypt-client.jar
tests:
init:
[echo] jboss.home = c:/tools/jboss
[echo] tomcat.home = c:/tools/tomcat55
[echo] java.home = C:\Program Files\Java\jdk1.5.0_08\jre
[echo] node0 = MTVL04AL3M0346
test:
[junit] Running org.jboss.test.ws.samples.wssecurity.SimpleEncryptTestCase
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 7.985 sec
[junit] Test org.jboss.test.ws.samples.wssecurity.SimpleEncryptTestCase FAIL
ED
[junit] Running org.jboss.test.ws.samples.wssecurity.SimpleSignTestCase
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 8.016 sec
[junit] Test org.jboss.test.ws.samples.wssecurity.SimpleSignTestCase FAILED
[junit] Running org.jboss.test.ws.samples.wssecurity.StorePassEncryptTestCas
e
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 7.985 sec
[junit] Test org.jboss.test.ws.samples.wssecurity.StorePassEncryptTestCase F
AILED
BUILD SUCCESSFUL
Total time: 27 seconds
C:\tools\jboss\jbossws-samples-1.0.3.GA\wssecurity>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981348#3981348
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981348
18 years, 2 months
[JBossWS] - WS basic auth only for post requests
by waperboy
I've created a web service, and added basic authentication according to the user-guide chapter 13 (http://labs.jboss.com/portal/jbossws/user-guide/en/html/secure-ejb.html), but it results in basic auth being activated for both GET and POST. I want access to the wsdl to be public.
The web service is defined using webservices.xml, jboss.xml, and ejb-jar.xml, and is contained in a jar file.
I notice in the web.xml file generated by jboss on deploy, that both GET and POST is specified in the security-constraint.
Any ideas on how I can make access to the wsdl (GET requests) public, and only the ws-methods (POST requests) authenticated?
/Per
webservices.xml:
| <webservice-description>
| <webservice-description-name>MyService</webservice-description-name>
| <wsdl-file>META-INF/wsdl/MyService.wsdl</wsdl-file>
| <jaxrpc-mapping-file>META-INF/MyService-mapping.xml</jaxrpc-mapping-file>
| <port-component>
| <port-component-name>MyService</port-component-name>
| <wsdl-port>MyServicePort</wsdl-port>
| <service-endpoint-interface>com.test.ws.MyServiceEndpoint</service-endpoint-interface>
| <service-impl-bean>
| <ejb-link>MyServiceBean</ejb-link>
| <servlet-link></servlet-link>
| </service-impl-bean>
| </port-component>
| </webservice-description>
|
jboss.xml:
| <jboss>
| <security-domain>java:/jaas/my-security-domain</security-domain>
| <enterprise-beans>
| <session>
| <ejb-name>MyServiceBean</ejb-name>
| <port-component>
| <port-component-name>MyService</port-component-name>
| <port-component-uri>/ws/MyService</port-component-uri>
| <auth-method>BASIC</auth-method>
| </port-component>
| </session>
| </enterprise-beans>
| </jboss>
|
ejb-jar.xml:
| <enterprise-beans>
| <session>
| <ejb-name>MyServiceBean</ejb-name>
| <service-endpoint>com.test.ws.MyServiceEndpoint</service-endpoint>
| <ejb-class>com.test.ws.MyServiceSLSB</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
| <security-role-ref>
| <role-name>@ROLE_EXPORT@</role-name>
| </security-role-ref>
| <security-role-ref>
| <role-name>@ROLE_IMPORT@</role-name>
| </security-role-ref>
| </session>
| </enterprise-beans>
|
| <assembly-descriptor>
| <security-role>
| <role-name>@ROLE_IMPORT@</role-name>
| </security-role>
| <security-role>
| <role-name>@ROLE_EXPORT@</role-name>
| </security-role>
| <method-permission>
| <role-name>@ROLE_IMPORT@</role-name>
| <method>
| <ejb-name>MyServiceBean</ejb-name>
| <method-name>submit</method-name>
| </method>
| </method-permission>
| <method-permission>
| <role-name>@ROLE_EXPORT@</role-name>
| <method>
| <ejb-name>MyServiceBean</ejb-name>
| <method-name>fetch</method-name>
| </method>
| </method-permission>
| </assembly-descriptor>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981275#3981275
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981275
18 years, 2 months
[JBossWS] - Re: Problems returning arrays from Webservice Method
by kaza
Sorry Jason, but I don't know exactly what you mean by "jira issue" but here is my server code and a snippet of a junit test that tries to access this (I simplified things a bit to focus on the problem)
First of all my ServiceWS class
public class ServiceWS {
private Long id;
private String name;
public Long getId(){ return this.id;}
public void setId(Long id) {this.id = id;}
public String getName(){return this.name;};
public void setName(String name){this.name=name;}
}
Then there is the ServiceWSArray class
public class ServiceWSArray {
private ServiceWS[] value;
public ServiceWSArray() {
}
public ServiceWS[] getValue() {
return this.value;
}
public void setValue(ServiceWS[] value) {
this.value = value;
}
}
And finally there is my webservice endpoint
@Stateless
@WebService(serviceName="MyWebService")
@SOAPBinding(style=Style.RPC,use=Use.LITERAL)
public class FacadeWS {
@WebMethod public ServiceWSArray getServiceInfos()
throws UnknownServiceProviderException {
if (this.logger.isTraceEnabled())
this.logger.trace("SOAP:getServiceInfos");
ServiceWS[] services = new ServiceWS[10];
for (int i=0;i<10;i++)
services = new ServiceWS.fromService();
ServiceWSArray result = new ServiceWSArray();
result.setValue(services);
return result;
}
}
On the junit client I create the port to this service and just call this
this.getPort().getServiceInfos();
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981234#3981234
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981234
18 years, 2 months