次のエラー メッセージが表示されるようです。
(a:ActionNotSupported) EndpointDispatcher での ContractFilter の不一致により、アクション「GetServices」を含むメッセージを受信側で処理できません。これは、コントラクトの不一致 (送信者と受信者の間のアクションの不一致) または送信者と受信者の間のバインディング/セキュリティの不一致が原因である可能性があります。送信者と受信者が同じコントラクトと同じバインド (メッセージ、トランスポート、なしなどのセキュリティ要件を含む) を持っていることを確認します。
セキュリティ/バインディングの設定に関係していると思います。私の接続は、basichttpbinding で HTTP を使用しています。いつものように、答えを探すために多くの検索を行いましたが、修正できず、Ruby on Rails の専門知識を持っている人は誰もいません。
助けていただければ幸いです。
以下は、サービスを初期化してから呼び出す Ruby on Rails のコードです。注:正常に接続できます。利用可能なメソッドの報告に成功しました。メソッドを呼び出すだけで問題があるようです。同じコードを使用して、オンライン テスト サービスに正常に接続できました。そしてサボンを使っています。
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 => "http://tempuri.org/" do
soap.header = {}
soap.body = {
"CostCentreNo" => 1,
"filter" => 0
}
end
puts '##########################'
puts @response.to_hash;
end
以下は、Ruby on Rails が送信するものです。
<?xml version="1.0" encoding="UTF-8"?>
<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/">
<env:Body>
<GetServices xmlns="http://tempuri.org/">
<CostCentreNo>1</CostCentreNo>
<filter>0</filter>
</GetServices>
</env:Body>
</env:Envelope>
これは、WCF テスト クライアントが送信するものです (動作します)。
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IIBCSServices/GetServices</Action>
</s:Header>
<s:Body>
<GetServices xmlns="http://tempuri.org/">
<CostCentreNo>0</CostCentreNo>
<filter>0</filter>
</GetServices>
</s:Body>
</s:Envelope>