2 Replies Latest reply on Jul 7, 2005 10:46 AM by fpitschi

    Wrong Serialization when using RPC/lit?

    fpitschi

      I am using jboss4.0.1sp1 and have used rpc/enc for my deployed webservices until now (which worked fine after solving some 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 jboss is creating the right typemapping for my SimpleInfoBean in the wsdd (encoding style is now '') , I think:


      <typeMapping
      qname='ns1:SimpleInfo' xmlns:ns1='http://db.bioinfo.rzg.mpg.de'
      type='java:de.mpg.rzg.bioinfo.db.SimpleInfo'
      serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
      deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
      encodingStyle=''>











      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">
      <soapenv:Body>
      <ns1:getObjekt soapenv:encodingStyle="x" xmlns:ns1="http://db.bioinfo.rzg.mpg.de">
      <String_1>diimitwsdl</String_1>
      </ns1:getObjekt>
      </soapenv:Body>
      </soapenv:Envelope>

      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">
      <soapenv:Body>
      <ns1:getObjektResponse xmlns:ns1="http://db.bioinfo.rzg.mpg.de">
      <ns1:SimpleInfo>
      10
      a
      bc
      diimitwsdl
      diimitwsdl
      </ns1:SimpleInfo>
      </ns1:getObjektResponse>
      </soapenv:Body>
      </soapenv:Envelope>


      I wonder why a <ns1:SimpleInfo> element is used instead of .
      (wsdl:


      )

      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

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

      to register the right Serializers/Deserializers?

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

      Thanks for your help!!!
      Regards
      Florian Pitschi