#!/usr/bin/perl

use strict;
use LWP::UserAgent;

# proxy request...
my $ua = new LWP::UserAgent;
$ua->agent($ENV{'HTTP_USER_AGENT'});
$ua->default_headers->push_header('SOAPAction' => "\"\"");
$ua->timeout(60);

my $buffer = <<"END";
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body>  <confirmCustomerReq xmlns="http://www.nrs.eskom.co.za/xmlvend/revenue/2.0/schema">   <clientID xsi:type="GenericDeviceID" id="255255004" xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.0/schema" />   <terminalID xsi:type="GenericDeviceID" id="004" xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.0/schema" />   <msgID dateTime="20061207143803" uniqueNumber="000001" xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.0/schema" />   <idMethod xmlns:q1="http://www.nrs.eskom.co.za/xmlvend/base/2.0/schema" xsi:type="q1:VendIDMethod">    <q1:meterIdentifier xsi:type="q1:MeterCard">     <q1:track2Data>600727066860693423===0107777222011</q1:track2Data>    </q1:meterIdentifier>   </idMethod>  </confirmCustomerReq> </soap:Body></soap:Envelope>
END


# Create a request
my $req = new HTTP::Request POST => 'http://192.168.1.10:8080/axis2/services/XMLVendService2.0';
$req->content_type('text/xml');
$req->content($buffer);

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

print STDERR "response (".$res->code."):\n";
print STDERR $res->decoded_content."\n";


