5 Replies Latest reply on Sep 18, 2007 3:37 AM by itrahulsoni

    please help; could not find deserializer

      ok.. this is another one of these problems, i've tried everything in other posts without success... maybe someone has some advice;

      I have created a -nodatabinding client with wscompile and want to use it to invoke its corresponding web service. I can invoke the webservice from my ejb (i've created all the webservices.xml and service-ref entries) and the correct deserializer is being used when sending the request, but jbossws fails to find the serializer for the response;

      org.xml.sax.SAXException: Deserializing parameter 'publishPDLUpdateResponse': could not find deserializer for type {urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se}PublishPDLUpdateResponse
       at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:325)
      


      wscompile generated the following jaxrpc-mapping-file;

      <?xml version="1.0" encoding="UTF-8"?>
      <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
       <package-mapping>
       <package-type>se.bonnier.bis.integrations.publishpdlupdate.v1</package-type>
       <namespaceURI>urn:v1:publishpdlupdate:integrations:bis.bonnier.se</namespaceURI>
       </package-mapping>
       <package-mapping>
       <package-type>javax.xml.soap</package-type>
       <namespaceURI>urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se</namespaceURI>
       </package-mapping>
       <exception-mapping>
       <exception-type>se.bonnier.bis.integrations.publishpdlupdate.v1.PublishPDLUpdateFaultMessage</exception-type>
       <wsdl-message xmlns:exMsgNS="urn:v1:publishpdlupdate:integrations:bis.bonnier.se">exMsgNS:PublishPDLUpdateFaultMessage</wsdl-message>
       </exception-mapping>
       <service-interface-mapping>
       <service-interface>se.bonnier.bis.integrations.publishpdlupdate.v1.PublishPDLUpdateServiceImpl</service-interface>
       <wsdl-service-name xmlns:serviceNS="urn:v1:publishpdlupdate:integrations:bis.bonnier.se">serviceNS:PublishPDLUpdateServiceImpl</wsdl-service-name>
       <port-mapping>
       <port-name>PublishPDLUpdateServicePort</port-name>
       <java-port-name>PublishPDLUpdateServicePort</java-port-name>
       </port-mapping>
       </service-interface-mapping>
       <service-endpoint-interface-mapping>
       <service-endpoint-interface>se.bonnier.bis.integrations.publishpdlupdate.v1.PublishPDLUpdateService</service-endpoint-interface>
       <wsdl-port-type xmlns:portTypeNS="urn:v1:publishpdlupdate:integrations:bis.bonnier.se">portTypeNS:PublishPDLUpdateService</wsdl-port-type>
       <wsdl-binding xmlns:bindingNS="urn:v1:publishpdlupdate:integrations:bis.bonnier.se">bindingNS:PublishPDLUpdateServiceSoapBinding</wsdl-binding>
       <service-endpoint-method-mapping>
       <java-method-name>publishPDLUpdate</java-method-name>
       <wsdl-operation>publishPDLUpdate</wsdl-operation>
       <method-param-parts-mapping>
       <param-position>0</param-position>
       <param-type>javax.xml.soap.SOAPElement</param-type>
       <wsdl-message-mapping>
       <wsdl-message xmlns:wsdlMsgNS="urn:v1:publishpdlupdate:integrations:bis.bonnier.se">wsdlMsgNS:PublishPDLUpdateInputMessage</wsdl-message>
       <wsdl-message-part-name>publishPDLUpdateRequestPart</wsdl-message-part-name>
       <parameter-mode>IN</parameter-mode>
       </wsdl-message-mapping>
       </method-param-parts-mapping>
       <wsdl-return-value-mapping>
       <method-return-value>javax.xml.soap.SOAPElement</method-return-value>
       <wsdl-message xmlns:wsdlMsgNS="urn:v1:publishpdlupdate:integrations:bis.bonnier.se">wsdlMsgNS:PublishPDLUpdateOutputMessage</wsdl-message>
       <wsdl-message-part-name>publishPDLUpdateResponsePart</wsdl-message-part-name>
       </wsdl-return-value-mapping>
       </service-endpoint-method-mapping>
       </service-endpoint-interface-mapping>
      </java-wsdl-mapping>
      


      I've added the typeMappings for SOAPElement -> ElementSerializer/DeserializerFactory to ws4ee-deployment.xml;

      <typeMapping xmlns:schema="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se"
       deserializer="org.apache.axis.encoding.ser.ElementDeserializerFactory"
       encodingStyle=""
       qname="schema:publishPDLUpdateRequest"
       serializer="org.apache.axis.encoding.ser.ElementSerializerFactory"
       type="java:javax.xml.soap.SOAPElement"/>
      
      <typeMapping xmlns:schema="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se"
       deserializer="org.apache.axis.encoding.ser.ElementDeserializerFactory"
       encodingStyle=""
       qname="schema:publishPDLUpdateResponse"
       serializer="org.apache.axis.encoding.ser.ElementSerializerFactory"
       type="java:javax.xml.soap.SOAPElement"/>
      
      <typeMapping xmlns:schema="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se"
       deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
       encodingStyle=""
       qname="schema:publishPDLUpdateFault"
       serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
       type="java:se.bonnier.bis.integrations.publishpdlupdate.v1.PublishPDLUpdateFaultMessage"/>
      


      The response soap message is the following;
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
       <ns:publishPDLUpdateResponse xmlns:ns="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se">
       <ns:status>1</ns:status>
       </ns:publishPDLUpdateResponse>
       </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      


      The WSDL being used is
      <definitions name="PublishPDLUpdateService"
       targetNamespace="urn:v1:publishpdlupdate:integrations:bis.bonnier.se"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:schema="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       xmlns:tns="urn:v1:publishpdlupdate:integrations:bis.bonnier.se" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <types>
       <xsd:schema>
       <xsd:import
       namespace="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se" schemaLocation="publishPDLUpdate-SNAPSHOT.xsd"/>
       </xsd:schema>
       </types>
       <message name="PublishPDLUpdateInputMessage">
       <part element="schema:publishPDLUpdateRequest" name="requestBody"/>
       </message>
      
       <message name="PublishPDLUpdateOutputMessage">
       <part element="schema:publishPDLUpdateResponse" name="responseBody"/>
       </message>
       <message name="PublishPDLUpdateFaultMessage">
       <part element="schema:publishPDLUpdateFault" name="faultBody"/>
       </message>
       <portType name="PublishPDLUpdateService">
       <operation name="publishPDLUpdate">
       <input message="tns:PublishPDLUpdateInputMessage" name="PublishPDLUpdateInput"/>
      
       <output message="tns:PublishPDLUpdateOutputMessage" name="PublishPDLUpdateOutput"/>
       <fault message="tns:PublishPDLUpdateFaultMessage" name="PublishPDLUpdateFault"/>
       </operation>
       </portType>
       <!-- Generated Binding for operation [PublishPDLUpdateService]-->
       <binding name="PublishPDLUpdateServiceSoapBinding" type="tns:PublishPDLUpdateService">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="publishPDLUpdate">
       <soap:operation soapAction="publishPDLUpdate"/>
      
       <input name="PublishPDLUpdateInput">
       <soap:body use="literal"/>
       </input>
       <output name="PublishPDLUpdateOutput">
       <soap:body use="literal"/>
       </output>
       <fault name="PublishPDLUpdateFault">
       <soap:fault name="PublishPDLUpdateFault" use="literal"/>
       </fault>
      
       </operation>
       </binding>
      </definitions>
      

      and its corresponding XSD is
      <?xml version="1.0" encoding="UTF-8"?>
      <schema targetNamespace="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se"
       xmlns="http://www.w3.org/2001/XMLSchema"
       xmlns:tns="urn:schema:v1:publishpdlupdate:integrations:bis.bonnier.se"
       elementFormDefault="qualified"
       xmlns:common="urn:updatedata:common:bis.bonnier.se">
      
       <import schemaLocation="updatedata-SNAPSHOT.xsd"
       namespace="urn:updatedata:common:bis.bonnier.se"/>
       <!-- Elements used in the wsdl files -->
       <element name="publishPDLUpdateRequest" type="tns:PublishPDLUpdateRequest"/>
       <element name="publishPDLUpdateResponse" type="tns:PublishPDLUpdateResponse"/>
       <element name="publishPDLUpdateFault" type="tns:PublishPDLUpdateFault"/>
      
       <!-- Request type includes either an add, an update of a delete subelement -->
       <complexType name="PublishPDLUpdateRequest">
      
       <sequence>
       <element name="add" type="common:Add" minOccurs="0" maxOccurs="1" />
       <element name="update" type="common:Update" minOccurs="0" maxOccurs="1" />
       <element name="delete" type="common:Delete" minOccurs="0" maxOccurs="1" />
       </sequence>
       </complexType>
      
       <!-- Response, including status -->
       <complexType name="PublishPDLUpdateResponse">
       <sequence>
      
       <element name="status" type="int"/>
       </sequence>
       </complexType>
      
       <!-- Fault including error code and message -->
       <complexType name="PublishPDLUpdateFault">
       <sequence>
       <element name="code" type="int"/>
       <element name="message" type="string"/>
       </sequence>
      
       </complexType>
      
      </schema>
      


      What really boggles me is that we have the exact same setup with another web-service (ie a nodatabinding client) and it works just fine!

      I've probably just stared at it too long to see the obvious.. a star in heaven for he/she that can help!

      regards,

      Ole




        • 1. Re: please help; could not find deserializer

          ok.. i solved it myself; a combination of errors by me and propably a bug in jboss;

          in my ws4ee-depolyment.xml I should have specified the qname with a capital, ie qname="schema:PublishPDLUpdateResponse". Since I made the same error for the request type, jboss seems to have found the default serialiazer for the request SOAPElement (which it failed to find for the response).. I confirmed this by completely removing the typemappings which worked fine for the request but not the response..

          so the bug report would be "jbossws client fails to find default serializer for SOAPElement response types" !? should I report it somewhere?

          cheers!

          /Ole

          • 2. Re: please help; could not find deserializer

            sorry, bug report should be deserializer, not serializer;

            "jbossws client fails to find default deserializer for SOAPElement response types"

            /Ole

            • 3. status update

              hi again..

              same seems to apply when implementing a nodatabinding service and receiving a request, ie the request type needs to be mapped

              internally I guess this is the same code being run when receiving a soap message, be it a request to a server or a response to a request..

              /Ole

              • 4. Re: please help; could not find deserializer
                anil.saldhana

                http://www.jboss.org/index.html?module=bb&op=viewtopic&t=58437 has the link to the JIRA where you enter bugs.

                • 5. Re: please help; could not find deserializer
                  itrahulsoni

                  Hi

                  I have the same problem
                  I have done that using the wstools ant task and
                  not able to foung how to add this mapping and package up it in the war file
                  so my deserialize error is removed.
                  so what to do please help me out.

                  Tools I am using : JBoss 4.0.5 GA and wstools for the same version
                  JDK1.5.06
                  Ant 1.6.5

                  My Ant file is following :

                  <ws2tools dest="${base}/WEB-INF" config="${base}/wstools-config.xml" includes="${base}/service/classes" classpathref="lib.path" >


                  </ws2tools>

                  when i supplied the needed wstools-config.xml and web.xml the Ant task will generate the needed jax-rpc_mapping.xml and webservices.xml and wsdl file for the service

                  When I run the client it will work fine for the operaion that not returns the value means void and If i use the operation that will return value means String than it will give no deserializer found error so likely the same problem you have.

                  So please help me to come out of that spend several days to for the solution.

                  Regards,
                  Rahul