tcf22 has asked for the wisdom of the Perl Monks concerning the following question:
<?xml version="1.0"?> <PaymentRequest> <PAY_CC_NUMBER>xxxxxxxxxxxx1234</PAY_CC_NUMBER> <PAY_OID>Test_ID</PAY_OID> <PAY_EMAIL></PAY_EMAIL> <PAY_CC_EXPIRE>1203</PAY_CC_EXPIRE> <PAY_PROCESSOR>Processor</PAY_PROCESSOR> <PAY_ZIP>12345</PAY_ZIP> <PAY_CC_TYPE>Visa</PAY_CC_TYPE> <PAY_MERCHANT>test2</PAY_MERCHANT> <PAY_FULL_NAME>Test Customer</PAY_FULL_NAME> <PAY_AMOUNT>1.00</PAY_AMOUNT> <PAY_CITY>City</PAY_CITY> <PAY_ADDR>123 Test st #293 </PAY_ADDR> <PAY_FUNCTION>Authorize</PAY_FUNCTION> <PAY_STATE>PA</PAY_STATE> <PAY_CVV2>111</PAY_CVV2> <PAY_COUNTRY>US</PAY_COUNTRY> <PAY_SCRIPT>test.cgi</PAY_SCRIPT> </PaymentRequest>
use strict; use warnings; use XML::Simple; use LWP::UserAgent; my $data = ##XML Data from external source. my $xml; eval { $xml = XMLout($data, rootname => 'PaymentRequest', xmldecl => '<?xml version="1.0"?>', noattr => 1); }; if ($@) { ##Error Handling } my $ua = new LWP::UserAgent; my $req = new HTTP::Request('POST', "http://$server/pay.cgi"); $req->content_type('text/xml'); $res = $ua->simple_request($req); if (! $res->is_success) { ##Error Handling }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Problems sending XML to webserver
by ajdelore (Pilgrim) on Aug 21, 2003 at 15:33 UTC | |
by tcf22 (Priest) on Aug 21, 2003 at 15:41 UTC | |
Re: Problems sending XML to webserver
by antirice (Priest) on Aug 21, 2003 at 15:34 UTC | |
Re: Problems sending XML to webserver
by tcf22 (Priest) on Aug 21, 2003 at 16:44 UTC | |
by antirice (Priest) on Aug 21, 2003 at 18:35 UTC | |
by tcf22 (Priest) on Aug 21, 2003 at 21:15 UTC | |
by tcf22 (Priest) on Aug 21, 2003 at 19:48 UTC |