axis.jar in apache axis comes with BeanSerializer.java and BeanDeserializer.java. These two classes are used by JAVA2WSDL and WSDL2JAVA respectively to serialize and deserialize classes that strictly adhere to java bean convention(null constructor and simple getters and setters). I want to write my own serializer and deserializer. But i dont know how to make JAVA2WSDL and WSDL2JAVA utilities to use them. I have searched the official axis website. There is no documentation in this case. If anybody has written own custom serializer and deserializer and have serialzied and deserialized your objects successfully. Please share the way to do the same.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35256
7
posted
0
Welcome to JavaRAnch.
The Axis documentation talk about how to do custom serialization. You don't need to adapt the tools, just the deployment descriptor.
What i did is i typed the following url in my browser http://localhost:8080/axis/services/userservices?wsdl I got the wsdl file. Now i want to create java classes from this wsdl file. To do so i typed the following: java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s -p client userservice.wsdl I opened UserRole.java file It has 2 methods as follows:
/** * 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); }
Here you can see that getSerializer and getDeserializer methods are returning BeanSerializer and BeanDeserializer respectively instead of CustomBeanSerializer and CustomBeanDeserializer. This is happening inspite of correct definition in server-config.wsdd file.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.