Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > SOAP::Lite with Microsoft Project Server PDS.WSDL

Reply
Thread Tools

SOAP::Lite with Microsoft Project Server PDS.WSDL

 
 
ashgromnies
Guest
Posts: n/a
 
      04-24-2006
I'm having some particular trouble with this, which mainly seems to
stem from not being able to supply the proper cookie to the request.

Here's the code I've worked out:

my $sns = 'http://tempuri.org/action';
my $method =
SOAP:ata->name('CMain.SoapXMLRequest')->attr({xmlns=>'http://tempuri.org/message'});

my $cookie_jar = HTTP::Cookies->new(
file => "/var/home/chris/lwp_cookies.dat",
autosave => 1,
ignore_discard => 1
);

$cookie_jar->load('/var/home/chris/lwp_cookies.dat');

sub SOAP::Transport::HTTP::Client::get_basic_credentia ls {
return 'DOMAIN\user' => 'password'; #note: censored for obvious
reasons
}



use LWP;
my $browser = new LWP::UserAgent(keep_alive=>1);
$browser->agent('Mozilla/4.0 (compatible; MSIE 5.5; Windows NT
5.0)');
$browser->cookie_jar($cookie_jar);
my $req = HTTP::Request->new(GET =>
"http://ADDRESS/ProjectServer/LGNBSC.ASP");
$cookie_jar->add_cookie_header($req);
$browser->credentials('ADDRESS:80', '', "DOMAIN\\user",
'password'); # censored, duh

my $res = $browser->request($req);
$res = $browser->request($req);



my $soap = SOAP::Lite
-> uri($sns)
-> on_action( sub{ join '/', $sns, $_[1] })
-> proxy('http://ADDRESS/ProjectServer/PDS.WSDL',keep_alive
=> 1,cookie_jar => $cookie_jar);


my $cookie = $cookie_jar->extract_cookies($res);

my $content = $cookie->{_content};
my @items = split('\r',$content);
$content = $items[2];
$content = substr($content,5,36);

my @params = ($content, SOAP:ata->name('Request' =>
\SOAP:ata->value(SOAP:ata->name('PDSInfo'))));
my $result = $soap->call($method => @params);

print "\n";

if ($result->fault){
print $result->faultstring;
}else{
print $result->result;
}

print "\n\n";

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSE 4 11-15-2006 02:40 AM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola Microsoft Certification 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSD 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd realexxams@yahoo.com Microsoft Certification 0 05-10-2006 02:35 PM
microsoft.public.dotnet.faqs,microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vb Charles A. Lackman ASP .Net 1 12-08-2004 07:08 PM



Advertisments