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 Jesper Söderlund <Je...@smarttrust.com> on 2002/06/03 10:25:56 UTC
one-way notification in Axis?
I tried to use invokeOneWay to send a callback notification to a client without expecting any reply but Axis replies with: "SaxException: The document's root element could not be found" .
This comes from the HTTP-reply message doesn't contain any message at all since it's a pure "notification" and not a "SolicitResponse" style of interaction. I guess that axis is looking for a SOAP-envelop. Is there a way around this limitation and make it a "pure" notification.
The code I'm using to invoke the callback notification looks like this:
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( myCallback.getUrl() );
call.setOperationName( new QName("testnamespace", "Notification") );
call.addParameter( "result", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("transactionId", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType( XMLType.AXIS_VOID );
call.invokeOneWay(new Object[] { "success", myCallback.getTransactionId()} );
The "log" from tcpmon looks like the following:
Request:
POST /myservice/callbacklistener HTTP/1.0
Content-Length: 681
Host: localhost
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ <http://schemas.xmlsoap.org/soap/encoding/> " xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/ <http://schemas.xmlsoap.org/soap/envelope/> " xmlns:xsd="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance <http://www.w3.org/2001/XMLSchema-instance> " xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/ <http://schemas.xmlsoap.org/soap/encoding/> ">
<SOAP-ENV:Body>
<ns1:Notification xmlns:ns1="testnamespace <http://www.smarttrust.com/enrollment/> ">
<result xsi:type="xsd:string">org.apache.axis.message.RPCParam@fefe3f</result>
<transactionId xsi:type="xsd:string">org.apache.axis.message.RPCParam@e61a35</transactionId>
</ns1:Notification>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response:
HTTP/1.1 200 OK
Content-Length: 0
Date: Mon, 03 Jun 2002 08:03:17 GMT
Server: Apache Tomcat/4.0.2 (HTTP/1.1 Connector)
(invoking the service with "invoke(new Object[] {"astring", "2destring"} );" got rid of the object references, so that also seems to be a "bug" in invokeOneWay, otherwise the same problems.
It would be great if someone had any insight into this.
/Jesper