http://www.perlmonks.org?node_id=1016632


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 => 'https://url2archer.com/' } ); 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: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?

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