desperate: custom authentication header

2 views
Skip to first unread message

jon

unread,
Apr 28, 2008, 2:47:24 PM4/28/08
to soap4r
So I've been banging my head against the wall for 3 days trying to
figure out how to access a pre-defied web service for a project that
I'm working on. It doesn't use simple http auth, I need to embed my
credentials in the header using some methods defined in the WSDL and
I'm stuck.

I installed soap4r (I think it's installed right, can you check the
version or something at the command line?) but I don't know how to
make sure the new version that I installed is used. I've seen some
things that say you have to put a call in the boot.rb file? That seems
weird. Maybe you don't need that anymore? Info seems scattered and
old.

Anyway, I have generated the driver.rb, defaultDriver.rb,
defaultMappingRegistry.rb and the generic implementation file, mine is
called WsFindCustAcctsServiceClient.rb. I used wsdl2ruby from the live
WSDL but I don't know how to extend the code. I don't know where to
start...

What do I have access to in the WsFindCustAcctsServiceClient.rb file?
Can I access methods in the default.rb file? Does that help me? How do
I use some methods to inject my credentials in the header XML?

I haven't worked with web services before so be gentile... I'm not a
rails noob, but I also haven't gone much further than what is included
in the box.

Any help would be GREATLY appreciated! I'm very nervous about my lack
of progress with this.

Thanks much!
-Jon

Felipe Contreras

unread,
Apr 28, 2008, 3:45:21 PM4/28/08
to soa...@googlegroups.com
On Mon, Apr 28, 2008 at 9:47 PM, jon <JonK...@gmail.com> wrote:
>
> So I've been banging my head against the wall for 3 days trying to
> figure out how to access a pre-defied web service for a project that
> I'm working on. It doesn't use simple http auth, I need to embed my
> credentials in the header using some methods defined in the WSDL and
> I'm stuck.
>
> I installed soap4r (I think it's installed right, can you check the
> version or something at the command line?) but I don't know how to
> make sure the new version that I installed is used. I've seen some
> things that say you have to put a call in the boot.rb file? That seems
> weird. Maybe you don't need that anymore? Info seems scattered and
> old.

ruby -e "require 'soap/soap'; puts SOAP::VERSION"

> Anyway, I have generated the driver.rb, defaultDriver.rb,
> defaultMappingRegistry.rb and the generic implementation file, mine is
> called WsFindCustAcctsServiceClient.rb. I used wsdl2ruby from the live
> WSDL but I don't know how to extend the code. I don't know where to
> start...
>
> What do I have access to in the WsFindCustAcctsServiceClient.rb file?
> Can I access methods in the default.rb file? Does that help me? How do
> I use some methods to inject my credentials in the header XML?
>
> I haven't worked with web services before so be gentile... I'm not a
> rails noob, but I also haven't gone much further than what is included
> in the box.
>
> Any help would be GREATLY appreciated! I'm very nervous about my lack
> of progress with this.

You can try to check my own driver wrapper:

http://people.freedesktop.org/~felipec/msn/ruby/myDriver.rb

Best regards.
--
Felipe Contreras

Jonathan Kinney

unread,
Apr 28, 2008, 9:43:38 PM4/28/08
to soa...@googlegroups.com
Thank you for the reply.

I was able to figure it out. I needed to require some files correctly, and instantiate the methods that I needed to consume properly. I actually had a local resource help me get it going.

it looks like this: http://pastie.textmate.org/private/t825mkt3wdh3xmbcdxqnig

-Jon
Reply all
Reply to author
Forward
0 new messages