Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot call web service methods via SOAP Connection (SAVON) in Ruby on Rails. Where am i going wrong?
    primarykey
    data
    text
    <p>I seem to be getting this error message:</p> <blockquote> <p>(a:ActionNotSupported) The message with Action 'GetServices' 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).</p> </blockquote> <p>I assume it is something to do with the security/binding setup. My connection uses HTTP, with basichttpbinding. I've done a lot of searching for the answer, as I always do, but am unable to fix it, and no one here has expertise on Ruby on Rails.</p> <p>Help would be appreciated.</p> <p>Below is my code, in Ruby on Rails, which initialises the service and then calls it. Note: <strong>I can connect to it fine</strong>. It has successfully reported the available methods. Just calling the methods seems to be the problem. I have successfully connected to online test services using the same code. And I use Savon.</p> <pre><code> def test puts "web_service: IN" client = Savon::Client.new do wsdl.document = "http://hidden.co.uk/myService.svc?wsdl" end @response = client.request "GetServices", :xmlns =&gt; "http://tempuri.org/" do soap.header = {} soap.body = { "CostCentreNo" =&gt; 1, "filter" =&gt; 0 } end puts '##########################' puts @response.to_hash; end </code></pre> <p>Below is what my Ruby on Rails sends:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;env:Envelope xmlns:wsdl="http://tempuri.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;env:Body&gt; &lt;GetServices xmlns="http://tempuri.org/"&gt; &lt;CostCentreNo&gt;1&lt;/CostCentreNo&gt; &lt;filter&gt;0&lt;/filter&gt; &lt;/GetServices&gt; &lt;/env:Body&gt; &lt;/env:Envelope&gt; </code></pre> <p>This is what WCF test client sends, (which works)</p> <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Header&gt; &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;http://tempuri.org/IIBCSServices/GetServices&lt;/Action&gt; &lt;/s:Header&gt; &lt;s:Body&gt; &lt;GetServices xmlns="http://tempuri.org/"&gt; &lt;CostCentreNo&gt;0&lt;/CostCentreNo&gt; &lt;filter&gt;0&lt;/filter&gt; &lt;/GetServices&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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