SOAP header conventions - why does SoapUI create this header?
SoapUI is smarter than me, and in the raw request, creates a header in my soap message that results in a successful submission. I need to understand this.
I am using SoapUI to troubleshoot a webservice Java client. The webservice client was generated using wsimport.exe to process a published WSDL file for the remote service.
My Java client was unable to submit the SOAP message without error, getting error messages that an Action header was missing. In the trace output, I noticed that the Java client code did not generate any Header section in the SOAP message. However, it did put the SOAP Action in the "Content-Type" http header of the http request. This is what the Content-Type request header looks like:
Content-Type: application/soap+xml;charset="utf-8";action="http://www.fmcsa.dot.gov/schemas/FMCSA.ELD.Infrastructure/IELDSubmissionService/Submit"
I tried sending the same SOAP message using SoapUI. It failed at first. Then I copied the Content-Type http header from my Java trace output and manually created the Content-Type header in my SoapUI request. Magically, it worked -- the message was accepted by the web service. When I inspected the "raw" request in the SoapUI Raw tab, I noticed that SoapUI had actually created a header section in the SOAP message and put an Action element with the soap action as content. Apparently the web service needs that header (although I don't see anything in the WSDL that calls for the header). The raw soap message started as follows, with the new Header section:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://www.fmcsa.dot.gov/schemas/FMCSA.ELD.Infrastructure/IELDSubmissionService/Submit</wsa:Action>
</S:Header>
...
My question is: Why did SoapUI look at the http Content-Type header, and decide to create that Header section and the Action element? Is there some standard relating the two? Furthermore, it turned an unsuccessful request into a successful one. The answer to this may help me fix the Java client code to also be successful.