Craig Brass Systems Forum: HTTP_RAW_POST_DATA variable problems - Craig Brass Systems Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

HTTP_RAW_POST_DATA variable problems Seems SOAP server returns no xml in some cases

#1
User is offline   martin_boy 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 14-April 09
On some server configurations (i don't determine what they are) the global variable HTTP_RAW_POST_DATA can not be set automatically. In these cases SOAP server returns no xml document ('looks like we got no XML document' error appears if you are using native PHP SOAP library and 'Response not of type text/xml: text/html' error appears if you are using NuSoap client).
This is my fix of this problem. Replace the last line in integrationapi/index.php by the following:

// service the methods
if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && $postRawData = @file_get_contents("php://input") ){
    $GLOBALS['HTTP_RAW_POST_DATA']= $postRawData;
}
$server->service(isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '');

I consider it will be helpful.

This post has been edited by Andrew Gillard: 07 September 2009 - 10:31 AM
Reason for edit: Fixing IPB 2 code

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users