Could not find deserializer for type
ameisinger May 31, 2005 8:00 AMHi,
I have created a webservice and deployed it on jboss. The webservice has three different methods.
Testing the business-methods: sayHello is OK, meetAnimal is not OK, createAnimal is not OK, too.
Any ideas what's going wrong?
How can I prevent: could not find deserializer and No serializer found for class?
String meetAnimal(Animal) delivers the following error message:
AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: Deserializing parameter 'in0': could not find deserializer for type {http://Hello}Animal faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: Deserializing parameter 'in0': could not find deserializer for type {http://Hello}Animal faultActor: faultNode: faultDetail: Deserializing parameter 'in0': could not find deserializer for type {http://Hello}Animal at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:262) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
Animal createAnimal(ing, String) delivers following error message:
AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (500)Internal Server Error faultActor: faultNode: faultDetail: {}:return code: 500 [...] The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.jboss.axis.AxisFault: No serializer found for class tutorial.interfaces.Animal in registry org.jboss.axis.encoding.TypeMappingImpl@adf91 org.jboss.axis.AxisFault.makeFault(AxisFault.java:99) org.jboss.axis.MessagePart.writeTo(MessagePart.java:303) org.jboss.axis.MessagePart.getAsString(MessagePart.java:591) org.jboss.axis.MessagePart.getAsBytes(MessagePart.java:447) org.jboss.axis.Message.getContentType(Message.java:471) org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:971) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.9</h3></body></html> {http://xml.apache.org/axis/}HttpErrorCode:500
My test-client:
package tutorial.testing; import java.net.URL; import javax.xml.namespace.QName; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceFactory; public class WSClient { public static void main(String[] args) throws Exception { URL url = new URL("http://ga_server:8080/TutorialCustom/TutorialHelloEndpoint?wsdl"); QName qname = new QName("http://Hello", "TutorialHelloEndpointService"); ServiceFactory factory = ServiceFactory.newInstance(); Service service = factory.createService(url, qname); TutorialHelloEndpoint endpoint = (TutorialHelloEndpoint) service.getPort(TutorialHelloEndpoint.class); // testing business-method: String sayHello(String) String sayHelloVal = endpoint.sayHello("Wuff"); System.out.println(sayHelloVal); // testing business-method: String meetAnimal(Animal) Animal myDog = new Animal(); myDog.setAge(10); myDog.setName("Goofy"); String meetAnimalVal = endpoint.meetAnimal(myDog); System.out.println(meetAnimalVal); // testing business-method: Animal createAnimal(int, String) Animal yourDog = endpoint.createAnimal(12,"Lassie"); System.out.println("Your dog " + yourDog.getName() + " is " + yourDog.getAge() + " years old."); } }
/** * TutorialHelloEndpoint.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2alpha Dec 01, 2003 (04:33:24 EST) WSDL2Java emitter. */ package tutorial.testing; public interface TutorialHelloEndpoint extends java.rmi.Remote { public java.lang.String sayHello(java.lang.String in0) throws java.rmi.RemoteException; public java.lang.String meetAnimal(tutorial.testing.Animal in0) throws java.rmi.RemoteException; public tutorial.testing.Animal createAnimal(int in0, java.lang.String in1) throws java.rmi.RemoteException; }
My wsdl-file:
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://Hello" xmlns:impl="http://Hello" xmlns:intf="http://Hello" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!--WSDL created by Apache Axis version: 1.2 Built on May 03, 2005 (02:20:24 EDT)--> <wsdl:types> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://Hello"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="Animal"> <sequence> <element name="age" type="xsd:int"/> <element name="name" nillable="true" type="soapenc:string"/> </sequence> </complexType> </schema> </wsdl:types> <wsdl:message name="sayHelloRequest"> <wsdl:part name="in0" type="soapenc:string"/> </wsdl:message> <wsdl:message name="meetAnimalRequest"> <wsdl:part name="in0" type="impl:Animal"/> </wsdl:message> <wsdl:message name="sayHelloResponse"> <wsdl:part name="sayHelloReturn" type="soapenc:string"/> </wsdl:message> <wsdl:message name="createAnimalResponse"> <wsdl:part name="createAnimalReturn" type="impl:Animal"/> </wsdl:message> <wsdl:message name="meetAnimalResponse"> <wsdl:part name="meetAnimalReturn" type="soapenc:string"/> </wsdl:message> <wsdl:message name="createAnimalRequest"> <wsdl:part name="in0" type="xsd:int"/> <wsdl:part name="in1" type="soapenc:string"/> </wsdl:message> <wsdl:portType name="TutorialHelloEndpoint"> <wsdl:operation name="sayHello" parameterOrder="in0"> <wsdl:input name="sayHelloRequest" message="impl:sayHelloRequest"/> <wsdl:output name="sayHelloResponse" message="impl:sayHelloResponse"/> </wsdl:operation> <wsdl:operation name="meetAnimal" parameterOrder="in0"> <wsdl:input name="meetAnimalRequest" message="impl:meetAnimalRequest"/> <wsdl:output name="meetAnimalResponse" message="impl:meetAnimalResponse"/> </wsdl:operation> <wsdl:operation name="createAnimal" parameterOrder="in0 in1"> <wsdl:input name="createAnimalRequest" message="impl:createAnimalRequest"/> <wsdl:output name="createAnimalResponse" message="impl:createAnimalResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="TutorialHelloEndpointPortSoapBinding" type="impl:TutorialHelloEndpoint"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="sayHello"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="sayHelloRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://Hello"/> </wsdl:input> <wsdl:output name="sayHelloResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://Hello"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="meetAnimal"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="meetAnimalRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://Hello"/> </wsdl:input> <wsdl:output name="meetAnimalResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://Hello"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="createAnimal"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="createAnimalRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://Hello"/> </wsdl:input> <wsdl:output name="createAnimalResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://Hello"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="TutorialHelloEndpointService"> <wsdl:port name="TutorialHelloEndpointPort" binding="impl:TutorialHelloEndpointPortSoapBinding"> <wsdlsoap:address location="http://this.value.is.replaced.by.jboss"/> </wsdl:port> </wsdl:service> </wsdl:definitions>