Subject: | |
Date: | Thu, 14 Jan 2010 16:33:49 -0500 |
To: | bug-Net-Async-HTTP [...] rt.cpan.org |
From: | "Yang, Tao" <tao.yang [...] bankofamerica.com> |
Net-Async-HTTP-0.05
Perl: This is perl, v5.8.8 built for x86_64-linux-thread-multi
Machine: Linux sv6nastst01.ten-net.net 2.6.18-128.1.14.el5 #1 SMP Mon
Jun 1 15:52:58 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
1)Here is my testing script: async_test.pl, which is made from your
example:
#!/usr/bin/perl
use URI;
use IO::Async::Loop;
use Net::Async::HTTP;
my $xml_request= qq[<?xml version="1.0" ?>
<Request request_id="100002" action="inq_io" requestor="cpaas"
password="fakepwd">
<tier_name>silver</tier_name>
</Request>\n];
my $loop = IO::Async::Loop->new();
my $http = Net::Async::HTTP->new();
$loop->add( $http );
$http->do_request(
uri => URI->new( "http://171.133.181.177/cgi-bin/sbb.pl" ),
method=>'POST',
content =>$xml_request ,
user => 'cpaas',
pass => 'fakepwd',
on_response => sub {
my ( $response ) = @_;
print "Server response is:\n";
print $response->content;
$loop->loop_stop;
},
on_error => sub {
my ( $message ) = @_;
print "Cannot fetch http://171.133.181.177/ - $message\n";
$loop->loop_stop;
},
);
$loop->loop_forever;
2)the cgi script: sbb.pl
#!/usr/bin/perl -w
use strict;
$|++;
use lib '/opt/sbb/libs';
use CGI;
use SBB;
my $q = new CGI;
print $q->header( "text/plain" );
my $xml_request = $q->param( 'POSTDATA' );
print CGI::header();
print "No XML data" if(!$xml_request);
my $resp = (SBB::process_request($xml_request));
print $resp;
3)when I try to run my testing script through WEB, I always get "No XML
data" error.
I follow your instruction to fill uri, method, content field. I think if
the XML data did not pass to cgi script, this should be a bug.
Thanks
Message body is not shown because it is too large.