V
vamsi.aluru
Hi,
I am posting an XML document to an asp applicaiton. This XML
document, i am sending in a loop. That is, if the XML document is big,
I am sending the first 50 records first time, then next 50 records and
so on.
The problem is, I am able to send first 50, but next 50 is
causing problem and the asp application is receiving the truncated XML.
When I send 20 after 20, first two times the xml goes fine, but the
third time the XML is truncating.
Any idea what is the problem? I am using post, so the size
should not be a problem. And more over the XML size is not more than
50k each time.
I am using the below code. I am psing only part of the code
where I am posting. if i post the full code, it will be very big.
for($x=0;$x<=$count-1;$x++){
# getting the XML content.
$XML_OUT=$xmlcnt[$x];
print 'xml==========='.$XML_OUT;
$ua = LWP::UserAgent->new;
$ua->timeout(36000);
$ua->max_size(1000000000);
# post the XML to the below url.
$req = HTTP::Request->new(POST =>
'http://viz-ams-001/facility/mapping.aspx');
# set the conetnt type of the post.
$req->content_type('application/x-www-form-urlencoded');
$req->content_length(1000000000);
#while posting, assign the XML to Doc variable. This variable acts
a form variable.
$req->content('Doc='.$XML_OUT);
# Pass request to the user agent and get a response back
$res = $ua->request($req);
# if response is available do the below.
if ($res->is_success) {
print 'success';
}
else{
print 'error';
}
I am posting an XML document to an asp applicaiton. This XML
document, i am sending in a loop. That is, if the XML document is big,
I am sending the first 50 records first time, then next 50 records and
so on.
The problem is, I am able to send first 50, but next 50 is
causing problem and the asp application is receiving the truncated XML.
When I send 20 after 20, first two times the xml goes fine, but the
third time the XML is truncating.
Any idea what is the problem? I am using post, so the size
should not be a problem. And more over the XML size is not more than
50k each time.
I am using the below code. I am psing only part of the code
where I am posting. if i post the full code, it will be very big.
for($x=0;$x<=$count-1;$x++){
# getting the XML content.
$XML_OUT=$xmlcnt[$x];
print 'xml==========='.$XML_OUT;
$ua = LWP::UserAgent->new;
$ua->timeout(36000);
$ua->max_size(1000000000);
# post the XML to the below url.
$req = HTTP::Request->new(POST =>
'http://viz-ams-001/facility/mapping.aspx');
# set the conetnt type of the post.
$req->content_type('application/x-www-form-urlencoded');
$req->content_length(1000000000);
#while posting, assign the XML to Doc variable. This variable acts
a form variable.
$req->content('Doc='.$XML_OUT);
# Pass request to the user agent and get a response back
$res = $ua->request($req);
# if response is available do the below.
if ($res->is_success) {
print 'success';
}
else{
print 'error';
}