Hi,
I think the problem is that you are trying to pass a data type for which there is no serializer implemented for by default in Axis.


The list of default data types supported is:

xsd:base64Binary        byte[]
xsd:boolean     boolean
xsd:byte        byte
xsd:dateTime    java.util.Calendar
xsd:decimal     java.math.BigDecimal
xsd:double      double
xsd:float       float
xsd:hexBinary   byte[]
xsd:int int
xsd:integer     java.math.BigInteger
xsd:long        long
xsd:QName       javax.xml.namespace.QName
xsd:short       short
xsd:string      java.lang.String


One way to go around the problem would be to transform your Document into a String and then pass that string as argument to your web service method. The other, cleaner, way would be to implement a custom serializer to handle the Document objects.


Cheers.
Andre.


ial wrote:
Hi,
Brand new to axis and we created a message service that takes in a Document
and returns a Document. Our client code is below which we modeled off of the
Hello World message sample shipped with Axis. We are now getting this
exception with the client code below and do not know what to do.

OUR SERVICE WSDL
----------------------------------
<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/";
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";
            xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";>
  <!-- note that either style="message" OR provider="java:MSG" both work -->
  <service name="ReplicationServer" style="message">
    <parameter name="className"
value="org.openmrm.core.replication.WebServicesTransporter" />
    <parameter name="allowedMethods" value="processInboundData
generateOutboundData processOutboundResults" />
  </service>
</deployment>


OUR SERVICE METHOD SIGNATURE ------------------------------------------------------- public Document processInboundData(Document xmlData) throws Exception {


CALLING CLIENT CODE ------------------------------------

String[] args = new String[1];
Options opts = new Options(args);
opts.setDefaultURL(webservice_url);
Service service = new Service();
Call call = (Call)service.createCall();
call.setOperationName("processInboundData"); // our remote service method
call.setOperationStyle("document");
call.setOperationUse("literal");

call.setTargetEndpointAddress( new URL(opts.getURL()) );
SOAPBodyElement[] input = new SOAPBodyElement[1];
input[0] = new SOAPBodyElement((Element)data.getRootElement());
Vector elems = (Vector) call.invoke("processInboundData",input);


EXCEPTION ON CLIENT --------------------------------------

java.io.IOException: No serializer found for class
org.apache.axis.message.SOAPBodyElement in registry
[EMAIL PROTECTED]
 at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
 at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:272)
 at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:483)
 at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:375)
 at org.apache.axis.Message.getContentType(Message.java:399)
 at
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:341)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122)
 at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
71)
 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
 at org.apache.axis.client.Call.invoke(Call.java:2553)
 at org.apache.axis.client.Call.invoke(Call.java:2248)
 at org.apache.axis.client.Call.invoke(Call.java:2171)
 at org.apache.axis.client.Call.invoke(Call.java:2196)
 at
org.openmrm.core.replication.WebServicesTransporter.sendOutboundData(WebServ
icesTransporter.java:92)


-- Andre Charbonneau

100 Sussex Drive, Rm 2025
Research Computing Support, IMSB
National Research Council Canada
Ottawa, ON, Canada K1A 0R6
613-993-3129  Fax: 613-993-3127



Reply via email to