#!/usr/bin/perl
#!c:\perl\bin\perl.exe

use LWP::Simple;
use LWP::UserAgent;

$ua = LWP::UserAgent->new;
$time3=time;

for ($i=1; $i<=30; $i++) {

my $req = HTTP::Request->new(POST => 'http://lizzie.uccs.edu/cgi-bin/purchase.pl');
#my $req = HTTP::Request->new(POST => 'http://calvin.uccs.edu/cgi-bin/purchase.pl');
$req->content_type('text/xml');

$xmldoc = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>
<purchase>
<customerName>CCL</customerName>
<customerID>111222333</customerID>
<item>
<productID>30912154141288</productID>
<productName>IBM Thinkpad T21</productName>
<unitPrice>5000</unitPrice>
<noOfUnits>10</noOfUnits>
<subTotal>11288</subTotal>
</item>
<item>
<productID>3091215414118</productID>
<productName>IBM Thinkpad T211</productName>
<unitPrice>500</unitPrice>
<noOfUnits>110</noOfUnits>
<subTotal>11218</subTotal>
</item>
<totalAmount>52000</totalAmount>
</purchase>";

$req->content($xmldoc);
my $res = $ua->request($req);
print $res->content;
print "\n-----------------------\n";
}

$time4=time;
$periodxml = ($time4 -$time3)/30;
print "Get response after submitting purchase.xml in $periodxml seconds\n";
