Hello there.
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.
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";
Results:
** POST https://wsnet.sendwordnow.com/SessionManagement/2010/05/Public
+SessionManagementService.svc?wsdl ==> 400 Bad Request (1s)
400 Bad Request
------- end content -------
I've tried doing a normal GET request to Google.com and gotten back a good response and the appropriate content.
any help is much appreciated.
dsb
This @ISA my( $cool ) %SIG
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.