Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Soap::Lite Authentication

by Thelonius (Priest)
on May 17, 2006 at 01:30 UTC ( #549931=note: print w/replies, xml ) Need Help??


in reply to Soap::Lite Authentication

The most important thing here is that you're not checking $@. Using eval and then throwing away $@ means you've lost the most important clue as to what's going on!

It looks like the service is not using basic authentication, but Soap Header authentication.

I think the code is going to look something like this:

use SOAP::Lite; use strict; my $service = SOAP::Lite -> service('http://server/GetData.asmx?WSDL'); my $AuthHeader = SOAP::Header->new( name =>'AuthenticationHeader', attr => { xmlns => "http://www.server.com/" }, value => {username => 'user', password => 'pass' }, ); my $result = $service->GetIt($AuthHeader);
Without seeing the WSDL, I can't be sure--not that I'm a SOAP expert.

Replies are listed 'Best First'.
Re^2: Soap::Lite Authentication
by Anonymous Monk on Jul 01, 2012 at 04:40 UTC
    Hi, If i want to pass both Header and body to an webservice how do i do that.

      Odd question since that is what all the SOAP:: modules are there to do, pass both header and body ... a proper SOAP request, so you don't have to reinvent any wheels. Use SOAP::Simple or its daddy XML::Compile

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://549931]
help
Chatterbox?
[atcroft]: james28909: What about October 5, 1582?
[stevieb]: atcroft: "Make both hands into fists..."... is something my Ma taught me in our native lang, but I was to ignorant and young to pay attention. Thanks for that :)
[atcroft]: stevieb: Sad to say that I only recently learned that particular trick, but I have since found it very useful.... :)
[james28909]: ill be back with a solution eventually
[stevieb]: it's a reminder to re-inforce it :P
[atcroft]: james28909: That particular questions was a bit of trick, actually (depending on the country you are in). More interesting is, if you are trying to subtract from an epoch time, for instance, you might have to consider when/if DST occurs for a location,
[atcroft]: because you may have to adjust the number of seconds you change from an epoch from 86400 (not to mention leap seconds)....

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2017-04-29 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.