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 Mr HrH Himself <hr...@yahoo.com> on 2004/02/03 18:59:23 UTC
Please help...
Hi,
I am new to axis. I searched through the Archives and read posts related to my problem. I applied some of the suggestions and yet I can't resolve the problem. The problem has to do with deserializer:
I have 2 beans, a service and a client class. I compiled them, placed the class files for the beans and the service under the Tomcat4.1_Server_root\webapp\axis\myclasses.
I created a wsdd file and deployed my service using the client admin class. When running my client I get the following error:
Error : org.xml.sax.SAXException: No deserializer for {urn:PublicService}Param
Here are the code snippets and as you see this is a very simple example.
public class Request{
private Param _parmData;
// getter and setter methods are not shown
}
public class Param implements implements java.io.Serializable{
private String _name;
private Obejct _value;
// getter and setter methods are not shown
}
Here is part of the service class:
public class PublicService
{
public Param getBusinessLocation(Request req){
Param name = new Param();
name.setName("BUSINESS_NAME");
name.setValue("IBM");
busLoc.add(name);
return name;
}
}
Here is the Client class:
public class Client
{
public static void main(String [] args) throws Exception
{
Options options = new Options(args);
Request req = new Request();
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:PublicService", "Request" );
call.registerTypeMapping(Request.class, qn,
new org.apache.axis.encoding.ser.BeanSerializerFactory(Request.class, qn),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(Request.class, qn));
try {
call.setTargetEndpointAddress( new java.net.URL(options.getURL()) );
call.setOperationName( new QName("getBusinessLocation", "getBusinessLocation") );
call.addParameter( "arg1", qn, ParameterMode.IN );
call.setReturnClass(Collection.class);
Param result = (ArrayList) call.invoke( new Object[] { req } );
String value = (String)result.getValue();
System.out.println(result.getName()+" "+value);
} catch (AxisFault fault) {
String error = "Error : " + fault.toString();
System.out.println(error);
}
}
Here is my deploy.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="getBusinessLocation" provider="java:RPC" style="wrapped">
<parameter name="className" value="apacheaxis.PublicService"/>
<parameter name="allowedMethods" value="getBusinessLocation"/>
<beanMapping qname="myNS:Request" xmlns:myNS="urn:PublicService" languageSpecificType="java:apacheaxis.Request"/>
<beanMapping qname="myNS:Param" xmlns:myNS="urn:PublicService" languageSpecificType="java:apacheaxis.Param"/>
</service>
</deployment>
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!