Axis error - No serializer found...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Axis error - No serializer found...

  1. #1
    Join Date
    May 2006
    Posts
    4

    Axis error - No serializer found...

    I am trying to invoke a webservice passing in a custom java bean object, which I have "beanmapped" in the deploy.wsdd but I keep getting the No serializer found for class ... in registry org.apache.axis.encoding.TypeMappingDelegate@e70e30 axis fault.

    Java code snippet:

    Code:
    Request request = new Request();
    ...
    Service service = new Service();
     
    Call call = (Call)service.createCall();
    call.setTargetEndpointAddress(new java.net.URL(endpointURL));
    call.setOperationName(operation);
    call.addParameter("arg1", new QName("Request", "local"), ParameterMode.IN);
    call.setReturnType(new QName("Response", "local"));
     
    Response response = (Response)call.invoke(new Object[] {request});
    deploy.wsdd:

    HTML Code:
    <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    	<service name="myWebservice" provider="java:RPC">
    		<parameter name="className" value="com.test.webservice"/>
    		<parameter name="allowedMethods" value="retrieveData"/>
    		<beanMapping qname="ns:local" xmlns:ns="Request" languageSpecificType="java:com.test.messaging.Request"/>
    		<beanMapping qname="ns:local" xmlns:ns="Response" languageSpecificType="java:com.test.messaging.Response"/>
    	</service>
    </deployment>

  2. #2
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    have you done the typemapping in your bean class?
    eg:
    Code:
    	public static void registerTypeMapping(Call call) {
    		call.registerTypeMapping(MYBEAN.class, QNAME,
    				new BeanSerializerFactory(MYBEAN.class, QNAME),
    				new BeanDeserializerFactory(MYBEAN.class, QNAME));
    	}

  3. #3
    Join Date
    May 2006
    Posts
    4
    Hmm, I wasn't aware you needed to do that. None of the tutorials I read said anything about that. I will give it a try though. Cheers

  4. #4
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    registering a custom bean looks usually like this:

    Code:
    call.setOperation("myoperation");
    call.addParameter("parameter1", Constants.XSD_STRING,
    	javax.xml.rpc.ParameterMode.IN);
    call.addParameter("parameter2", Constants.XSD_BASE64,
    	javax.xml.rpc.ParameterMode.IN);
    call.addParameter("parameter3", Constants.XSD_BASE64,
    	javax.xml.rpc.ParameterMode.IN);
    call.setReturnType(MYBEAN.QNAME);
    MYBEAN.registerTypeMapping(call);
    where mybean looks like this:

    Code:
    public class MYBEAN{
    	private boolean successful;
    	private String message;
    	private String returnedxml;
    	public static final QName QNAME = new QName(
    			"http://mybean.anyhost.de", "MYBEAN");
    
    	public final String getMessage() {
    		return message;
    	}
    
    	public final void setMessage(String status) {
    		this.message = status;
    	}
    
    	public static void registerTypeMapping(Call call) {
    		call.registerTypeMapping(MYBEAN.class, QNAME,
    			new BeanSerializerFactory(MYBEAN.class, QNAME),
    			new BeanDeserializerFactory(MYBEAN.class, QNAME));
    	}
    
    	public final boolean isSuccessful() {
    		return successful;
    	}
    
    	public final void setSuccessful(boolean successful) {
    		this.successful = successful;
    	}
    
    	public final String getReturnedXml() {
    		return returnedxml;
    	}
    
    	public final void setReturnedXml(String returnedxml) {
    		this.returnedxml= returnedxml;
    	}
    }

Similar Threads

  1. 'Page not found' with .aspx and .asmx pages
    By DBix001 in forum ASP.NET
    Replies: 3
    Last Post: 04-18-2007, 04:58 PM
  2. AXIS C++ Help
    By shawnbruman in forum C++
    Replies: 0
    Last Post: 03-29-2006, 12:44 PM
  3. Replies: 1
    Last Post: 12-31-2005, 10:29 AM
  4. Java Mail Error
    By ddsuresh in forum Java
    Replies: 1
    Last Post: 12-29-2005, 09:58 AM
  5. Replies: 0
    Last Post: 01-17-2002, 07:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center