Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

soaplite · SOAP::Lite for Perl (soaplite.com)

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 1205
  • Category: Protocols
  • Founded: Jan 28, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Adding SOAP headers in a client   Topic List   < Prev Topic  |  Next Topic >
Summarize Messages Sort by Date  
#2029 From: "Todd Ekenstam" <tekenstam@...>
Date: Sat Nov 9, 2002 1:13 am
Subject: Adding SOAP headers in a client
tekenstam
Send Email Send Email
 
How do you add a SOAP header in the client?  In the server I do
something like:

sub fake_login {
$authInfo = +{ 'username' => 'john_doe',
'timestamp' => 1036799949,
'signature' => '2c4db5d1650b8c98'};
return 1, SOAP::Header->name(authInfo => $authInfo);
}

That works. But I don't see examples of how to do this on the client
side.

I'm trying to implement the ticket-based security as described in the
Quick Start Guide, but the example doesn't seem to work for me.
Perhaps it's relevant to an older SOAP::Lite version? I don't want
to pass the authInfo as a parameter in the method; I want to add it
to the header. Has anyone gotten this to work, with the authInfo
being passed in the header?

http://www.perl.com/pub/a/2001/04/24/soap.html#security%20(ssl,%
20basic/digest%20authentication,%20cookiebased%20authentication,%
20ticketbased%20authentication,%20access%20control)


Thanks,

Todd




#2038 From: "Todd Ekenstam" <tekenstam@...>
Date: Tue Nov 12, 2002 1:57 am
Subject: Re: Adding SOAP headers in a client
tekenstam
Send Email Send Email
 
--- In soaplite@y..., "Todd Ekenstam" <tekenstam@y...> wrote:
> How do you add a SOAP header in the client? In the server I do
> something like:
>
> sub fake_login {
> $authInfo = +{ 'username' => 'john_doe',
> 'timestamp' => 1036799949,
> 'signature' => '2c4db5d1650b8c98'};
> return 1, SOAP::Header->name(authInfo => $authInfo);
> }
>
> That works. But I don't see examples of how to do this on the
client
> side.

Sorry, the Quick Start DOES work for the client side.

# convert it into the Header
$authInfo = SOAP::Header->name(authInfo => $authInfo);
# invoke protected method
$response = SOAP::Lite
-> uri('http://www.soaplite.com/TicketAuth')
-> proxy('http://myserver/cgi-bin/ticketauth.cgi')
-> protected($authInfo, 'garbage');

An argument of SOAP::Header->name provided as a parameter to the
method is converted to a header much the same as a SOAP::Header->name
is converted when provided as a return parameter.

But now I can't seem to get the header back out on the server side.
the Quick Start example says to do something like this:

my $email = $checkAuthInfo->(pop->valueof('//authInfo'));

However, I get a fault "Can't locate object method "valueof" via
package "garbage" (perhaps you forgot to load "garbage"?"

The pop is getting the last parameter, not the header.


Any help would be appreciated.


Thanks,

Todd




#2039 From: Duncan Cameron <dcameron@...>
Date: Tue Nov 12, 2002 3:43 am
Subject: Re: Re: Adding SOAP headers in a client
dcameron@...
Send Email Send Email
 
On 2002-11-12 Todd Ekenstam wrote:
>--- In soaplite@y..., "Todd Ekenstam" <tekenstam@y...> wrote:

..

>But now I can't seem to get the header back out on the server side.
>the Quick Start example says to do something like this:
>
> my $email = $checkAuthInfo->(pop->valueof('//authInfo'));
>
>However, I get a fault "Can't locate object method "valueof" via
>package "garbage" (perhaps you forgot to load "garbage"?"
>
>The pop is getting the last parameter, not the header.
Do you have a line like this?

@TicketAuth::ISA = qw(SOAP::Server::Parameters);

Regards,
Duncan Cameron








 
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help