rubysoap4r

Passing a blank XSD::QName using soap4r


I have overridden the SimpleHandler to pass a username and password using soap4r. the problem is that I am forced to give a QName, and this is causing the result to fail because it's not in the right format.

What soap4r is adding is something like this (the "ns1" things are dummy values):

<env:Header>
  <n1:ns1 env:mustUnderstand="0"
    xmlns:n1="ns1">
    <n1:Username>someuser</n1:Username>
    <n1:Password>topsecret</n1:Password>
   </n1:ns1>
 </env:Header>

What it needs to be is this:

<env:Header>
  <n1:Username>someuser</n1:Username>
  <n1:Password>topsecret</n1:Password>
</env:Header>

How can I NOT pass in a containing name?


Solution

  • Looks like you need to make some changes to soap4r: http://dev.ctor.org/soap4r/browser/branches/1_5/lib/soap/header/handler.rb

    If the service isn't all that complicated you could try Handsoap https://github.com/unwire/handsoap/wiki/authentication#WS-Security