Skip to content
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

Is there a way to alter the output? #5

Closed
rurounijones opened this issue Dec 11, 2009 · 2 comments
Closed

Is there a way to alter the output? #5

rurounijones opened this issue Dec 11, 2009 · 2 comments

Comments

@rurounijones
Copy link

Sorry for the vague wording but I am a newbie to SOAP so not sure about the terminology. What I need is

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:lb="snipped">
   <soap:Header/>
   <soap:Body>
      <lb:Authenticate>
         <lb:UserName>x</lb:UserName>
         <lb:Password>x</lb:Password>
      </lb:Authenticate>
   </soap:Body>
</soap:Envelope>

but when I use savon I get

<env:Envelope xmlns:wsdl="snipped" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Header>
  </env:Header>
  <env:Body>
    <wsdl:Authenticate>
      <password>x</password>
      <userName>x</userName>
    </wsdl:Authenticate>
  </env:Body>
</env:Envelope>

So I need to get rid of the "Env" stuff and replace the "wsdl" with "lb". Is this possible, if so what do I have to do?

Cheers
RJ

@rubiii
Copy link
Contributor

rubiii commented Dec 11, 2009

seems like you need to adjust the soap version (changes the xmlns:env namespace) and add namespaces to your password and username tags. you don't need to replace "the env stuff". it's just a namespace. what's important is the uri it is pointing to. try this:

client = Savon::Client.new "your-wsdl"
client.authenticate do |soap|
  soap.version = 2
  soap.body = { "wsdl:UserName" => "x", "wsdl:Password" => "x" }
end

@rurounijones
Copy link
Author

Apologies for the delay in replying.

Thank you very much; that solved the issue

rubiii added a commit that referenced this issue Jun 3, 2013
Get input from message element or portType input.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants