Savonを使用してRubyでSOAPリクエストを作成しようとしていますが、サーバーから400BadRequestレスポンスを受信しています。
これは私が行おうとしているリクエストです(soapUIによると):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:apis="http://www.csisoftwareusa.com/ApiService">
<soap:Header/>
<soap:Body>
<apis:AuthenticateConsumer>
<!--Optional:-->
<apis:consumerName>?</apis:consumerName>
<!--Optional:-->
<apis:consumerPassword>?</apis:consumerPassword>
</apis:AuthenticateConsumer>
</soap:Body>
</soap:Envelope>
これが私がRubyで行うリクエストです。400BadRequestエラーを返します。
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<ins0:AuthenticateConsumer>
<ins0:consumerName>?</ins0:consumerName>
<ins0:consumerPassword>?</ins0:consumerPassword>
</ins0:AuthenticateConsumer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Http Headers: SOAPAction: "http://www.csisoftwareusa.com/ApiService/AuthenticateConsumer", Content-Type: text/xml;charset=UTF-8, Content-Length: 504
これが私がPythonで作成できたリクエストです。このリクエストは成功します:
<SOAP-ENV:Envelope>
<SOAP-ENV:Header/>
<ns0:Body>
<ns1:AuthenticateConsumer>
<ns1:consumerName>?</ns1:consumerName>
<ns1:consumerPassword>?</ns1:consumerPassword>
</ns1:AuthenticateConsumer>
</ns0:Body>
</SOAP-ENV:Envelope>
Http headers: {'SOAPAction': u'"http://www.csisoftwareusa.com/ApiService/AuthenticateConsumer"', 'Content-Type': 'text/xml; charset=utf-8'}
このAPIへの呼び出しをRailsアプリケーションに統合する必要があるため、Pythonでそれを行うことは有効なソリューションではありません。
私が欠けているものを誰かが見ることができるかどうか疑問に思います。空の<SOAP-ENV:Header />
タグが問題ですか?もしそうなら、どうすればそれをSavonリクエストに追加できますか?
ありがとう、スチュアート