使用此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并且有几个子节点,其中一个(Credentials)有3个子节点......我还需要逃避较低的camel情况,只使用驼峰情况。
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的任何想法?