DII client complains about serializer
ilays Oct 25, 2004 8:40 AMWell its a very simple Ejb endpoint - serializing a simple pojo
running a DII client that get this exception:
i tried changing the serializer to the org.jboss.... instead of the apache
one , but it didn't help...
java.io.IOException: No serializer found for class com.alon.objects.Customer in registry org.apache.axis.encoding.TypeMappingImpl@17b1d64
here by is the wsdd , wsdl, and SEI
im really stuck here please help...
wsdd:
<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'> <service name='CustomerEchoService' style='document' use='literal' provider='Handler'> <parameter name='webservice-identifier' value='echoBean.jar#ServicePort' /> <parameter name='handlerClass' value='org.jboss.webservice.server.InvokerProviderEJB' /> <operation name='echoCustomer' qname='ns1:echoCustomer' returnQName='ns2:echoCustomerResponse' returnType='ns2:echoCustomerResponse' xmlns:ns1='http://com.alon/service' xmlns:ns2='http://com.alon/service/types' > <parameter name='parameters' qname='ns2:echoCustomer' mode='IN' type='ns2:echoCustomer' xmlns:ns2='http://com.alon/service/types' /> </operation> <typeMapping qname='ns2:echoCustomer' xmlns:ns2='http://com.alon/service/types' type='java:com.alon.objects.Customer' serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory' deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory' encodingStyle=''> </typeMapping> <typeMapping qname='ns2:echoCustomerResponse' xmlns:ns2='http://com.alon/service/types' type='java:com.alon.objects.Customer' serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory' deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory' encodingStyle=''> </typeMapping> </service> </deployment>
wsdl:
<?xml version="1.0" encoding="UTF-8"?> <definitions name="CustomerEchoService" targetNamespace="http://com.alon/service" xmlns:tns="http://com.alon/service" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://com.alon/service/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <schema targetNamespace="http://com.alon/service/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://com.alon/service/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <complexType name="echoCustomer"> <sequence> <element name="Customer_1" nillable="true" type="tns:Customer"/></sequence></complexType> <complexType name="Customer"> <sequence> <element name="last" nillable="true" type="string"/> <element name="name" nillable="true" type="string"/></sequence></complexType> <complexType name="echoCustomerResponse"> <sequence> <element name="result" nillable="true" type="tns:Customer"/></sequence></complexType> <element name="echoCustomer" type="tns:echoCustomer"/> <element name="echoCustomerResponse" type="tns:echoCustomerResponse"/></schema> </types> <message name="repeaterEndpoint_echoCustomer"> <part name="parameters" element="ns2:echoCustomer"/> </message> <message name="repeaterEndpoint_echoCustomerResponse"> <part name="result" element="ns2:echoCustomerResponse"/> </message> <portType name="repeaterEndpoint"> <operation name="echoCustomer"> <input message="tns:repeaterEndpoint_echoCustomer"/> <output message="tns:repeaterEndpoint_echoCustomerResponse"/> </operation> </portType> <binding name="repeaterEndpointBinding" type="tns:repeaterEndpoint"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="echoCustomer"> <soap:operation soapAction=""/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="CustomerEchoService"> <port name="repeaterEndpointPort" binding="tns:repeaterEndpointBinding"> <soap:address location="http://localhost:8080/echoBean/CustomerEchoService"/> </port> </service> </definitions>
SEI
package com.alon.beans; import com.alon.objects.Customer; /** * @author Administrator * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public interface repeaterEndpoint extends java.rmi.Remote { public Customer echoCustomer(Customer cust)throws java.rmi.RemoteException; }
and the DII client:
private static String WSDL_LOC = "http://localhost:8080/echoBean/CustomerEchoService?wsdl"; private static String NAMESPACE = "http://com.alon/service"; private static QName SERVICE_NAME= new QName(NAMESPACE,"CustomerEchoService"); public static void main(String[] args) { try{ ServiceFactory factory = ServiceFactory.newInstance(); Service service = factory.createService(new URL(WSDL_LOC),SERVICE_NAME); Call call = (Call)service.createCall(new QName(NAMESPACE,"repeaterEndpointPort"),"echoCustomer"); Customer c = new Customer("test","client"); call.invoke(new Object[]{c});