[jboss-user] [JBossWS] - SimpleDeserializer error on returning complex type

jaki do-not-reply at jboss.com
Tue Aug 19 09:52:12 EDT 2008


Hi, 

I have exposed a stateless ejb3 bean as a WS and it has a method returning a complex type.

Signature:

@WebMethod
  | 	public MapBean getMap(String test)

The class MapBean just has 2 string members along with their getters/setters.

I'm using an axis WS client for it (using the Call interface) but invoking the Web service gives me the below error:
Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
  |         at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
  |         at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
  |         at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
  |         at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
  |         at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
  |         at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
  |         at org.apache.axis.client.Call.invoke(Call.java:2448)
  |         ... 3 more 

What's wierd is, it works without the error if I change the binding from document/wrapped to document/BARE but in that case the input arguements take the form '<arg0 xsi:type='xsd:string' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>nabble</arg0>' even inside the webmethod! Kindly help me here. 

WSDL for response:

xs:complexType name="getMapResponse">
  |     <xs:sequence>
  |      <xs:element minOccurs="0" name="return" type="tns:mapBean"/>
  |     </xs:sequence>
  |    </xs:complexType>
  |    <xs:complexType name="mapBean">
  |     <xs:sequence>
  |      <xs:element minOccurs="0" name="key" type="xs:string"/>
  |      <xs:element minOccurs="0" name="value" type="xs:string"/>
  |     </xs:sequence>
  |    </xs:complexType>

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171275#4171275

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171275



More information about the jboss-user mailing list