This strange behaviour does not just happen with returned values, I also have
problems when passing parameters. Parameters which are arrays of objects work
fine, but parameters which are scalar objects fail.
For example, the following code fails:
| public void testObjectParam() throws Exception {
| Service service = getService();
| WebServicesTest svc = (WebServicesTest)
service.getPort(WebServicesTest.class);
| TestValueObject tvo = svc.getValueObjectParam( new
TestValueObject() );
| System.out.println( "WebServicesTest.getValueObjectParam()
returned:" + tvo.toString() );
| assertNotNull( tvo );
| }
|
While this test case works:
| public void testObjectArrayParam() throws Exception {
| Service service = getService();
| WebServicesTest svc = (WebServicesTest)
service.getPort(WebServicesTest.class);
|
| TestValueObject[] tvoa = new TestValueObject[ 3 ];
| for( int i=0; i < tvoa.length; i++ ) {
| tvoa[ i ] = new TestValueObject();
| tvoa[ i ].setInt( i );
| tvoa[ i ].setString( "Element " + i );
| }
| TestValueObject[] tvoa2 = svc.getValueObjectArrayParam( tvoa );
| for( int i=0; i < tvoa2.length; i++ ) {
| System.out.println( "WebServicesTest.getValueObjectArrayParam()
[" + i + "] returned:" + tvoa2.toString() );
| }
| assertNotNull( tvoa2 );
| }
|
The server throws the following exception message:
10:43:11,873 ERROR [RPCInvocation] org.xml.sax.SAXException: Deserializing
parameter 'testValueObject': could not find deserializer for type
{http://www.w3.org/2001/XMLSchema}anyType
org.xml.sax.SAXException: Deserializing parameter 'testValueObject': could not
find deserializer for type {http://www.w3.org/2001/XMLSchema}anyType
at org.jboss.axis.message.RPCHandler.onStartChild(RPCHandler.java:326)
at
org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168)
at
org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:244)
at
org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPElementAxisImpl.java:1386)
at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)
at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396)
at
org.jboss.axis.providers.java.RPCInvocation.prepareFromRequestEnvelope(RPCInvocation.java:235)
at
org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:103)
at
org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
at
org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
at
org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
at
org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:905)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
My w4ee-deployment.xml file looks like:
| <deployment
| xmlns='http://xml.apache.org/axis/wsdd/'
| xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
| xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
| xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
| xmlns:xsd='http://www.w3.org/2001/XMLSchema'
| xmlns:ns2='http://interfaces.rmp2.cybertrust.com/types'
| xmlns:ns3='urn-com-cybertrust-rmp2-session'>
|
| <typeMapping
| qname='ns2:TestValueObject'
| type='java:com.cybertrust.rmp2.vo.TestValueObject'
|
serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
|
deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
| encodingStyle=''>
| <typeDesc>
| <elementDesc fieldName='int' xmlName='int'/>
| <elementDesc fieldName='string' xmlName='string'/>
| <elementOrder>
| <element name='int'/>
| <element name='string'/>
| </elementOrder>
| </typeDesc>
| </typeMapping>
|
| </deployment>
|
Any assistance would be appreciated!
Thanks and Regards,
Barry
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3885495#3885495
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3885495
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user