dsb has asked for the wisdom of the Perl Monks concerning the following question:
Hello there.
dsb
This @ISA my( $cool ) %SIG
I'm running into a wall (or more likely, a proxy) while trying to connect to a wsdl service via web call. I suspect the company proxy is not handling the request properly but I'm not sure how to help it along.
I'd like to avoid using company specific info, so the below URLs will not work. But know that when I request the specified URL from a browser, I get back a proper XML response. From the script, I get a 400 bad request error.
Results:use strict; use LWP::UserAgent; my $g = LWP::UserAgent->new(show_progress => 1); $g->proxy(['http','ftp','https'], 'http://proxy.company.com:8080'); my $gr = HTTP::Request->new(POST => 'https://remote.othercomp.com/Sess +ionManagement/PublicSessionManagementService.svc?wsdl'); $gr->header('Content-Length' => '0'); my $gs = $g->request($gr); print $gs->status_line, "\n"; print $gs->content, "------- end content -------\n";
I've tried doing a normal GET request to Google.com and gotten back a good response and the appropriate content.** POST https://wsnet.sendwordnow.com/SessionManagement/2010/05/Public +SessionManagementService.svc?wsdl ==> 400 Bad Request (1s) 400 Bad Request ------- end content -------
any help is much appreciated.
dsb
This @ISA my( $cool ) %SIG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: LWP 400 Bad Request on POST
by BrowserUk (Patriarch) on Nov 12, 2013 at 20:48 UTC | |
by dsb (Chaplain) on Nov 13, 2013 at 14:18 UTC | |
by BrowserUk (Patriarch) on Nov 13, 2013 at 14:25 UTC | |
by dsb (Chaplain) on Nov 13, 2013 at 19:06 UTC | |
by BrowserUk (Patriarch) on Nov 13, 2013 at 20:00 UTC | |
by afoken (Chancellor) on Nov 14, 2013 at 18:05 UTC | |
Re: LWP 400 Bad Request on POST
by ig (Vicar) on Nov 13, 2013 at 06:36 UTC | |
by dsb (Chaplain) on Nov 14, 2013 at 15:52 UTC |
Back to
Seekers of Perl Wisdom