Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: SOAP::Lite login setup

by Khen1950fx (Canon)
on Feb 02, 2013 at 02:09 UTC ( #1016632=note: print w/replies, xml ) Need Help??

in reply to SOAP::Lite login setup

FWIW: Here's my stab at it:
#!/usr/bin/perl use strict; use warnings; use HTTP::Cookies; use SOAP::Lite ( +trace => 'all', maptype => {} ); use Data::Dumper::Concise; $Data::Dumper::Indent = 1; my $soap = SOAP::Lite->proxy( 'https://url2archer?wsdl', cookie_jar => HTTP::Cookies->new( ignore_discard => 1 ) ); my $session = SOAP::Data->name('CreateUserSession') ->attr( { xmlns => '' } ); my @params = ( SOAP::Data->name('userName')->value('username'), SOAP::Data->name('pin')->value(10000), SOAP::Data->name('password')->value('password'), ); my %keyHash = %{ $soap->call( $session => @params )->body->{'CreateUserSession'} } +; foreach my $k ( keys %keyHash ) { print "$k = $keyHash{$k}"; } =begin DIGGING TOKEN INFO my $token = $soap->sessionToken(); if ($token->fault) { die $token->faultstring; } print $token =cut
The only problem that I encountered was that I couldn't connect to your site without the proper credentials, obviously.

Replies are listed 'Best First'.
Re^2: SOAP::Lite login setup
by diamondsandperls (Beadle) on Feb 02, 2013 at 17:04 UTC

    also noticed the below error happens first.

    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error

      There is nothing anyone can do to help you with unknowable server, unknowable wsdl, and unknowable error -- 500 means generic somethings wrong, useless for making suggestions

      I gave you my SOAP debugging tips, try to apply them, then you'll have some idea where you're going wrong with the SOAP request you're sending

      Maybe this short SOAP::Lite tutorial can help you How to Call a .NET-based Web Service Using the SOAP::Lite Perl Library

      SOAP::Lite WSDL support is easily broken, SOAP is very painful (I hate it), but it appears you're forced to deal with SOAP, so I urge you to switch to XML::Compile

Re^2: SOAP::Lite login setup
by diamondsandperls (Beadle) on Feb 02, 2013 at 17:00 UTC

    Thanks for the response getting the following error. Can't use an undefined value as a HASH reference at line 33. oh this is on an intranet so there is no way to hit the url for ya thanks for the help though. Any idea on what the error could be?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016632]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2019-10-20 23:42 GMT
Find Nodes?
    Voting Booth?