You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Taner Diler <ta...@hotmail.com> on 2003/05/09 08:19:14 UTC
java.io.IOException: No serializer found for ...
I try to develope simple web service. Codes are below:
public class User {
public String name;
public String lastname;
}
public class Implementer {
public User getUser(){
User u = new User();
u.name = "taner";
u.lastname = "diler";
return u;
}
}
I copy User.class to axis\webapps\web-inf\classes.
I copy Implementer.java to axis\webapps changing java to jws extension.
When I import wsdl to delphi, User class is created in delphi. no problem in
wsdl.
when I call getUser() method in delphi,
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: java.io.IOException: No serializer found for class User
registry org.apache.axis.encoding.TypeMappingImpl@1aacd5f
faultActor: null
faultDetail:
stackTrace: java.io.IOException: No serializer found for class
Person in
registry org.apache.axis.encoding.TypeMappingImpl@1aacd5f
at
org.apache.axis.encoding.SerializationContextImpl.serializeActual(Ser
ializationContextImpl.java:1235)
at
org.apache.axis.encoding.SerializationContextImpl.serialize(Serializa
tionContextImpl.java:756)
...
I get this error in tomcat.
to solve this problem, what can I do?
Re: java.io.IOException: No serializer found for ...
Posted by Subhrajyoti Moitra <su...@contata.co.in>.
make User follow Javabeans conventions..
which means your User class is now
public class User implements java.io.Serializable{
private String name;
private String lastname;
//getter setter for the variables
}
register the class through the <beanmapping> in deploy.wsdd
<beanMapping qname="local:User" xmlns:local="urn:MyService"
languageSpecificType="java:com.mywebservice.User"/>
(ake the necessary changes... )
in the client register the type
QName qn1 = new QName( "urn:MyService", "User" );
call.registerTypeMapping(User.class, qn1,
new org.apache.axis.encoding.ser.BeanSerializerFactory(User.class, qn1),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(User.class, qn1));
hope this helps...
----- Original Message -----
From: "Taner Diler" <ta...@hotmail.com>
To: <ax...@ws.apache.org>
Sent: Friday, May 09, 2003 11:49 AM
Subject: java.io.IOException: No serializer found for ...
> I try to develope simple web service. Codes are below:
>
> public class User {
> public String name;
> public String lastname;
> }
>
> public class Implementer {
> public User getUser(){
> User u = new User();
> u.name = "taner";
> u.lastname = "diler";
> return u;
> }
> }
>
> I copy User.class to axis\webapps\web-inf\classes.
> I copy Implementer.java to axis\webapps changing java to jws extension.
> When I import wsdl to delphi, User class is created in delphi. no problem
in
> wsdl.
>
> when I call getUser() method in delphi,
>
> faultCode: {http://xml.apache.org/axis/}Server.userException
> faultString: java.io.IOException: No serializer found for class User
> registry org.apache.axis.encoding.TypeMappingImpl@1aacd5f
> faultActor: null
> faultDetail:
> stackTrace: java.io.IOException: No serializer found for class
> Person in
> registry org.apache.axis.encoding.TypeMappingImpl@1aacd5f
> at
> org.apache.axis.encoding.SerializationContextImpl.serializeActual(Ser
> ializationContextImpl.java:1235)
> at
> org.apache.axis.encoding.SerializationContextImpl.serialize(Serializa
> tionContextImpl.java:756)
> ...
>
> I get this error in tomcat.
>
> to solve this problem, what can I do?
>