Recieve XLM Post with PHP

I am working on a project and I’m trying to get a php based webserver to recieve XML posts from another server. I’m having issues figuring out where to start with this. I’m average at php code but clueless with XML.

I do understand once I recieve the data how to parse it out and manage it. I’m having issue figuring out how to recieve the XML POST from the sending server with a php script.

I put a quick test file together using the HTTP_RAW_POST_DATA statement and had it store the variable to a file. Executing the test.php via a browser stores a blank txt file to the HD as I told it too. I would imagine that an XML POST would be calling this file with variables streaming on it. Maybe I’m wrong. I have read a bit on Java and Axis an apache application.

I just don’t know where to start. I need to recieve an XML POST and respond with an OK to the sender, store that post in a text file for now. I will develop some MYSQL code to drop it into a database after I figure out how to recieve the darned thing.

My PHP site is running on a standard install of XAMPP for Windows.
Thanks for your suggestions…

can’t u make a test where u lett the application u wanna get the XLM from is calling the test.php?

if not u need to know the format of the XML the app will be sending, and then u are able to make a second php-file using socks conection to emulate that app.

http://de3.php.net/manual/en/ref.sockets.php there is an example how to send raw http headers. (Example 2275. Socket example: Simple TCP/IP client)
with a little modification u sould be able to use this to send plain XML as POST.

hope this helps u to get started.

Thanks for the start. I have it using HTTP_RAW_POST_DATA and urldecode(); Works great!

This one is resolved…

Sponsor our Newsletter | Privacy Policy | Terms of Service