Submitted on June 18, 2006 - 07:12.
POST /axis2/services/EchoXMLService/echoOMElement HTTP/1.1What is the information available to identify the service and the operation?
User-Agent: Axis2
Host: 127.0.0.1
Content-Type: application/soap+xml; charset=UTF-8;action="EchoOMElement";
.....................
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header>
<wsa:To>http://127.0.0.1:5556/axis2/services/EchoXMLService/echoOMElement</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:AD147449058471C81E11506120248601</wsa:MessageID>
<wsa:Action>urn:EchoOMElement</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<ns1:echoOMElement xmlns:ns1="http://org.apache.axis2/xsd">
<ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
</ns1:echoOMElement>
</soapenv:Body>
</soapenv:Envelope>
| Information | Example Value |
|---|---|
| HTTP request uri | /axis2/services/EchoXMLService/echoOMElement |
| SOAPAction | action="EchoOMElement" |
| QName of the first child of SOAP Body element | <ns1:echoOMElement xmlns:ns1="http://org.apache.axis2/xsd"> |
| If WS-Addressing is enabled the address of To EPR (Endpoint Reference) and Action element | <wsa:To>http://127.0.0.1:5556/axis2/services/EchoXMLService/echoOMElement</ wsa:To> <wsa:Action>urn:EchoOMElement</wsa:Action> |
| Information | Dispatcher Name |
|---|---|
| HTTP request uri | org.apache.axis2.engine.RequestURIBasedDispatcher |
| SOAPAction | org.apache.axis2.engine.SOAPActionBasedDispatcher |
| QName of the first child of SOAP Body element | org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher |
| If WS-Addressing is enabled the address of To EPR (Endpoint Reference) and Action element | org.apache.axis2.engine.AddressingBasedDispatcher |
POST /axis2/services/EchoXMLService HTTP/1.1Here the RequestURIBasedDispatcher will find the service, but it has no information to find the operation. It will set the EchoXMLService in to message context as the service and pass through. Once SOAPActionBasedDispatcher gets its chance, it will first see that some one had found a service. Then having seen that, the operation has not been found, it tries to search for a operation from the SOAP action that it has received within the EchoXMLService. Example 2
User-Agent: Axis2
Host: 127.0.0.1
Content-Type: application/soap+xml; charset=UTF-8;action="EchoOMElement";
......................
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header />
<soapenv:Body>
<ns1:echo xmlns:ns1="http://org.apache.axis2/xsd">
<ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
</ns1:echo>
</soapenv:Body>
</soapenv:Envelope>
POST /other/proxy/url HTTP/1.1Here we are trying to send this SOAP message to a proxy and thus the http request URI can not be used to find either the service or the operation. At the same time the SOAP action is empty. But the user had send WS-Addressing headers and Addressing module is engaged in the receiving end. As you can see, value of <wsa:To> and <wsa:Action> headers can be used to find the correct service and the operation, without other information Successfulness of dispatching depends on the proper order of dispatchers in the execution chain. Now lets see how these can be ordered.
User-Agent: Axis2
Host: 127.0.0.1
Content-Type: application/soap+xml; charset=UTF-8;action="";
.....................
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header>
<wsa:To>http://127.0.0.1:5556/axis2/services/EchoXMLService</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:AD147449058471C81E11506120248601</wsa:MessageID>
<wsa:Action>urn:EchoOMElement</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<ns1:echoOMElement xmlns:ns1="http://org.apache.axis2/xsd">
<ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
</ns1:echoOMElement>
</soapenv:Body>
</soapenv:Envelope>
<phaseOrder type="inflow">As you can see our dispatchers are put in to different phases of the IN pipe (Phase is a section of Axis2 engine's execution path. Please refer to Apache Axis2 Architecture guide for more information about Phases).
<!-- System pre defined phases -->
<phase name="Transport">
<handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
</phase>
.........................
.........................
<phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
................
................
</phase>
...............................
...............................
</phaseOrder>
Service with parameter
Hi,
i know this is already beyond the hello world sample but may i ask how to implement a service which asks for a parameter then returns a value. Lets say i have a function public String getAlias(String firstName)... how do i go about in services.xml?... how do i call it through rest?
any response would be appreciated =)
thanks
- ayessa
Service with parameter
Hi,
i know this is already beyond the hello world sample but may i ask how to implement a service which asks for a parameter then returns a value. Lets say i have a function public String getAlias(String firstName)... how do i go about in services.xml?... how do i call it through rest?
any response would be appreciated =)
thanks
- ayessa
Service with parameter
Hi,
i know this is already beyond the hello world sample but may i ask how to implement a service which asks for a parameter then returns a value. Lets say i have a function public String getAlias(String firstName)... how do i go about in services.xml?... how do i call it through rest?
any response would be appreciated =)
thanks
- ayessa