Savon: how to change the title from <env: Header> to <soap: Header> or something else

Savon has a way to change

<env:Header>

to be

<soap:Header>

or something different?

I tried to add an additional header tag in the request block, for example:

soap.header['soap:Header']

But that will not work.

I looked at Savon Docs and did not find anywhere to modify this tag, only manually creating XML.

+5
source share
2 answers

EDITED for Savon 1.0.0

The value can be set in the configuration block, where you can also set the registration and other parameters. Simply put

Savon.configure do |c|
  c.env_namespace = :soap
end

into your code.

+12
source

For newer versions of Savon:

Savon.client(env_namespace: :soapenv) 
+3
source

All Articles