Jump to content

Trying to get XML POSTed to website with file_get_contents('php://input')


Recommended Posts

Trying to get XML POSTed to my website using the code below:


To test that I am getting anything (which I do not at the moment) to my website I use this code:
print "CONTENT_TYPE: " . $_SERVER['CONTENT_TYPE'] . "<BR />";
$data = file_get_contents('php://input');
print "DATA: <pre>";
print "</pre>";


This is my website:


This is the XML that I should receive:

<?xml version="1.0"?>
<instance xmlns="http://www.devicemagic.com/xforms/**private form ID**" xmlns:dm="http://mobileforms.devicemagic.com/xforms" writeTime="2013-05-03T06:24:08-07:00" dm:submitting_user="Monk" dm:submitting_device="Android_**private ID**" dm:submit_time="2013-05-03 13:24:08 UTC" dm:form="test_form" dm:form_version="1.00">
    <test_1_not_populated>leverage real-time web services</test_1_not_populated>
    <test_2_populated>exploit dynamic portals</test_2_populated>
    <test_3_db_populated>synthesize dot-com users</test_3_db_populated>


The website that I have created is for receiving XML on a custom connection setup on a website called Device Magic - basicaly automates PUSHing forms to mobile client devices.


I have set the destination (my website) within Device Magic and have only tried adding header 'Content-Type: Application/XML' as another idea.


Please suggest why I receive nothing or what I could do to fix this.


Many thanks




Link to comment
Share on other sites

The server details of my hosting company - 1and1 hosting.


So I try with FireFox REST client and do the same as written in my first post.


The highlighted response seems fine and its code is 200 so it worked fine also the response preview is fine - what I want.


I load my site in my browser and the response preview that I saw in FF REST client is not shown.


Please help, have I got this completely wrong?


Many thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.