Embracing the Messiness in Search of Epic Solutions

The message with Action ” cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher

Posted

in

PROBLEM

You get this error message when invoking a web service:-

org.springframework.ws.soap.client.SoapFaultClientException: 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).

SOLUTION

You forgot to specify the SOAP action before invoking the web service.

Open your WSDL file and search for the operation you are trying to invoke. You should see something like this:-

<!--?xml version="1.0" encoding="UTF-8"?-->
<wsdl:definitions ...="">
	...
    <wsdl:binding ...="">
		...
        <wsdl:operation name="OhMyGawd">
            <soap:operation soapaction="http://oh.my.gawd">
			...
        </soap:operation></wsdl:operation>
    </wsdl:binding>
	...
</wsdl:definitions>

Take note of the soapAction value, in this example, it is http://oh.my.gawd.

If you are using Spring Web Services, add the following lines:-

@Autowired
private WebServiceTemplate webServiceTemplate;

public void run() {
	ObjectFactory objectFactory = new ObjectFactory();

	// Create the request payload
	OhMyGawd ohMyGawd = objectFactory.createOhMyGawd();
	ohMyGawd.setValue(...);

    OhMyGawdResponse response = (OhMyGawdResponse) webServiceTemplate.marshalSendAndReceive(
            ohMyGawd,
			new SoapActionCallback("http://oh.my.gawd")
	);

	...
}

Comments

6 responses to “The message with Action ” cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher”

  1. kiran Avatar
    kiran

    thanks for the solution…
    finally I got rid my errors

  2. Mitchell M. Avatar
    Mitchell M.

    +1 , Thanks!!!!!

  3. ahmet zincir Avatar
    ahmet zincir

    thank you it got my two days.

  4. ernesto Avatar
    ernesto

    Muchas gracias por el post. Soluciona muy bien el error.

  5. learner Avatar
    learner

    in my case my action error was due to simple extra space after soapaction 🙂 I removed extra space and its pass through.

Leave a Reply to ahmet zincirCancel reply