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

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"/>
			...
        </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")
	);

	...
}

Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s