8 Replies Latest reply on Oct 19, 2005 6:12 PM by Thomas Diesler

    Error: could not find deserializer for type

    Christy Christy Novice

      Hi!
      I'm calling WS and in the invoke method I'm sending String array:
      res = (String[])call.invoke(new String[]{"param1","param2"});
      But I have strange mistake:

      org.jboss.axis.AxisFault: Deserializing parameter 'arrayOfString_1': could not find deserializer for type {http://gms.metadata.webservice.oceaninfo.ru/types/arrays/java/lang}StringArray
      at org.jboss.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:303)
      at org.jboss.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:142)
      at org.jboss.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1249)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
      at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
      at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
      at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
      at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:257)
      at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
      at org.jboss.axis.Message.getSOAPEnvelope(Message.java:428)
      at org.jboss.axis.client.Call.invokeEngine(Call.java:3077)
      at org.jboss.axis.client.Call.invoke(Call.java:3039)
      at org.jboss.axis.client.Call.invoke(Call.java:2629)
      at org.jboss.axis.client.Call.invoke(Call.java:2538)
      at org.jboss.axis.client.Call.invokeInternal(Call.java:1976)
      at org.jboss.axis.client.Call.invoke(Call.java:1914)
      at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
      at GMSClient.main(GMSClient.java:46)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
      Why did it happen?Thanks

        • 1. Re: Error: could not find deserializer for type
          Thomas Diesler Master

          Have a look at the generated *.wsdd and jaxrpc-mapping.xml. It looks like your deployment does not include the generated wrapper type for the array.

          • 2. Re: Error: could not find deserializer for type
            Christy Christy Novice

            Thomas, I have looked *.wsdd and mapping.xml. It looks like everything is fine. I used wscompile to generate wsdl and mapping.xml. And a strange thing: when string array is as the return value - everything works fine! What can it be?

            • 3. Re: Error: could not find deserializer for type
              Christy Christy Novice

              And one more question! I think it is stupid question: jaxrpc-mapping.xml it's the same as mapping.xml?

              • 4. Re: Error: could not find deserializer for type
                Anil Saldanha Master

                Depends on what you call it in "webservices.xml". That is where the WS layer looks for the file name.

                • 5. Re: Error: could not find deserializer for type
                  Anil Saldanha Master

                  Typical webservices.xml file

                  <?xml version="1.0" encoding="UTF-8"?>
                  
                  <webservices xmlns="http://java.sun.com/xml/ns/j2ee"
                   xmlns:impl="http://org.jboss.ws/jaxrpc"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
                   version="1.1">
                  
                   <webservice-description>
                   <webservice-description-name>TestService</webservice-description-name>
                   <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
                   <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
                   <port-component>
                   <port-component-name>TestServicePort</port-component-name>
                   <wsdl-port>impl:JaxRpcTestServicePort</wsdl-port>
                   <service-endpoint-interface>org.jboss.test.ws.jaxrpc.JaxRpcTestService</service-endpoint-interface>
                   <service-impl-bean>
                   <servlet-link>TestService</servlet-link>
                   </service-impl-bean>
                   </port-component>
                   </webservice-description>
                  </webservices>
                  


                  • 6. Re: Error: could not find deserializer for type
                    Christy Christy Novice

                    And what about this, please? What do you think?

                    "Christy" wrote:
                    Thomas, I have looked *.wsdd and mapping.xml. It looks like everything is fine. I used wscompile to generate wsdl and mapping.xml. And a strange thing: when string array is as the return value - everything works fine! What can it be?


                    • 7. Re: Error: could not find deserializer for type
                      Patrick Furlong Newbie

                      I really need some help here and some of this is starting to make sense. I'm assuming what I need to do is add something to a ws4ee-deployment.xml file to make the serializer work correctly. This would get merged by jboss into the wsdd file. Currently my wsdl is

                      <complexType name="PackageAuthorization">
                       <sequence>
                       <element name="packageLength" type="int"/>
                       <element name="packageListType" type="string"/>
                       <element name="packageNameList" type="tns:ArrayOfstring"/></sequence></complexType>
                       <complexType name="ArrayOfstring">


                      and the wsdd for this section is:

                      <typeMapping
                       qname='ns2:PackageAuthorization' xmlns:ns2='http://www.qcommcorp.com/dncstypes'
                       type='java:com.qcommcorp.dncs.types.PackageAuthorization'
                       serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
                       deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
                       encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
                       <typeDesc>
                       <elementDesc fieldName='packageLength' xmlName='packageLength'/>
                       <elementDesc fieldName='packageListType' xmlName='packageListType'/>
                       <elementDesc fieldName='packageNameList' xmlName='packageNameList'/>
                       <elementOrder>
                       <element name='packageLength'/>
                       <element name='packageListType'/>
                       <element name='packageNameList'/>
                       </elementOrder>
                       </typeDesc>
                       </typeMapping>


                      Can anyone tell me what to put in the ws4ee-deployment.xml file to make this work? Thanks

                      • 8. Re: Error: could not find deserializer for type
                        Thomas Diesler Master

                        Is the mapping of

                        {http://www.qcommcorp.com/dncstypes}ArrayOfstring

                        defined?

                        It probably map to a bean wrapping your String[]