Home > PHP > SOAP HTTP/1.1 500 Internal Service Error

SOAP HTTP/1.1 500 Internal Service Error

August 5th, 2010 Leave a comment Go to comments

When you get a HTTP/1.1 500 Internal Service Error http header while using the PHP  SoapServer->handle() method as response, while all other output seems fine: Check if the request handler $soapserver->handle() is called only once. Multiple method calls on this method can produce this error if the first handling generates a service error, and the second call does not.

If you need the SOAP headers for processing or passing to the operation object before handling the request, use $request = file_get_contents(“php://input”) instead of $request = $soapserver->getLastRequest(). It seems $soapserver->getLastRequest() can’t be called before you call $soapserver->handle().

This will also make your webservice considerably faster for all operations for which SoapServer::handle() is called twice.

Categories: PHP Tags:
  1. No comments yet.
  1. No trackbacks yet.