1

I am working against a WSDL service that only seems to return if there is an xmlns attribute set in one of the authentication tags sent in the headers. I am using Savon 2.2.0 and the following will work if I send it via a test tool:

 <AuthenticationHeader xmlns="XXX">
  <SessionID>XXX</SessionID>
</AuthenticationHeader>

But I have found no way of adding in the attribute to the tag (as it is in the header). There's been a few older questions on SO for this, but none seemingly for v2 of Savon.

Savon currently outputs this:

 <AuthenticationHeader>
  <SessionID>XXX</SessionID>
</AuthenticationHeader>

Which unfortunately fails to authenticate.

ANY suggestions greatly appreciated.

4

1 回答 1

-1

尝试soap_header在您的客户端定义中设置属性,如下所示:

client = Savon.client(
  wsdl: "http://....",
  soap_header: {"AuthenticationHeader xmlns=\"XXX\"" => {"SessionID"=> "XXX"}})

希望它对你有用。

于 2013-08-15T08:21:05.473 回答