-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
savon doesn't namespace soap header elements set by client.config.soap_header #305
Comments
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. |
👍 |
not too sure about how savon should handle this. |
I have almost the same problem. I have this code: client = Savon.client("http://www.bimobile.com.br/Broker/Integrator.svc?wsdl")
response = client.request(:send_one_message) do
soap.body = { :companyId => 1, :userName => "Foo", :password => "bar", :phoneNumber => "123", :mobileOperator => 1, :messageText => "test" }
end Which generate this xml <?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:SendOneMessage>
<companyId>1</companyId>
<userName>Foo</userName>
<password>Bar</password>
<phoneNumber>123</phoneNumber>
<mobileOperator>1</mobileOperator>
<messageText>test</messageText>
</tns:SendOneMessage>
</env:Body>
</env:Envelope> Notice that the parameters companyId, etc aren't prefixed by |
Sorry, just find out the |
@plentz For companyId to be namespaced you need the following for your client config: Savon.client do
wsdl.endpoint = "http://www.bimobile.com.br/Broker/Integrator.svc?wsdl"
wsdl.element_form_default = :qualified
end Check out the section on Qualified Locals at http://savonrb.com/ for more info. The reason you're having this problem is because that wsdl at bimobile is using schema import and elementFormDefault="qualified" is within those imported files instead of in the toplevel wsdl. Unfortunately savon doesn't follow and parse the imports (yet). |
this needs to be addressed. i've created #340 to collect related issues. |
closing this one as there is a "roadmap" ticket for this problem. thanks for reporting. |
Which roadmap ticket? #340? I'm not sure that one covers the issue with namespacing header elements |
i'm aiming to fix this in 3.x, because then we should know the proper namespaces for all elements. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is now closed due to inactivity. If you believe this needs further action, please re-open to discuss. |
This is still a problem, and I had to use the manual namespace myself for a SOAP server to correctly authenticate my session. Could this please be reopened? |
Ran into this issue today, too. The body elements are being properly namespaced, but the header elements aren't. |
The wsdl contains the correct namespace info for the headers from https://ws5.responsys.net/webservices/wsdl/ResponsysWS_Level1.wsdl
but when calling
it sets the output to
instead of
The text was updated successfully, but these errors were encountered: