I'm using savon version 2 (with Ruby on Rails )to invoke a webservice and i need to inject some additional namespaces to my Envelope. Something like:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/addressing"
xmlns:newNamespace1="http://someURL.pt/Test1"
xmlns:newNamespace2="http://someURL.pt/Test2"
xmlns:newNamespace3="http://someURL.pt/Test3"
My current code is:
client = Savon.client do
wsdl "https://someValidURL?wsdl"
namespace "http://someURL.pt/Test1"
namespace "http://someURL.pt/Test2"
namespace "http://someURL.pt/Test3"
end
response = client.call( ...the webservice call... )
...but in my request the Savon only puts the last namespace
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsns="http://someURL.pt/Test3"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
I didn't find any documentation about this on Savon Git project.
Does anyone have a workaround for this problem??
PS- I also check that one possible solution is to set all the xml request (the envelope) to request but ... well... is too much like a hack.
If this is not possible and there's other good gem to do this, please tell me =)