4 Replies Latest reply on Oct 26, 2005 10:39 AM by fpitschi

    Wrong Serialization when rpc/lit is used?


      I am using jboss4.0.1sp1 and have used rpc/enc for my deployed webservices until now (which worked fine after solving some initial problems...)
      I want to change to rpc/lit now.
      To do that, I created my wsdl from my java-interface again with wscompile, using the -f:rpclit option. It looks ok, and I think that jboss is creating the right typemapping for my SimpleInfoBean in the wsdd (encoding style is now ''):

       qname='ns1:SimpleInfo' xmlns:ns1='http://db.bioinfo.rzg.mpg.de'
       <elementDesc fieldName='intProperty' xmlName='intProperty'/>
       <elementDesc fieldName='stringArrayProperty' xmlName='stringArrayProperty'/>
       <elementDesc fieldName='stringProperty' xmlName='stringProperty'/>
       <elementOrder> <element name='intProperty'/>
       <element name='stringArrayProperty'/>
       <element name='stringProperty'/>
       </elementOrder> </typeDesc>

      Is this correct for rpc/lit?
      I am calling the webservice-method (method takes a String, returns a SimpleInfo-Object) using a DII client.

      The request SOAP message looks like:
      <?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">
       <ns1:getObjekt soapenv:encodingStyle="x" xmlns:ns1="http://db.bioinfo.rzg.mpg.de">

      I use the soapenv:encodingStyle="x" (instead of "") becuase otherwise, an ""-namespace is created for the child element and jboss doesn't like that ;-)

      The response is:
      <?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">
       <ns1:getObjektResponse xmlns:ns1="http://db.bioinfo.rzg.mpg.de">

      I wonder why a
      element is used instead of

      becuase the WSDL defines that the returned element's name is "result":
      <message name="SeqReferenceInfoEndpoint_getObjektResponse">
      <part name="result" type="tns:SimpleInfo"/>

      Looks like the server-side is creating the right response except that it uses ns1:SimpleInfo instead of result.

      On the client side, can i use

       new BeanSerializerFactory(SimpleInfo.class, simpleinfoQNAME),
       new BeanDeserializerFactory(SimpleInfo.class, simpleinfoQNAME));

      to register the right Serializers/Deserializers (i did that with rpc/enc)?

      If I need custom-(de)serializers on the client or server - side, which tool should I use to create them (wscompile?wsdl2java?)? Are there any examples for doing this somewhere?

      Thanks for your help!!!
      Florian Pitschi

      p.s. I first posted this topic in the beginner's corner, but there was no reply. Perhaps you can help me out (in parallel, i am trying to use the jboss/client jars together with the jwsdp jars to create a dii client and get my webservice running correctly)...