Note that there are some explanatory texts on larger screens.

plurals
  1. POAPI Call With Savon SOAP Client Results In ContractFilter mismatch at the EndpointDispatcher Error
    primarykey
    data
    text
    <p>I've run into an issue where the Savon Ruby Gem generates a SOAP API call that fails, however when I copy and paste the <em>exact</em> same XML message into SOAP-UI it succeeds.</p> <p>I send this message:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tem="http://tempuri.org/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:vis="http://schemas.datacontract.org/2004/07/Vision.SecureOriginCommand.ServiceContracts"&gt; &lt;soapenv:Body&gt; &lt;tem:CameraConfiguration&gt; &lt;tem:request&gt; &lt;vis:ClientToken&gt;5555&lt;/vis:ClientToken&gt; &lt;vis:DeviceID&gt;26219&lt;/vis:DeviceID&gt; &lt;vis:Enabled&gt;1&lt;/vis:Enabled&gt; &lt;vis:Interval&gt;60&lt;/vis:Interval&gt; &lt;/tem:request&gt; &lt;/tem:CameraConfiguration&gt; &lt;/soapenv:Body&gt; </code></pre> <p></p> <p>To this API (A remote web camera configuration): <a href="https://oapqa.onasset.com/Services/SecureOriginCommand.svc?wsdl" rel="nofollow">https://oapqa.onasset.com/Services/SecureOriginCommand.svc?wsdl</a></p> <p>But it fails with this message:</p> <pre><code> SOAP response (status 500): &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;s:Fault&gt;&lt;faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;a:ActionNotSupported&lt;/faultcode&gt; &lt;faultstring xml:lang="en-US"&gt;The message with Action 'oapSetSentryReportingIntervalRequest' 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)&lt;/faultstring&gt; &lt;/s:Fault&gt; &lt;/s:Body&gt; </code></pre> <p></p> <p>My first thought was that I must have made a typo in the action name. But no, when I try the exact same message in SOAP-UI I get the following success:</p> <pre><code> &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;CameraConfigurationResponse xmlns="http://tempuri.org/"&gt; &lt;CameraConfigurationResult xmlns:a="http://schemas.datacontract.org/2004/07/Vision.SecureOriginCommand.ServiceContracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;a:Error/&gt; &lt;a:Result&gt;true&lt;/a:Result&gt; &lt;/CameraConfigurationResult&gt; &lt;/CameraConfigurationResponse&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <p>This leads me to believe that the issue is not being caused by the format of my xml message but with the way I'm configuring my client. Here is the actual code:</p> <pre><code>Savon.configure do |config| config.log = :debug config.env_namespace = :soapenv config.raise_errors = false end # TODO Enable ssl certficate verification client = Savon::Client.new do wsdl.document = TARGET_SO_WSDL http.auth.ssl.verify_mode = :none end resp = client.request 'tem', 'CameraConfiguration' do soap.namespaces['xmlns:vis'] = 'http://schemas.datacontract.org/2004/07/Vision.SecureOriginCommand.ServiceContracts' soap.namespaces['xmlns:tem'] = 'http://tempuri.org/' soap.body = { 'tem:request' =&gt; { 'vis:ClientToken' =&gt; ON_ASSET_API_KEY, 'vis:DeviceID' =&gt; webcam.gps_device.device_id, 'vis:Enabled' =&gt; 1, 'vis:Interval' =&gt; webcam.report_interval } } end </code></pre> <p>I've spoken to the developer who maintains the API I'm trying to access. I thought his response could provide a clue:</p> <pre><code>Binding on the RemoteSentryService was set to mexHttpBinding instead of mexHttpsBinding. I don’t think this should give you a fault exception, because its working on .NET simulator client I have. And this endpoint is only used to generate the wsdl (MetaExchange Binding). But, given you are using a different client, I would still give it a shot. I also regenerated the proxy from wsdl and updated my sample simulator and it looks good. </code></pre> <p>Is this issue a known issue with Savon and Microsoft SOAP endpoints or HTTPS? Or is this issue something only I'm encountering? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload