Addition to my earlier email:
----------------------------

Sometimes when the webservice involves complex output, I want to get only the xml string as output so that for complex types I dont have to define the type mappings.

The problem I mentioned also happens when I want String[] as the output in xml and so it is not restricted to UserDefinedTypes.

For example: The return xml in the tcp monitor shows as:
------------------------------------
HTTP/1.1 200 OK

Server: Pramati Server

Date: Sat, 17 Dec 2005 03:40:07 GMT

Content-Type: text/xml; charset=utf-8

Connection: close



<?xml version="1.0" encoding="utf-8"?>
   <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:getActiveWorkstepListInStringArrayResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://bizlogic.webservice.savvion.com">
            <getActiveWorkstepListInStringArrayReturn soapenc:arrayType="soapenc:string[3]" xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
               <getActiveWorkstepListInStringArrayReturn xsi:type="soapenc:string">tsa#293:Activity 1</getActiveWorkstepListInStringArrayReturn>
               <getActiveWorkstepListInStringArrayReturn xsi:type="soapenc:string">tsa#291:Activity 3</getActiveWorkstepListInStringArrayReturn>
               <getActiveWorkstepListInStringArrayReturn xsi:type="soapenc:string">tsa#290:Activity 1</getActiveWorkstepListInStringArrayReturn>
            </getActiveWorkstepListInStringArrayReturn>
         </ns1:getActiveWorkstepListInStringArrayResponse>
      </soapenv:Body>
   </soapenv:Envelope>
-----------------------------------------------

The requirement is to capture this xml form call.invoke() using the call.getResponseMessage().

Regards,
Ravi
Ravi Krishnamurthy wrote:
Hello:
I have a webservice that returns a complex array like

public UserJavaClass[] getUserJavaClassList(){

}

In order not to define the compelx type object for dynamic invocation, I get the xml output. So I define the serializer/deserializer for the complex type type

call.registerTypeMapping(org.w3c.dom.Element.class,
                                xmlQName,
                                ElementSerializerFactory.class,
                                ElementDeserializerFactory.class);

But on deserialization I get the following error:


org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> interface org.w3c.dom.Element)
    at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:286)
    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)
    at org.apache.axis.client.Call.invoke(Call.java:2347)
    at org.apache.axis.client.Call.invoke(Call.java:1804)

If the return value is just UserJavaClass not an array of that, I can get the xml string properly.

Any pointers will be very helpful.

I'm using axis 1.2.1

Thanks,
Ravi

Reply via email to