適切なSOAPヘッダーを作成しようとしています。
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:sen="https://webservices.averittexpress.com/SendWebImageService">
<soapenv:Header
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ns:authnHeader
soapenv:mustUnderstand="0"
xmlns:ns="http://webservices.averittexpress.com/authn">
<Username>xxxxxxxx</Username> <Password>xxxxxxxx</Password>
</ns:authnHeader> </soapenv:Header>
これは私のSavonクライアント呼び出しです。バージョン2を使用しています。
client = Savon.client(
wsdl: api_url,
raise_errors: false,
convert_request_keys_to: :camelcase,
element_form_default: :qualified,
env_namespace: :soapenv,
soap_header: {'username' => username, 'password' => password }
)
次のSOAPエラーが発生します。
fault=>
{:faultcode=>"soapenv:Server",
:faultstring=>"java.lang.NullPointerException",
:detail=>nil}}
どうすればsapoenv:mustUserstand="0"
ラインを取得できますか?それは何ですか?
さらに、の設定方法がわかりませんxmlns:ns="http://webservices.averittexpress.com/authn">
。
私はSOAPリクエストの使用経験がほとんどなく、Ruby /RailsRESTfulバックグラウンドから来ています。どんな助けでもいただければ幸いです。