1

この WSDL を使用してプロジェクトに取り組んでいます: http://developer.ebay.com/webservices/latest/ebaysvc.wsdl

$client = Savon.client(

:wsdl => "http://developer.ebay.com/webservices/latest/ebaysvc.wsdl",
:endpoint => "https://api.sandbox.ebay.com/wsapi?callname=AddItem&siteid=0&version=733& Routing=new",
:headers => { "Content-Type" => "application/soap+xml", "SOAPAction" => "AddItemRequest"},
:namespace => "urn:ebay:apis:eBLBaseComponents",
:soap_header => { CREDENTIALS GO HERE: SEE BELOW }
)

私が必要としているのは、複合型の xml 形式です。soap_header の最初の部分は RequestCredentials で、いくつかの子ノードがあり、そのうちの 1 つ (Credentials) には 3 つの子ノードがあります...また、キャメル ケースの下位をエスケープし、キャメル ケースのみを使用する必要があります。

xml 出力の最終結果は次のようになります。

<urn:RequestCredentials>
  <urn:eBayAuthToken>
  AUTH TOKEN HERE
  </urn:eBayAuthToken>
  <urn:Credentials>
    <urn:DevId>DEVID HERE</urn:DevId>
    ect..... (two more child nodes (AppId, and AuthCert)
  </urn:Credentials>
</urn:RequestCredentials>

私が受け取ったエラーは次のとおりです。 14007 エラー セキュリティ ヘッダーがないか無効なため、SOAP 認証に失敗しました。

savon gemでxmlを正しくフォーマットする方法について何かアイデアはありますか?

4

0 に答える 0