Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Getting XML to text

by chuck882 (Initiate)
on Aug 26, 2014 at 19:16 UTC ( [id://1098654]=perlquestion: print w/replies, xml ) Need Help??

chuck882 has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am lost and looking for guidance. From a PERL Web Service server I simply want to get the XML sent to the server from the other system and get it into a text variable. I cannot seem to find a means to do that. I see where SOAP::SOM lets you parse SOAP responses to web services but I want to do this on the server end and jsut grab the whole XML message. Can anyone point me to a means to do this?

I do have stub programs working to both send (client) and receive (server) the message.

Thanks, Chuck

Replies are listed 'Best First'.
Re: Getting XML to text
by derby (Abbot) on Aug 26, 2014 at 22:29 UTC

    Is the server side perl? If so, is the client sending the XML stream correctly (POST/PUT with correct MIME type)? Is the server side using CGI or some other module? Lots of examples only deal with the form processing of CGI. If you're using CGI.pm, you want to look at the sections on POSTDATA and PUTDATA. It may be helpful to post your stub programs if they're fairly small.

    -derby

      Yes the server side is PERL. The server side processes the request properly. All I want it to get the XML being sent to me into a string variable.

        Well ... you give us no code nor info on frameworks, modules, client set headers, http method, etc. I'll just assume you're POSTing XML with a mime type of application/xml and using CGI on the server side. If those assumptions are correct, then you just need to:

        my $data = $query->param('POSTDATA');
        If those assumptions are not correct, you're going to need to provide more information because there are so many different ways for a client to send data and a server to process requests.

        -derby
Re: Getting XML to text
by Anonymous Monk on Aug 26, 2014 at 20:03 UTC

    I'm not sure I understand you correctly. You want to essentially spy on a third party's communication with the server?

    If you aren't wiretapping live, you'd need the server to save relevant info to a log or database or whatnot, and then handle requests for that log file.

      Sorry, had to deal with personnal issues. No, this is not spying. Another party sends my PERL web service a request. I want to take the XML request they setn me, put into a text string and save it off. This should be so simple but I cannot seem to find the right method to do it.

Re: Getting XML to text
by Anonymous Monk on Aug 28, 2014 at 07:30 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1098654]
Approved by hominid
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-20 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found