Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAP Action mismatch error while testing a WCF service with SoapUI

Tags:

wcf

soapui

Am testing a WCF service with a sample input in SOAPUI. when i hit the run,I get an SOAP Exception like below:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
   <s:Header>
     <a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/fault</a:Action>
   </s:Header>
<s:Body>
 <s:Fault>
     <s:Code>
        <s:Value>s:Sender</s:Value>
        <s:Subcode>
           <s:Value>a:ActionMismatch</s:Value>
        </s:Subcode>
     </s:Code>
     <s:Reason>
        <s:Text xml:lang="en-US">The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://XXX.XX.XXXX/IXXXXXX/AddOrderInfromation'.</s:Text>
     </s:Reason>
     <s:Detail>
        <a:ProblemHeaderQName>a:Action</a:ProblemHeaderQName>
     </s:Detail>
  </s:Fault>
 </s:Body>
</s:Envelope>

In blogs, they are asking to add Soap Action . How to Add Soap Action in my request below:

 <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wkus="http://XXX.XX.XXXX/IXXXXXX">
  <soap:Header />
  <soap:Body>
  <ns1:AddOrderInfromation>
     <!--Optional:-->
     <ns1:inputsting>
<ns1:AddOrderInfromation>
  <ns1:OrderNo>4500146</ns1:OrderNo>
  <ns1:OrderDate>08/22/2014</ns1:OrderDate>
  <ns1:TotalItems>1</ns1:TotalItems>         
</ns1:AddOrderInfromation>
 </ns1:inputsting>
 </ns1:AddOrderInfromation>

Please Suggest. Thanks in Advance

like image 633
Senthil Arasu Avatar asked Aug 26 '14 13:08

Senthil Arasu


People also ask

Is SOAPAction header required?

The SOAPAction HTTP header is required by SOAP 1.1 and therefore by the WSA. It can be blank or have a value, but the HTTP header has to be there. Also, take a look at the service's WSDL, and if it includes "soapAction" then the client must meet the API's specification.

What is SOAP action?

SOAPAction. The SOAPAction header is a transport protocol header (either HTTP or JMS). It is transmitted with SOAP messages, and provides information about the intention of the web service request, to the service. The WSDL interface for a web service defines the SOAPAction header value used for each operation.


2 Answers

This is probably a WS-A addressing issue.

In the WS-A tab of your Request, check "Enable WS-A addressing". You may also have to check "Add default was:To".

like image 155
Ramsey Avatar answered Sep 20 '22 22:09

Ramsey


Your web service is returning a SOAPFault which is saying that web service expects a SOAP Action http header. In order to add a SOAP action in your SOAP request from SOAPUI you must add a http header named SOAPAction, to do so do the next step:

  • In the bottom of your SOAP test request there are some tabs (Header(0), Attachments(0)...), open the Header(0) tab.Then using + add button, add a header with SOAPAction name and your value:

enter image description here

hope this helps,

like image 37
albciff Avatar answered Sep 17 '22 22:09

albciff