George
George

Reputation: 73

How does the SOAP server determine which operation it should perform?

I would like to ask what exactly is supposed to be in the Body element of the SOAP request. I would assume that it should be an element defining the name of the operation which I want to invoke. I would also assume that inside this element there should be a structure corresponding to the input parameter of this operation.

However, if I take the following WSDL: http://adisrws.mfcr.cz/adistc/axis2/services/rozhraniCRPDPH.rozhraniCRPDPHSOAP and let SoapUI generate the request for the getStatusNespolehlivyPlatce operation, the contents of the request will be:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:roz="http://adis.mfcr.cz/rozhraniCRPDPH/">
<soapenv:Header/>
<soapenv:Body>
  <roz:StatusNespolehlivyPlatceRequest>
     <roz:dic>00247618</roz:dic>
  </roz:StatusNespolehlivyPlatceRequest>
</soapenv:Body>
</soapenv:Envelope>

In the <soapenv:Body> there is not the name of the operation (getStatusNespolehlivyPlatce) but the name of the corresponding input parameter of the getStatusNespolehlivyPlatce operation. How does the SOAP server find out that I'm invoking the getStatusNespolehlivyPlatce operation?

  1. Does the server use the HTTP SOAPAction header to determine this? (which in this case is: SOAPAction: "http://adis.mfcr.cz/rozhraniCRPDPH/getStatusNespolehlivyPlatce")

  2. Does the server infer the operation solely from the underlying WSDL and the SOAP request (i.e. not looking at the HTTP headers)?

  3. How should the SOAP request look like according to the W3C standard if I (from the perspective of the server provider) decided not to use the SOAPAction HTTP header?

  4. Is it true that the use of the SOAPAction header is not obligatory and that it is only an information that simplifies work for the firewalls so that they don't have to parse the information about the operation requested from the XML request?

Thank you for your time.

Upvotes: 1

Views: 1139

Answers (1)

Zubair Ashraf
Zubair Ashraf

Reputation: 279

If I give you example of Axis2 Framework, It uses following steps to identify the service operation. Details are mentioned on below URL

http://wso2.com/library/176/

  • HTTP request uri
  • SOAPAction
  • QName of the first child of SOAP Body element
  • If WS-Addressing is enabled the address of To EPR (Endpoint Reference) and Action element

Upvotes: 1

Related Questions