I am updating previously written code. The original code simply took some raw xml and sent it using HTTP::Request
Here's the code snipet.
$userAgent = LWP::UserAgent->new(agent => 'perl post');
$file_contents = do { local $/; <INFILE> };
$message = $file_contents;
$response = send_xml();
$xml_resp = $response->as_string;
sub send_xml
{
my $request = HTTP::Request->new(POST => 'http://"servername".asmx
+');
$request->header(SOAPAction => "https://"url");
$request->content($message);
$request->content_type('text/xml; charset=utf-8');
my $response = $userAgent->request($request);
$response;
}
obviously "servername" and "url" are just place holders to the real servers.
Like I said, I am getting back into Perlville after a long break. thanks for the pointer to HTTP::Message which lead me to HTTP::Header. $xml_response contains the header I want to get rid of. I'll work on stripping it out when I get the response back.
|