Hi. I'm quite a newbie to Axis and Web Services and I'm stuck with the following problem : I need to create a simple Web service called Book which will have 2 methods : public BookDto getBook(Integer id); public boolean updateBookInteger id, BookDto newBook);
where BookDto is a DTO, serializable class and written conforming to the Java Beans specifications : it contains private java.lang.Integer id; private java.lang.String title; a default (non-arg) constructor and getter&setter methods.
and the java files, deploy.wsdd & undeploy.wsdd were created.
I implemented the methods in the BookSoapBindingImpl class as needed. Then, the implementation of the BookDto class was modified, the following code being added by the WSDL2Java tool :
========================================= // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(BookDto.class, true);
/ ** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; }
/** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); }
/** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } =============================================
After having compiled all these classes I deployed the Web Service (setting the java:RPC provider) and all the tests worked fine. BUT, I have to create my custom provider, named java:JWSFL (I am creating a framework for some basic web service orchestration) and I need to use it. So, in the deploy.wsdd file I specified provider="java:JWSFL" and redeployed the web service. But, when running the tests again, I got the following error : AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException faultSubcode: faultString: Deserializing parameter 'in1': could not find deserializer for type {urn:Book}BookDto faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:makshe
I must mention that the getBook method works, so I am able to receive a BookDto, but I can't invoke the updateBook (which must send a BookDto class).
In the client I registered it like this :
QName qn = new QName("urn:Book", "BookDto" ); call.registerTypeMapping(UserDto.class, qn, // *3* new org.apache.axis.encoding.ser.BeanSerializerFactory (BookDto.class, qn), new org.apache.axis.encoding.ser.BeanDeserializerFactory (BookDto.class, qn)); call.addParameter("in0", XMLType.XSD_INTEGER, ParameterMode.IN); call.addParameter("in1", qn, ParameterMode.IN);