2 Replies Latest reply on Jul 11, 2005 3:08 PM by Barry Sheward

    Unable to deserialize simple arrays of int and String

    Barry Sheward Newbie

      Hi,

      I thought that it would be easy to pass arrays of int and java.lang.String. I looked at http://wiki.jboss.org/wiki/Wiki.jsp?page=WSArrayTypeMapping but that seems to apply to custom data types. However, on my client, I always get:

      deserialization error: unexpected XML reader state. expected: END but found: START: item
      at com.sun.xml.rpc.encoding.literal.LiteralResponseSerializer.deserialize(LiteralResponseSerializer.java:331)
      at com.sun.xml.rpc.client.dii.CallInvokerImpl._readFirstBodyElement(CallInvokerImpl.java:285)
      at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:215)
      at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:79)
      at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:476)
      at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:121)
      at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:85)
      at $Proxy0.getStringArray(Unknown Source)
      at com.cybertrust.rmp2.test.wsee.WebServicesTestClient.main(WebServicesTestClient.java:63)

      I see the following log messages during startup:

      15:02:37,636 DEBUG [AxisService] deployService: rmp.ear/rmp.jar#WebServicesTest
      15:02:37,788 WARN [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://interfaces.rmp2.cybertrust.com/types/arrays/}intArray
      15:02:37,788 DEBUG [ServiceDescription] Guessing the javaType from typeQName: {http://interfaces.rmp2.cybertrust.com/types/arrays/}intArray -> com.cybertru
      st.rmp2.interfaces._arrays.intArray
      15:02:37,809 WARN [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://interfaces.rmp2.cybertrust.com/types/arrays/java/lang}StringArray
      15:02:37,810 DEBUG [ServiceDescription] Guessing the javaType from typeQName: {http://interfaces.rmp2.cybertrust.com/types/arrays/java/lang}StringArray ->
      com.cybertrust.rmp2.interfaces._arrays.java.lang.StringArray
      15:02:37,852 WARN [TypeMappingDescription] Class not found: com.cybertrust.rmp2.interfaces._arrays.java.lang.StringArray
      15:02:37,853 WARN [TypeMappingDescription] Class not found: com.cybertrust.rmp2.interfaces._arrays.intArray
      15:02:37,857 INFO [AxisService] WSDD published to: /home/bsheward/rmp2/rmp2/jboss/server/dev/data/wsdl/rmp.ear/rmp.jar/WebServicesTest.wsdd

      I'm using wscompile to generate the WSDL and I need to interact with clients that aren't Java based, so I don't think a JNDI based solution will be suitable.

      Do I really need to implement classes to be able to use simple arrays of int and java.lang.String types?

      I checked the packets and the XML shows the arrays seem to be coming from the server:

      <?xml version="1.0"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <ns1:getStringArrayResponse xmlns:ns1="http://interfaces.rmp2.cybertrust.com/">
      <result xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" soapenc:arrayType="xsd:string[2]">
      element 1
      element 2

      </ns1:getStringArrayResponse>
      </soapenv:Body>
      </soapenv:Envelope>

      Thanks,

      Barry