SOAP Without Netscape Cookie File
If the SOAP example I gave doesn't authenticate properly, try providing your own cookie instead of reading from an existing cookie file.
use Digest::MD5 'md5_hex';
my $cookie = HTTP::Cookies->new;
$cookie->set_cookie(0, user => bakeUserCookie($uid, $pass), '/', $host);
sub bakeUserCookie {
my($uid, $passwd) = @_;
my $cookie = $uid . '::' . md5_hex($passwd);
$cookie =~ s/(.)/sprintf("%%%02x", ord($1))/ge;
$cookie =~ s/%/%25/g;
return $cookie;
}
Leave a comment