in reply to help stripping header from a Web Service Response

Have you looked at HTTP::Message?

Also, what module are you using to send your web service request that doesn't already return a properly parsed response?

  • Comment on Re: help stripping header from a Web Service Response

Replies are listed 'Best First'.
Re^2: help stripping header from a Web Service Response
by tudley (Initiate) on Jul 06, 2011 at 17:29 UTC
    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.

      Why do you use $response->as_string instead of using $response->content or $response->decoded_content ? $response already is a HTTP::Response (which is a HTTP::Message), so you already have everything you need. You just should start using it.