aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes soapAction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "soapAction" Watch "soapAction" New topic
Author

soapAction

Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
Whats the use of soapAction attribute in SOAP?


Share Knowledge to gain it.
SCJP 2, SCWCD 2, SCDJWS, IBM 141 (In Progress), IBM 486 (Next)
Tong Chen
Ranch Hand

Joined: Apr 26, 2002
Posts: 1011
In the SOAP binding mechanism in the WSDL spec:
The soapAction attribute specifies the value of the SOAPAction header for this operation. For the HTTP protocol binding of SOAP, this is value required (it has no default value). For other SOAP protocol bindings, it MUST NOT be specified, and the soap peration element MAY be omitted.


Tong Chen (Seattle USA)<br />SCJP,SCWCD,SCDJWS,IBM XML,MCP.NET,MCAD.NET,MCSD.NET
Lipman Li
Ranch Hand

Joined: May 02, 2002
Posts: 122
if binding to HTTP, there must be one HTTP head field called SOAPAction presented. but the value has two possibilities.
the value must be matched with the declared value in the WSDL, if it is declared in WSDL.
however, if there's no SOAPAction attribute declared or declared, but has empty value in WSDL, the value would be an empty value (indicated as "")
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

I apologize for digging out this old post, but thought of using this instead of creating a new one.

I understand that how soapAction is declared and how is it referred in HTTPHeaders. But what is the real purpose of this attribute, specially when it can have an empty string.


Regards
KumarRaja

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Well, you are not the only one wondering about the validity of soapAction.
Also consider the fact that it has a kind of dependency on the HTTP protocol being used - what happens with it if you use SOAP over JMS or SOAP over TCP?!??
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Ivan Krizsan wrote:Hi!
Well, you are not the only one wondering about the validity of soapAction.
Also consider the fact that it has a kind of dependency on the HTTP protocol being used - what happens with it if you use SOAP over JMS or SOAP over TCP?!??
Best wishes!


So does it mean that the usage of soapAction for Non-HTTP will not have any impact. But does it actually generate any errors at runtime/compile time
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Unraveling the Mystery of SOAPAction tries to answer the question.

It says -



However, there is another use of SOAP that can be made that demonstrates the value of SOAPAction. This use involves not putting the method name in the SOAP envelope, and instead using the method of the underlying application protocol (which is most commonly ignored by Web services). In the case of HTTP that means using the POST method.



But after all, SOAP over HTTP always uses the POST method. So, I guess the author says that the method name would be specified only in the HTTP header and not in the body of SOAP.

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi again!
One way of using the soapAction HTTP header field can be to duplicate some information from within the XML payload, for instance an operation name.
This would make it easier for communication intermediaries to examine SOAP messages without having to parse the XML payload.
It is relatively easy to set up a filter in a firewall that allows HTTP POST request with a soapAction header field value of "doIt" and discard all other requests.
It would be much more difficult to set up a filter that tries to determine something from the XML - elements in different packages can have different namespace prefixes but still be perfectly legal.
However, as soon as you decide on using soapAction, you have committed yourself to HTTP - where would you put the soapAction HTTP header in a JMS, SMTP or SOAP over TCP message? If you really know what you do, it is fine.
Best wishes!
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Ivan Krizsan wrote:
One way of using the soapAction HTTP header field can be to duplicate some information from within the XML payload, for instance an operation name.
This would make it easier for communication intermediaries to examine SOAP messages without having to parse the XML payload.
It is relatively easy to set up a filter in a firewall that allows HTTP POST request with a soapAction header field value of "doIt" and discard all other requests.


Not sure about this. Many complain that SOAP simply uses HTTP just as a transport protocol. So, now when it's convenient somehow, SOAP uses an HTTP feature in isolation. doesn't sound right.

Regards,
Dan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
One more thing that I find peculiar, is the fact that the soapAction specifies the full url, while the binding to the actual address is done only one step later at the service definition.



Regards,
Dan
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
From the SOAP 1.1 specification:
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.

Thus, soapAction contains an URI, but it can be any URI.
Best wishes!
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Thanks Dan and Ivan for explaining more clearly on SOAPAction.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: soapAction
 
Similar Threads
WSDL Doubts
soapAction and soap:address
Getting Bad Response from Web service
Web service client - XML to Object problem
Use of SoapAction Attribute ?