savon: savon doesn't namespace soap header elements set by client.config.soap_header

The wsdl contains the correct namespace info for the headers from https://ws5.responsys.net/webservices/wsdl/ResponsysWS_Level1.wsdl

<message name="Header">
  <part element="tns:SessionHeader" name="SessionHeader"/>
</message>
<message name="AuthHeader">
  <part element="tns:AuthSessionHeader" name="AuthSessionHeader"/>
</message>

but when calling

client.config.soap_header = {:session_header => { :session_id => 12345 } }

it sets the output to

<env:Header>
  <sessionHeader>
    <sessionId>12345</sessionId>
  </sessionHeader>
</env:Header>

instead of

<env:Header>
  <tns:SessionHeader>
    <tns:sessionId>12345</tns:sessionId>
  </tns:SessionHeader>
</env:Header>

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Ran into this issue today, too. The body elements are being properly namespaced, but the header elements aren’t.

I’ve run into the same problem. What you can do is actually setting the “namespace” in the hash keys:

client.config.soap_header = {“tns:sessionHeader” => { “tns:sessionId” => 12345 } }

But this should be done by savon.