• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your class must implement the java.io.Serializable interface, so that it can be serialised/de-serialised and sent back n forth
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Faraz Masood
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ahh i see ... thanks Ulf
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Suzanne Byington
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic