axis 2サービス、操作のロジックを探しています。


What is the Information Available for Identification?
First,let's see what information is available to find the corect operation.Let me show You a typical http request.We will limit the scope of this totratp requests.as.Tratorstratorst protorstrators the。
POST /axis2/services/EchoXMLService/echoOMElement HTTP/1.1
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>
What is the information available to identify the service and the operation?
Information Example Value
HTTP request uri
//axis 2/services/EchocXMLService/echoOMElement
ソAPアクション
action=「EchoMElement」
QName of the first child of SOAP Body element
<ns 1:echoOMElement xmlns:ns 1=”http://org.apache.axis2/xsd">>
If WS-Addresing is enabled the address of To EPR(Endpoint Reference)andアクションelement
<ws a:To>http://127.0.0.1:5556/axis2/services/EchoXMLService/echoOMElementurn:EchoMElement
This is the exact information we use inside Axis 2 in order to find the proper destination.The four“dispatchers”inside Axis 2 taes care of each and every piece of information mentioned able.
Information Displatch Name
HTTP request uri
org.apache.axis.engine.RequestURIBased Displatch
ソAPアクション
org.apache.axis.engine.SOAPAction BasedDisplatch
QName of the first child of SOAP Body element
org.apache.axis.engine.SOAPMessage Body BasedDisplatch
If WS-Addresing is enabled the address of To EPR(Endpoint Reference)andアクションelement
org.apache.axis.engine.AddresingBasedDisplatch
How Does The Displatch Work?
All the dispatchers first try to find the service with the information it has.They do this if the dispatchrs invoked before it had aservice.If the service is already found,the findSerSevice the thethe fidededestststststststininininininininininininininininininininininininstststststststststststststststststststaaaaathththththththththththththththththththththththththththththththththththththththce is found by then.Again,the didispatcher will dothisonlyiifefe dispatchers invoked prit had had not found operation.Likewise、all the dispatchers put a collaabobobobobobobobobobot in doing this.Thisisiswill enablle enaable e eaaaaaable didiaaaaaaaaaaaaaaablle didididididididididiaaaatttttttttttttttttttttttttttttdidididididididididididiatttttttttservice,but it hasのinformation to find the operation.The n Request URIBased Displatch will set the service it found to the message contextThe other dispatcher extract the service information from the message context and try to find an operation.
What Does Each Displatch Do?
RequestURIBasediDiscpatch-It will get the request URI and tries to find the operation.First,itwill remove the/axis 2/services parts from the URI.(Remember,aaxis 2/services 2/services)can scscscororororororaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazs 2/sededededededededededededededededededededededededededededededededededelement),tries to search for a service which has the name「EchoXMLService」.If found,it tries to find an operation named「echoOMElement」within the found service.SOAPAction BasedDispactch-This dispatcher can onlyfind the relevant operation,if「Within the service it gets from the message context.SOAPMessagageBodBasedDiscpatr-This will get the QName of the first childthe SOAP bodelement and seararch aaxis 2 configration for a service andandaaatttdededededededededededededededededededededededededededededededededededededededererererererererereaaaaaaaaaaaaaaaaatttttttttttttttttttttttttttttttvelope and Addresingmodule is engaged.This will search for a service and operation、just like the RequestUR IBased Displatch、except that it gets the information from the WS-Addresing header in the message.This will use the value ofto find the service and the value ofto find the operation.One partion the the partion。but must have least amount of information to identify the operation.And as I mentionned earlier,it can be a commbination of two dispatchers that will ultimately find the service and operation.Let's check out some samples in oder to Frther unders how this works widith fferent SOAP message.Let's's's mucherschement Mders。
POST /axis2/services/EchoXMLService
 HTTP/1.1
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>
Here the RequestUR IBasedididipattch will find the service、but it hasのinformation to find the operation.It will set the EchchchcheMLService to messagagage asasasas the service and pass through.Onese SOAPproctecattspspspececececttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttthas not been found、it tries to search for a operation from the SOAP action that it has received within the EchoXMLService.Example 2
POST /other/proxy/url HTTP/1.1
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>
Here we are trying to send this SOAP message to a proxy and thus the http request URI can not be used to find einthe service or the operation.At the same time the SOAP action is empty.But the user had sedereed S-Addressvalue ofandheaders can be used to find the corect service and the operation、without other information Success fulness of dispatching ders the proper of disporders the extre.orse.Noders。
How Can I Change The Order and The Number Of Dispares?
Disptch can be ordedeed in any way an administrator prefers.And he can decide which dispatchers to be included for dispatching and to remove ret of the dispatchers.To do this,simply edit the
<phaseOrder type="inflow">
    <!--  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>
As You can see our dispatchers are put in to different phass of the IN pipe(Phose is a section of Axis 2 engine's execution path.Please refer to Apache Axis 2 Architectureガイド for more information about Phashes)
What if Axis 2 Engine cannot Find a Service and an Operation For a Message?
If Axis 2 engine cannot find a service and an operation for a message、it immediately fails、sending a fault to the sender.
  • If service not found-「Service Not found EPR is<the epr it had received>」
  • If service found but not an operation-「Operation Not found EPR is<the epr it had received>and WSA Act=<the operation name it had received>」
  • So when you see these errors next time,you know what to do.