Page 1 of 1

Capturing/ Consuming Content

Posted: Thu Apr 17, 2008 2:20 pm
by kendall
Hi,

I am creating a web service in which i am posting parameters to a web service using curl. I am now faced with a situation in which the web service needs to me to create a web service to consume a response HTML/ XML POSTEd content from them...My question is...How do i create a web service to "capture" "content" information for e.g. a page

to use pseudo code to help understand the process....

1) I send information to the service via curl and recieve a response which leads me to
a) continue on with my process
b) provide the information to the user for input which is captured by the service directly
2) the service then sends content to me which i must consume/ parse in order to analyse the response

It is the 2) part that is confusing to me...usually if its a form you would simply use $_POST environment to get eh information....however the content coming back to me is in the form

Code: Select all

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<string >RESPONSEDATA</string>
In which RESPONSEDATA is url encoded...

So my question is "how" to i capture this raw data in a php variable? :?:

Re: Capturing/ Consuming Content

Posted: Thu Apr 17, 2008 3:06 pm
by Christopher
It looks like what is coming back to you is XML. So parse the XML first. If the data you get from an XML field is URL encoded, then decode and parse the URL string.

Re: Capturing/ Consuming Content

Posted: Fri Apr 18, 2008 10:54 am
by kendall
arborint wrote:It looks like what is coming back to you is XML. So parse the XML first. If the data you get from an XML field is URL encoded, then decode and parse the URL string.
Well i know this but what i want to know is how do i
So parse the XML first. If the data you get from an XML field is URL encoded, then decode and parse the URL string.
I'm doing some research on $HTTP_RAW_POST_DATA not sure how this is suppose to work though

Re: Capturing/ Consuming Content

Posted: Fri Apr 18, 2008 11:27 am
by RobertGonzalez