Monk89721 Posted May 3, 2013 Share Posted May 3, 2013 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>";var_dump($data);var_dump($_POST);print "</pre>"; This is my website:http://www.jonathonbates.info/submissions/deliver/index.php 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"> <inputs> <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> </inputs></instance> 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 Quote Link to comment https://forums.phpfreaks.com/topic/277587-trying-to-get-xml-posted-to-website-with-file_get_contentsphpinput/ Share on other sites More sharing options...
requinix Posted May 3, 2013 Share Posted May 3, 2013 What do you get when you also var_dump($_SERVER)? Quote Link to comment https://forums.phpfreaks.com/topic/277587-trying-to-get-xml-posted-to-website-with-file_get_contentsphpinput/#findComment-1428011 Share on other sites More sharing options...
Monk89721 Posted May 6, 2013 Author Share Posted May 6, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/277587-trying-to-get-xml-posted-to-website-with-file_get_contentsphpinput/#findComment-1428614 Share on other sites More sharing options...
requinix Posted May 8, 2013 Share Posted May 8, 2013 Actually I meant more of a literal "what does this output". That will include all the headers, including the Content-Type and Content-Length. And the request method too. Quote Link to comment https://forums.phpfreaks.com/topic/277587-trying-to-get-xml-posted-to-website-with-file_get_contentsphpinput/#findComment-1429133 Share on other sites More sharing options...
salathe Posted May 8, 2013 Share Posted May 8, 2013 It looks fine to me (http://bit.ly/144fHH6); maybe Device Magic is sending something incorrectly? Quote Link to comment https://forums.phpfreaks.com/topic/277587-trying-to-get-xml-posted-to-website-with-file_get_contentsphpinput/#findComment-1429167 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.