1 Reply Latest reply on Oct 27, 2006 12:36 AM by Jason Greene

    WS STRING[] ERROR: could not find deserializer for type Stri

    rudy tocci Newbie

      The deploy process on JBoss 4.0.5 is running OK, but when I invoke my webservice method from my WSDII client, it retrieves this error message:

      org.jboss.axis.AxisFault: Deserializing parameter 'result': could not find deserializer for type {http://mypackage/types}String.Array


      My interface (and class) also has other methods are returning simple type like int, boolean and String, but these methods are running perfectly.
      I have also tried with others sequence return types like int[], Vector, StringTokenizer, but they aren't running.
      On JBoss 4.0.3.SP1 all running ok, but i can't use this old version.

      My Application server is:
      ----------------------------------------
      JBoss 4.0.5.GA running on JDK 1.5 (jdk1.5.0_08)
      ----------------------------------------

      My INTERFACE is like this:
      ----------------------------------------

      import java.rmi.Remote;
      import java.rmi.RemoteException;
      
      public interface myinterface extends Remote {
       ..........
       public String[] mymethod(String myparameter) throws RemoteException;
       ..........
      }

      ----------------------------------------

      My WSDL FILE (autogenerated by JBOSS Tool in ...\JBoss 4.0.5.GA\bin\wstools.bat) contains this:
      ----------------------------------------
      .........
      <complexType name='String.Array'>
       <sequence>
       <element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='string'/>
       </sequence>
      </complexType>
      .........
      <message name=''myinterface_mymethod'>
       <part name='String_1' type='xsd:string'/>
      </message>
      <message name='myinterface_mymethodResponse'>
       <part name='result' type='ns1:String.Array'/>
      </message>
      .........
      <operation name='mymethod' parameterOrder='String_1'>
       <input message='tns:myinterface_mymethod'/>
       <output message='tns:myinterface_mymethodResponse'/>
      </operation>
      .........

      ----------------------------------------

      My JAXRPC-MAPPING.XML file (autogenerated by JBOSS Tool in ...\JBoss 4.0.5.GA\bin\wstools.bat) contains this:
      ----------------------------------------
      ...........
      <package-mapping>
       <package-type>mypackage</package-type>
       <namespaceURI>http://mypackage/types</namespaceURI>
      </package-mapping>
      ...........
      <service-endpoint-method-mapping>
       <java-method-name>mymethod</java-method-name>
       <wsdl-operation>mymethod</wsdl-operation>
       <method-param-parts-mapping>
       <param-position>0</param-position>
       <param-type>java.lang.String</param-type>
       <wsdl-message-mapping>
       <wsdl-message xmlns:wsdlMsgNS='http://mypackage'>wsdlMsgNS:myinterface_mymethod</wsdl-message>
       <wsdl-message-part-name>String_1</wsdl-message-part-name>
       <parameter-mode>IN</parameter-mode>
       </wsdl-message-mapping>
       </method-param-parts-mapping>
       <wsdl-return-value-mapping>
       <method-return-value>java.lang.String[]</method-return-value>
       <wsdl-message xmlns:wsdlMsgNS='http://mypackages'>wsdlMsgNS:myinterface_mymethodResponse</wsdl-message>
       <wsdl-message-part-name>result</wsdl-message-part-name>
       </wsdl-return-value-mapping>
      </service-endpoint-method-mapping>
      ............

      ----------------------------------------

      My CLIENT WSDII source is like this:
      ----------------------------------------
      ........
      String urlstr = mywsdlurl
      String nameSpaceURI = mynamespaceuri
      String serviceName = myservicename
      String portName = myserviceportname
      
      URL url = new URL(urlstr);
      QName qname = new QName(nameSpaceURI, serviceName);
      QName port = new QName(nameSpaceURI, portName);
      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(url, qname);
      
      QName operation = operation = new QName(nameSpaceURI, mymethod);
      Call call = service.createCall(port, operation);
      
      String[] arr= ( String[])call.invoke(new Object[] {"myparametervalue"});
      for (int i = 0; i<arr.length; i++) {str+="["+arr+"]";}
       System.out.println(">> mymethod('myparametervalue'): "+str);
       ..........

      ----------------------------------------

      The invoke method in WSDII client class generates the exception org.jboss.axis.AxisFault.

      What i do to resolve this????
      It's possible that collections (or arrays) objects don't work with JBoss 4.0.5.GA ???

      Thanks in advance,
      Rudy