File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Axis fault: java.io.IOException: No serializer found for class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis fault: java.io.IOException: No serializer found for class" Watch "Axis fault: java.io.IOException: No serializer found for class" New topic
Author

Axis fault: java.io.IOException: No serializer found for class

jeetu krishnan
Greenhorn

Joined: Feb 13, 2006
Posts: 12
Does anyone know how to pass java objects as a parameter in a web service call ? can you provide a sample client code.

I am getitng the following error when trying to invoke the webservice using a client generated by axis:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.io.IOException: No serializer found for class ObjectDSConstructor.objectDS.MyObject in registry org.apache.axis.encoding.TypeMappingDelegate@1c7865b
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.io.IOException: No serializer found for class ObjectDSConstructor.objectDS.MyObject in registry org.apache.axis.encoding.TypeMappingDelegate@1c7865b
Faraz Masood
Ranch Hand

Joined: May 03, 2002
Posts: 55
I think your class must implement the java.io.Serializable interface, so that it can be serialised/de-serialised and sent back n forth
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39537
    
  27
No, it's not about the Serializable interface. In the context of web services, serialization means the objects to be transported over SOAP need to be convertable to XML and back.

If you're trying to send an object Axis doesn't know, you need to configure a serializer to be used. If the object has bean characteristics, you can use the BeanSerializer that comes with Axis. If it doesn't, you need to implement custom serialization classes.

In general it's preferable to use standard data types only (in other words, not to use custom classes). That gives you a better chance to create a WS that works cross-platform.


Ping & DNS - updated with new look and Ping home screen widget
Faraz Masood
Ranch Hand

Joined: May 03, 2002
Posts: 55
ahh i see ... thanks Ulf
Suzanne Byington
Greenhorn

Joined: Jun 24, 2005
Posts: 2
I agree that whenever possible, use the axis standard supported object types for objects returned from public methods in the web service. For those who are interested. I have experience returning custom objects to a C++ client.

Netbeans automatically added the definitions for the custom types into the wsdl file; however, I had to manually add the line to export/register the custom type as available by adding the following to my myWS.deploy.wsdd file:
<beanMapping qname="myNS:InformationCorrection" xmlns:myNS="urn:myWS" languageSpecificType="java:myservice.model.InformationCorrection"/>

InformationCorrection is my custom object and is located in myservice/model/InformationCorrection.java in my web service project.

Here is the entire contents of my myWS.deploy.wsdd file:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="myWS" provider="java:RPC">
<parameter name="className" value="myservice.myWS"/>
<parameter name="allowedMethods" value="*"/>
<beanMapping qname="myNS:InformationCorrection" xmlns:myNS="urn:myWS" languageSpecificType="java:myservice.model.InformationCorrection"/>
</service>
</deployment>


SB
Suzanne Byington
Greenhorn

Joined: Jun 24, 2005
Posts: 2
I failed to mention that adding the bean mapping to the deploy.wsdd file as I described above will fix the issue originally reported in this topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis fault: java.io.IOException: No serializer found for class
 
Similar Threads
Axis + CGLIB = BeanSerializerFactory problems
AxisSOAPWebserce
File into object stream
Axis No Serializer Found error...
Using ResultSet as return Type in Web Services