Afternoon,
I'm trying to write a SOAP service to decode a cookie and pass the details in SOAP to a Java client (Perl being better at data munging in this instance). Whilst testing this, I have not been able to print out the results (I've written the client in Perl to test) so that I know this part is working.
#!c:\perl\bin\perl.exe
use strict;
use warnings;
use SOAP::Transport::HTTP;
use CGI;
use Carp;
SOAP::Transport::HTTP::CGI
->dispatch_to('emailfind')
->handle;
my $cgi = new CGI;
package emailfind;
sub findingit {
my $cgi = shift;
#croak "Error: cgi object not passed" if(!$cgi);
my $cookie = $cgi->cookie('WALOGIN');
return if (!$cookie || $cookie eq 'RESET'); #exit function if co
+okie empty or is RESET
my ($e) = split(/-/, $cookie);
my $email= pack("H*",$e); # decode email address
return $email;
}
I am not quite sure where I've gone wrong on this and would be grateful for some help before moving on any further. Ultimately I'm trying to pass on a username
#!c:\perl\bin\perl.exe
use warnings;
use SOAP::Lite;
my $soap = SOAP::Lite
->uri('http://localhost/emailfind')
->proxy('http://localhost/cgi-bin/soapdish.pl');
unless ($soap->fault) {
print $soap->findingit();
} else {
print join ', ',
$soap->faultcode,
$soap->faultstring,
$soap->faultdetail;
}
Many thanks for any pointers.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.