SoapServer->handle()

(no version information, might be only in CVS)

SoapServer->handle() --  Handles a SOAP request

Описание

class SoapServer {

void handle ( [string soap_request] )

}

Processes a SOAP request, calls necessary functions, and sends a response back.

Список параметров

soap_request

The SOAP request. If this argument is omitted, the request is supposed to be in the $HTTP_RAW_POST_DATA PHP variable.

Возвращаемые значения

Эта функция не возвращает значения после выполнения.

Примеры

Пример 1. Some examples

<?php
function test($x)
{
   return
$x;
}

$server = new SoapServer(null, array('uri' => "http://test-uri/"));
$server->addFunction("test");
$server->handle();
?>

Смотрите также

SoapServer->__construct()



SoapServer->handle()
ceo at l-i-e dot com
15-Mar-2006 02:55
In PHP5, there seem to be times when handle() doesn't "work" and complains of an Invalid Request.

This may (or may not) be only if you are using WSDL...

The root cause would seem to be that handle() expects to find the SOAP Request XML data in $HTTP_RAW_POST_DATA

However, even turning "on" always_populate_raw_post_data does not seem to fill in that variable.

Thus, you need to do like this, to snag the data from stdin and shove it into the variable handle() expects:

   if (!isset($HTTP_RAW_POST_DATA)){
       $HTTP_RAW_POST_DATA = file_get_contents('php://input');
   }

YMMV

<SoapServer->getFunctions()SoapServer->setClass()>
 Last updated: Tue, 15 Nov 2005