Blessed Geek
Blessed Geek

Reputation: 21684

WSDL binding - soapAction value

In the following excerpt of a WSDL, at the line

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

what is the difference between specifying

vs


<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>

Upvotes: 7

Views: 38744

Answers (3)

emarshah
emarshah

Reputation: 326

We were faced with similar situation when consumer was using soapAction property for a particular purpose and when we updated the WSDL(mainly the soapAction field), it broke the consumer code.

Basically since soap 1.1, there is no use of soapAction except its just used for documentation and it can be empty.

As mentioned in another answer, it can describe the intent of the operation but again for documentation purpose.

The way we have used it is like below;

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

P.S. soapAction is completely removed in soap 1.2, so better don't depend on this one a lot!

Upvotes: 3

sobczak.dev
sobczak.dev

Reputation: 1308

The soapAction="petition" attribute of the soap1:operation element, will be included in the HTTP request message, as in:

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

The SOAPAction HTTP request header field can be used to indicate the intent of the SOAP HTTP request. The value is a URI identifying the intent. SOAP places no restrictions on the format or specificity of the URI or that it is resolvable. An HTTP client MUST use this header field when issuing a SOAP HTTP Request.

The presence and content of the SOAPAction header field can be used by servers such as firewalls to appropriately filter SOAP request messages in HTTP. The header field value of empty string ("") means that the intent of the SOAP message is provided by the HTTP Request-URI. No value means that there is no indication of the intent of the message.

Examples:

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

Upvotes: 3

Blessed Geek
Blessed Geek

Reputation: 21684

This is what I have discovered ... so answering my own question.

The soapAction attribute is an indication of intent of the service provider, which is most probably framed by the service framework.

The soapAction helps the service provider to map the soap operation to an intent resolver. Which for any intent and purpose, would be the routine being called to service the operation.

The soapAction attribute is a way for a service provider framework to uniquely identify which entry point or routine to call to service the operation.

Therefore soapAction attribute can be any value, whose pattern may be dictated by the framework. In the framework that I am using, it does not matter to the framework what the value of soapAction is, where soapAction attribute value is simply the reference to the entry point to process the call.

Upvotes: 5

Related Questions