tags:

views:

99

answers:

2

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?

A: 

Soap4R is quite picky about overriding headers. In your situation, you'll need to add two "flat" handlers (one for Username, and another for Password) instead of a single one with both.

Sérgio Gomes
A: 

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

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

Jonas Elfström