Can you send us your WSDL? I suspect the problem has something to do with the fact that the child element of the SOAP Body has no namespace. Also with doc/literal, you should not be sending xsi:type information in the message.
Anne -----Original Message----- From: Christian Campo [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 03, 2004 11:46 AM To: [EMAIL PROTECTED] Subject: Re: convert rpc/encoded to rpc/literal Hi, you are saying it does not support rpc/literal. I believe you, but it works for some parameter types like int or string. Whatever. I tried Axis 1.2. beta 2. I runs faster (at least my subjective feeling) I made it use wrapped style: call.setOperationStyle(Style.WRAPPED); and <service name="ComplexService" provider="java:RPC" style="wrapped"> The same error happens: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.client.Call.invoke(Call.java:2421) at org.apache.axis.client.Call.invoke(Call.java:2317) at org.apache.axis.client.Call.invoke(Call.java:1774) request: <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><echoSim pleValue xmlns=""><arg0 xsi:type="ns1:SimpleValue" xmlns:ns1="urn:ComplexService"><field1 xsi:type="xsd:string">cc</field1><field2 xsi:type="xsd:string">dd</field2></arg0></echoSimpleValue></soapenv:Body></s oapenv:Envelope> response: <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><echoSim pleValueResponse xmlns=""><echoSimpleValueReturn><field1>cc</field1><field2>dd</field2></echo SimpleValueReturn></echoSimpleValueResponse></soapenv:Body></soapenv:Envelop e> again it cannot deserialize on the client. it can deserialize the same value on the server (I debugged it) any help appreciated. christian campo On Tue, 3 Aug 2004 11:08:26 -0400, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: > Axis does not support rpc/literal. It supports rpc/encoded or > document/literal styles only. If you would like to use an rpc style > programming interface and generate doc/literal messages, you should use the > Axis "wrapped" style. (You should also use Axis 1.2 if you want to use > literal encoding.) > > Anne > > > > -----Original Message----- > From: Christian Campo [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 03, 2004 9:34 AM > To: [EMAIL PROTECTED] > Subject: convert rpc/encoded to rpc/literal > > 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(SimpleDeseriali > zer.java:189) > at > org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserializa > tionContextImpl.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) > > -- christian campo (gmail.com)
