JAX-RPC HELP!! "could not find deserializer for type"
rkite01 Dec 15, 2005 10:48 AMI have read and read and tried many suggestions from other posts but I can not find a solution to this. I have tried JBoss 4.0.1 and 4.0.3. My example works fine passing String values in and out but I can not return a String[] type back. I have tried wrapping the String[] in another object and tried the generated wrapper from wscompile. I am using the jaxrpc jars jwsdp-1.6 from Sun in the jboss/server/default/lib directory. The wdsl file is generated with wscompile. It seems to have everything it needs other than the correct deserializer. I know several others are having this problem and have read and tried several solutions.
Thanks
WDSL
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="HelloService" targetNamespace="http://mil.tis.demo/" xmlns:tns="http://mil.tis.demo/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="http://mil.tis.demo.types/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<schema targetNamespace="http://mil.tis.demo.types/" xmlns:tns="http://mil.tis.demo.types/" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<soap:operation soapAction=""/>
<soap:body use="literal" namespace="http://mil.tis.demo/"/>
<soap:body use="literal" namespace="http://mil.tis.demo/"/>
<soap:operation soapAction=""/>
<soap:body use="literal" namespace="http://mil.tis.demo/"/>
<soap:body use="literal" namespace="http://mil.tis.demo/"/>
<soap:operation soapAction=""/>
<soap:body use="literal" namespace="http://mil.tis.demo/"/>
<soap:body use="literal" namespace="http://mil.tis.demo/"/>
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
mapping.xml
<?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>mil.tis.demo</package-type>
http://mil.tis.demo.types/
</package-mapping>
<package-mapping>
<package-type>mil.tis.demo</package-type>
http://mil.tis.demo/
</package-mapping>
<java-xml-type-mapping>
<java-type>mil.tis.demo.types.StringArray</java-type>
<root-type-qname xmlns:typeNS="http://mil.tis.demo.types/">typeNS:StringArray</root-type-qname>
<qname-scope>complexType</qname-scope>
<variable-mapping>
<java-variable-name>value</java-variable-name>
<xml-element-name>value</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
<service-interface-mapping>
<service-interface>mil.tis.demo.HelloService</service-interface>
<wsdl-service-name xmlns:serviceNS="http://mil.tis.demo/">serviceNS:HelloService</wsdl-service-name>
<port-mapping>
<port-name>HelloPort</port-name>
<java-port-name>HelloPort</java-port-name>
</port-mapping>
</service-interface-mapping>
<service-endpoint-interface-mapping>
<service-endpoint-interface>mil.tis.demo.Hello</service-endpoint-interface>
<wsdl-port-type xmlns:portTypeNS="http://mil.tis.demo/">portTypeNS:Hello</wsdl-port-type>
<wsdl-binding xmlns:bindingNS="http://mil.tis.demo/">bindingNS:HelloBinding</wsdl-binding>
<service-endpoint-method-mapping>
<java-method-name>getText</java-method-name>
<wsdl-operation>getText</wsdl-operation>
<wsdl-return-value-mapping>
<method-return-value>java.lang.String</method-return-value>
<wsdl-message xmlns:wsdlMsgNS="http://mil.tis.demo/">wsdlMsgNS:Hello_getTextResponse</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>getUics</java-method-name>
<wsdl-operation>getUics</wsdl-operation>
<wsdl-return-value-mapping>
<method-return-value>mil.tis.demo.types.StringArray</method-return-value>
<wsdl-message xmlns:wsdlMsgNS="http://mil.tis.demo/">wsdlMsgNS:Hello_getUicsResponse</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>hello</java-method-name>
<wsdl-operation>hello</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://mil.tis.demo/">wsdlMsgNS:Hello_hello</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://mil.tis.demo/">wsdlMsgNS:Hello_helloResponse</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
</service-endpoint-interface-mapping>
</java-wsdl-mapping>
Here is the server class HelloServlet.java
package mil.tis.demo;
import mil.tis.demo.types.StringArray;
public class HelloServlet
{
public String hello(String name){
return("Hello " + name);
}
public StringArray getUics()
{
String[] stringArray = {"WWWWWW", "WWWWWG", "WWWWWH"};
StringArray result = new StringArray();
result.setValue(stringArray);
return(result);
}
public String getText() { return("Be quiet Cliff"); }
}
The remove interface Hello.java
package mil.tis.demo;
import java.rmi.RemoteException;
import java.rmi.Remote;
import mil.tis.demo.types.StringArray;
public interface Hello extends Remote
{
public String hello(String name) throws RemoteException;
public StringArray getUics() throws RemoteException;
public String getText() throws RemoteException;
}
config.xml
<?xml version="1.0" encoding="UTF-8"?>
ws4ee-deployment.xml I have tried this on and left it out with no difference.
<?xml version="1.0" encoding="UTF-8"?>
<deployment
xmlns='http://xml.apache.org/axis/wsdd/'
xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<!-- <typeMapping
encodingStyle=""
qname="ns2:StringArray"
serializer="org.jboss.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.jboss.axis.encoding.ser.BeanDeserializerFactory"
type="java:mil.tis.demo.types.StringArray"
xmlns:ns2="http://mil.tis.demo.types/"/> -->
<!-- <typeMapping
qname='ns1:CustomerOrderPosition' xmlns:ns1='http://org.jboss.webservice/complexbean'
type='java:org.jboss.webservice.complexbean.CustomerOrderPosition'
serializer='org.apache.axis.encoding.ser.BeanSerializerFactory'
deserializer='org.apache.axis.encoding.ser.BeanDeserializerFactory'
encodingStyle=''
/> -->
<!-- <typeMapping
deserializer="org.apache.axis.encoding.ser.ElementDeserializerFactory"
encodingStyle=""
qname="ns2:StringArray"
serializer="org.apache.axis.encoding.ser.ElementSerializerFactory"
type="java:javax.xml.soap.SOAPElement"
xmlns:schema="http://mil.tis.demo/types"/> -->
webservices.xml
<?xml version="1.0" encoding="UTF-8"?>
<webservices
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/j2ee_web_services_1_1.xsd" version="1.1">
<webservice-description>
<webservice-description-name>HelloService</webservice-description-name>
<wsdl-file>WEB-INF/wsdl/HelloService.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/mappings/mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>Hello</port-component-name>
<wsdl-port>HelloPort</wsdl-port>
<service-endpoint-interface>mil.tis.demo.Hello</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloServlet</servlet-link>
</service-impl-bean>
</port-component>
</webservice-description>