axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Blair <hrh...@yahoo.com>
Subject Re: No serializer found for class
Date Fri, 20 Feb 2004 18:22:04 GMT
Hi there,
 
Adding bean mapping and the type mapping in your wsdd will create the ser/Deser on the server
side. You also need to define ser/deser on the client side for each complex type in your Call.invoke()
method. Let me know if you have more questions on this.
 
Regards,
Tony.

Rajagopal <rajagopal@govindaraj.com> wrote:
Hi,

I am new to web services and axis. I am trying to host a web service in
axis using RPC pattern and document binding. When I run the test client
I get a "serializer not found" exception. I tried specifying a
beanMapping and typeMapping but still got the same error. I have copied
the java files and the WSDD. Could someone help?

Thanks,
Rajagopal

My JAXM servlet
===============
package com.dnb.edms.servlet;

import javax.xml.messaging.JAXMServlet;
import javax.xml.messaging.ReqRespListener;
import javax.xml.soap.SOAPMessage;

public class MyService
extends JAXMServlet
implements ReqRespListener {
public SOAPMessage onMessage(SOAPMessage oMessage) {
return oMessage;
}
}

WSDD
====
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
use="literal">







WSDL generated by Axis
======================

targetNamespace="http://localhost:8080/testaxis/services/MyService" 
xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:impl="http://localhost:8080/testaxis/services/MyService" 
xmlns:intf="http://localhost:8080/testaxis/services/MyService" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tns1="http://" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">









name="onMessageRequest"/>
name="onMessageResponse"/>



transport="http://schemas.xmlsoap.org/soap/http"/>



namespace="http://localhost:8080/testaxis/services/MyService"
use="literal"/>


namespace="http://localhost:8080/testaxis/services/MyService"
use="literal"/>





location="http://localhost:8080/testaxis/services/MyService"/>




My Test Client
==============
package com.dnb.edms.test;

import java.net.URL;

import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;

import org.apache.axis.client.Service;

import com.dnb.edms.client.MyServiceSoapBindingStub;

class TestService {
public static void main(String args[]) throws Exception {
MyServiceSoapBindingStub oStub = new MyServiceSoapBindingStub(new
URL("http://localhost:8080/testaxis/services/MyService"), new
Service());
//MyServiceSoapBindingStub oStub = new MyServiceSoapBindingStub();

MessageFactory oMsgFactory = MessageFactory.newInstance();

// Create a message from the message factory.
SOAPMessage oRequest = oMsgFactory.createMessage();

// Get the SOAP part.
SOAPPart sp = oRequest.getSOAPPart();

// Retrieve the oSOAPEnv from the soap part to start building
// the SOAP message.
SOAPEnvelope oSOAPEnv = sp.getEnvelope();

// Create a soap header from the oSOAPEnv.
SOAPHeader hdr = oSOAPEnv.getHeader();

// Create a soap body from the oSOAPEnv.
SOAPBody oSOAPBody = oSOAPEnv.getBody();

// Add a soap body element to the soap body
SOAPBodyElement customerDetails =
oSOAPBody.addBodyElement(oSOAPEnv.createName("customer"));
SOAPElement oCust =
customerDetails.addChildElement(oSOAPEnv.createName("Name"));
oCust.addTextNode("RG");

System.out.println("Request:");
oRequest.writeTo(System.out);

SOAPMessage oReply = (SOAPMessage) oStub.onMessage(oRequest);

System.out.println("Response:");
oReply.writeTo(System.out); 
}
}

The stack trace of the error I get
==================================
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: java.io.IOException: No serializer found for class
org.apache.axis.Message in registry
org.apache.axis.encoding.TypeMappingImpl@1aa9f99
faultActor: null
faultDetail: 
stackTrace: java.io.IOException: No serializer found for class
org.apache.axis.Message in registry
org.apache.axis.encoding.TypeMappingImpl@1aa9f99
at
org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1235)
at
org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:756)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:224)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:305)
at
org.apache.axis.message.MessageElement.output(MessageElement.java:746)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:142)
at
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:401)
at
org.apache.axis.message.MessageElement.output(MessageElement.java:746)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:273)
at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:488)
at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:379)
at org.apache.axis.Message.getContentType(Message.java:400)
at
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:345)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:127)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:126)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:182)
at org.apache.axis.client.Call.invokeEngine(Call.java:2113)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1851)
at org.apache.axis.client.Call.invoke(Call.java:1777)
at org.apache.axis.client.Call.invoke(Call.java:1315)
at
com.dnb.edms.client.MyServiceSoapBindingStub.onMessage(MyServiceSoapBindingStub.java:85)
at com.dnb.edms.test.TestService.main(TestService.java:62)


java.io.IOException: No serializer found for class
org.apache.axis.Message in registry
org.apache.axis.encoding.TypeMappingImpl@1aa9f99
at org.apache.axis.AxisFault.makeFault(AxisFault.java:120)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:275)
at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:488)
at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:379)
at org.apache.axis.Message.getContentType(Message.java:400)
at
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:345)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:127)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:126)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:182)
at org.apache.axis.client.Call.invokeEngine(Call.java:2113)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1851)
at org.apache.axis.client.Call.invoke(Call.java:1777)
at org.apache.axis.client.Call.invoke(Call.java:1315)
at
com.dnb.edms.client.MyServiceSoapBindingStub.onMessage(MyServiceSoapBindingStub.java:85)
at com.dnb.edms.test.TestService.main(TestService.java:62)
Caused by: java.io.IOException: No serializer found for class
org.apache.axis.Message in registry
org.apache.axis.encoding.TypeMappingImpl@1aa9f99
at
org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1235)
at
org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:756)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:224)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:305)
at
org.apache.axis.message.MessageElement.output(MessageElement.java:746)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:142)
at
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:401)
at
org.apache.axis.message.MessageElement.output(MessageElement.java:746)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:273)
... 16 more
Exception in thread "main" 

---------------------------------
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
Mime
View raw message