• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

soapAction

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whats the use of soapAction attribute in SOAP?
 
Ranch Hand
Posts: 1011
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 "")
 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Kumar Raja
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dan and Ivan for explaining more clearly on SOAPAction.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic