Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Savon multiple namespace in body attributes #862

Closed
jainnimish7 opened this issue Mar 27, 2018 · 1 comment
Closed

Savon multiple namespace in body attributes #862

jainnimish7 opened this issue Mar 27, 2018 · 1 comment
Labels

Comments

@jainnimish7
Copy link

jainnimish7 commented Mar 27, 2018

I am using Savon.v2, I posted it on stackoverflow also.

and passing wsdl url to the Savon.Client, and getting proper response in header, but I am not getting how to pass multiple namespace to the body:

Here is the code that I am using for calling Savon methods.

Savon.client(wsdl: 'https://someUrl.com/abcd?wsdl', ssl_verify_mode: :none, pretty_print_xml: true, log: true, env_namespace: :soapenv) do

wsse_auth("api_demo_account", "somePassword", :digest)

end

client.call(:operation_name, message: { "api01Req" => [{"shipCode" => 'ABC', "shipAmount" => 1123, "countryCode" => "USA"}]}, 'attributes' => { "xmlns" => "http://someUrl.com" })

and it is generating code for body like this:

<soapenv:Body>
<impl:operationName xmlns="http://someUrl.com">
<impl:api01Req>
<impl:shipCode>ABC</impl:shipCode>
<impl:shipAmount>1123</impl:shipAmount>
<impl:countryCode>USA</impl:countryCode>
</impl:api01Req>
</impl:operationName>
</soapenv:Body>

But I need a request like this:

<soapenv:Body>
<operationName xmlns="http://someURL.com">
<api01Req>
<ns1:shipCode xmlns:ns1="http://someOtherUrl.com">ABC</ns1:shipCode>
<ns2:shipAmount xmlns:ns2="http://someOtherUrl.com">1123</ns2:shipAmount>
<ns3:countryCode xmlns:ns3="http://someOtherUrl.com">USA</ns3:countryCode>
</api01Req>
</operationName>
</soapenv:Body>

like here it is generating ns1, ns3, ns3 along with xmlns:ns1 different URL's, how should I modify the code to get like above request.

@stale
Copy link

stale bot commented May 26, 2018

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

No branches or pull requests

1 participant