2015-02-12 31 views
3

在WSDL的以下摘錄,在該行WSDL綁定 - 的soapAction值

<soap1:operation style="document" soapAction="petition" 

是什麼指定

  • 的soapAction = 「上訪」

VS之間的差值

  • soapA ction = 「/服務/ ReincarnationPermitService.serviceagent/ReincarnationRequestPortTypeEndpoint /上訪」

<wsdl:service name="ReincarnationPermitService"> 
    <wsdl:port name="ReincarnationRequestPortTypeEndpoint" binding="tns:ReincarnationRequestPortTypeEndpointBinding"> 
     <soap1:address location="http://sheol:666/Services/ReincarnationPermitService.serviceagent/ReincarnationRequestPortTypeEndpoint"/> 
    </wsdl:port> 
</wsdl:service> 
<wsdl:portType name="ReincarnationRequestPortType"> 
    <wsdl:operation name="acceptRequest"> 
     <wsdl:input message="tns:ReincarnationParticulars"/> 
     <wsdl:output message="tns:PetitionResponse"/> 
     <wsdl:fault name="denied" message="tns:Rejection"/> 
    </wsdl:operation> 
</wsdl:portType> 
<wsdl:binding name="ReincarnationRequestPortTypeEndpointBinding" type="tns:ReincarnationRequestPortType"> 
    <soap1:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
    <wsdl:operation name="acceptRequest"> 
     <soap1:operation style="document" soapAction="petition" soapActionRequired="true"/> 
     <wsdl:input> 
      <soap1:body use="literal" parts="ReincarnationParticulars"/> 
     </wsdl:input> 
     <wsdl:output> 
      <soap1:body use="literal" parts="Approved"/> 
     </wsdl:output> 
     <wsdl:fault name="denied"> 
      <soap1:fault use="literal" name="denied"/> 
     </wsdl:fault> 
    </wsdl:operation> 
</wsdl:binding> 

回答

2

這是我發現......這樣回答我的問題。

soapAction屬性表示服務提供者的意圖,這很可能是由服務框架構成的。

soapAction幫助服務提供者將soap操作映射到意向解析器。對於任何意圖和目的而言,這將是被調用來爲該操作提供服務的例程。

soapAction屬性是服務提供者框架唯一標識要調用哪個入口點或例程來爲該操作提供服務的一種方式。

因此,soapAction屬性可以是任何值,其模式可以由框架決定。在我使用的框架中,對於框架而言,soapAction的值是什麼並不重要,其中soapAction屬性值僅僅是對處理調用的入口點的引用。

0

soap1:operation元件的​​屬性,將被包括在HTTP請求消息中,如在:

POST /StockQuote HTTP/1.1 
Content-Type: text/xml; charset="utf-8" 
Content-Length: nnnn 
SOAPAction: "petition" 

將SOAPAction HTTP請求報頭字段可以被用來指示SOAP的HTTP請求的意圖。該值是標識意圖的URI。 SOAP對URI的格式或特性沒有限制,或者它是可解析的。發佈SOAP HTTP請求時,HTTP客戶端必須使用這個頭域。

服務器(如防火牆)可以使用SOAPAction頭字段的存在和內容來適當地過濾HTTP中的SOAP請求消息。空字符串(「」)的頭字段值意味着SOAP消息的意圖由HTTP Request-URI提供。沒有價值意味着沒有跡象表明信息的意圖。

例子:

SOAPAction: "/Services/ReincarnationRequestPortTypeEndpoint/petition" 
SOAPAction: "petition" 
SOAPAction: "" 
SOAPAction: 
0

消費時使用的soapAction屬性爲特定目的而當我們更新了WSDL(主要SOAPAction域),它打破了消費者的代碼,我們正面臨着類似的情況。

基本上,因爲肥皂1.1,沒有使用soapAction除了它只是用於文檔,它可以是空的。

正如在另一個答案中提到的,它可以描述操作的意圖,但又是爲了文檔目的。

我們使用它的方式如下所示;

<soap:operation soapAction="http://company.com.au/hub/services/NotificationApplication/GenerateDocumentNotification?applicationVersion=NotificationApplication_v1.8.9"/> 

P.S.在soap1.2中soapAction被完全刪除,所以最好不要依賴這個!