I have a wonderful task working with a massive SOAP api with Rails. The SOAP service has three different bindings; wsHttpBinding, wsHttpBinding with x509 and user binding. I can hit two endpoints only with wsHttpBinding, but the third requires a username and password that does not work with this. I avoid x509 because of the certificate, and user binding works fine in SoapUI, but with Savon I get the following error.
A message with an action "cannot be processed at the receiver due to a ContractFilter mismatch in the EndpointDispatcher. This may be due to a contract mismatch (action mismatch between the sender and the recipient) or a binding / security mismatch between the sender and the recipient. Make sure the sender and recipient have the same contract and the same binding (including security requirements, such as message, transport, no).
I took the exact XML that was generated using Savon and put into SoapUI, and it works.
Could this be a related issue? And is there a way to say to use this custom binding?
Here is the user binding I found in App.config
<bindings> <customBinding> <binding name="cust"> <textMessageEncoding messageVersion="Soap12" /> <httpTransport /> </binding> <binding name="cust1"> <textMessageEncoding messageVersion="Soap12" /> <httpTransport /> </binding> <binding name="cust2"> <textMessageEncoding messageVersion="Soap12" /> <httpTransport /> </binding> </customBinding> </bindings> <endpoint address="http://api.xyz.com/stuff.svc/cust" binding="customBinding" bindingConfiguration="cust" contract="stuff.Xstuff" name="cust" />
Edit # 1
Here is my current client setup that helps.
@client = Savon.client( wsdl: 'http://api.xyz.com/stuff.svc?wsdl', wsse_auth: %w'username password', wsse_timestamp: true, raise_errors: false, log: true, log_level: :debug, soap_version: 2, pretty_print_xml: true, convert_request_keys_to: :none, use_wsa_headers: true, headers: {'Content-Type' => 'application/soap+xml; charset=utf-8'}
Edit # 2
I found a problem. Savon did not set the action to Content-Type, such as SoapUI. Thanks to @RicardoPontual, offering to try again comparing the Savon request and SoapUI, it made me take a closer look at it and notice the problem.
headers: {'Content-Type' => 'application/soap+xml;charset=UTF-8;action="tempuri.org/stufโโf/set_table_stuff"'}