Hi,

(I feel kind of stupid with this question, because I use Axis for quit
some time now, but can't figure out this problem).

I have a working sample that uses the BeanSerializer and uses
rpc/encoding. The client uses the Call object (not codegeneration
involved) and the service simply echos the received object.
The passed object simply contains two String objects with setter and
getters and a constructor with no parameters.
Everything works fine.

Now I try to convert the service to a different message style. I tried
various styles which all sort of produce the same message.

I changed the wsdd file to include the style:
<service name="ComplexService" provider="java:RPC" style="rpc" use="literal">

And I changed the client program to use Literal as format:
call.setOperationUse(Use.LITERAL);

Now the call from client to server works (it receives the object), the
object is returned (looks good) and then the client tries to
deserialize it and says:
----------------------------------------------------------------------------------------------------------------------------------
        {http://xml.apache.org/axis/}stackTrace: 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:189)
        at 
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
        at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
        at org.apache.axis.client.Call.invoke(Call.java:2272)
        at org.apache.axis.client.Call.invoke(Call.java:2171)
        at org.apache.axis.client.Call.invoke(Call.java:1691)
----------------------------------------------------------------------------------------------------------------------------------
I am using Axis 1.1.
The request SOAP message looks like this:
----------------------------------------------------------------------------------------------------------------------------------
<?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>
  <echoSimpleValue xmlns="">
   <arg0>
    <field1>cc</field1>
    <field2>dd</field2>
   </arg0>
  </echoSimpleValue>
 </soapenv:Body>
</soapenv:Envelope>
Here is what the server replied:
----------------------------------------------------------------------------------------------------------------------------------
<?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>
  <echoSimpleValueResponse xmlns="">
   <echoSimpleValueReturn>
    <field1>cc</field1>
    <field2>dd</field2>
   </echoSimpleValueReturn>
  </echoSimpleValueResponse>
 </soapenv:Body>
</soapenv:Envelope>
----------------------------------------------------------------------------------------------------------------------------------
The problem seems to be that the SimpleDeserializer is used instead of
the BeanDeserializer. All this is quit clear. However the Axis Engine
on the server was able to deserialize it. Why didn't it also have the
same kind of problems ?
And if it didn't have them through some magic, why does the
deserialization fail on the client ??
Any idea somebody ?
thanks
-- 
christian campo (gmail.com)

Reply via email to