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

不羁的心 提交于 2020-01-16 07:58:09

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/26745501/how-does-the-soap-server-determine-which-operation-it-should-perform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!