dragunu Posted May 21, 2008 Share Posted May 21, 2008 Greeting, I am trying to create a SOAP server , using PHP 5.0.4. I am using the following code for the server: <?php //server.php function soaputils_autoFindSoapRequest() { global $HTTP_RAW_POST_DATA; if($HTTP_RAW_POST_DATA) return $HTTP_RAW_POST_DATA; $f = file("php://input"); return implode(" ", $f); } function getItemCount($upc){ $items = array('12345'=>5,'19283'=>100,'23489'=>234); return $items[$upc]; } ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache $server = new SoapServer("inventory.wsdl",array('location' => "http://localhost/test2/server.php")); $server->addFunction("getItemCount"); $server->handle(soaputils_autoFindSoapRequest()); ?> At first I used to have the Bad Request. Can't find HTTP_RAW_POST_DATA, but then , this was fixed by adding the soaputils function. However, when I try to run the server now, I am getting a SOAP-ENV:Bad Request. Can anyone suggest a workaround please? Regards, drg Link to comment https://forums.phpfreaks.com/topic/106596-soap-bad-request-issue/ Share on other sites More sharing options...
dragunu Posted May 21, 2008 Author Share Posted May 21, 2008 Thanks for all your replies in this thread, but I found the workaround Link to comment https://forums.phpfreaks.com/topic/106596-soap-bad-request-issue/#findComment-546447 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.