Thursday, September 17, 2015

a:ActionNotSupported: The message with Action '"' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.

a:ActionNotSupported: The message with Action '"' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.

Getting the below error while invoking the SOAP service via WebServiceTemplate.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode>
<faultstring xml:lang="en-US">The message with Action '"' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>

The root cause of the issue is the SOAPAction is not set in the request header while invoking the service.

To fix the issue set the SOAPAction specified in the WSDL binding while invoking the service.

  <binding name="binding" type="service">
    <binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="process">
      <operation soapAction="process" style="document"/>
      <input>
        <body namespace="request" use="literal"/>
      </input>
      <output>
        <body namespace="response" use="literal"/>
      </output>
    </operation>
  </binding>

webServiceTemplate.marshalSendAndReceive(url,request, new WebServiceMessageCallback() {

    public void doWithMessage(WebServiceMessage message) {
        ((SoapMessage)message).setSoapAction("process");
    }
});


No comments:

Post a Comment