Drupal Services Bad request I have a drupal7 Site, in which I activated the services module to expose a SOAP service.
The problem is that I set up everything, the endpoints, the handling of the request, load the WSDL and set the class to get th efunctions, but I always get an error

function tigoapi_server() {

require_once 'ServicePort.php';
global $HTTP_RAW_POST_DATA;
$server = new SoapServer(drupal_get_path('module', 'tigoapi') . '/wsdl/TigoAPIService_1.wsdl');
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL after the server is initiated
$server-&gt;setClass('ServicePort');

error_log(print_r($server-&gt;getFunctions(),true),3,"/var/www/sites/tigo/sites/all/modules/services/tigoapi/tigoapi.log");
$server-&gt;handle($HTTP_RAW_POST_DATA);


I always get:

curl http://server/tigoapi?wsdl
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;SOAP-ENV:Body&gt;&lt;SOAP-ENV:Fault&gt;&lt;faultcode&gt;SOAP-ENV:Client&lt;/faultcode&gt;&lt;faultstring&gt;Bad     Request&lt;/faultstring&gt;&lt;/SOAP-ENV:Fault&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope


Now, if I try it , same server, same WSDL, same ServicePort class, just not going throug the Drupal router it works:

    require_once 'ServicePort.php';
global $HTTP_RAW_POST_DATA;
//$server = new SoapServer(drupal_get_path('module', 'tigoapi') . '\wsdl\TigoAPIService_1.wsdl',array('encoding'=&gt;'UTF-8'));   
$server = new SoapServer('wsdl/TigoAPIService_1.wsdl');
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL after the server is initiated
    $server-&gt;setClass('ServicePort');


    error_log(print_r($server-&gt;getFunctions(),true),3,"/var/www/sites/tigo/sites/all/modules/services/tigoapi/tigoapi.log");
//$server-&gt;handle();
$server-&gt;handle($HTTP_RAW_POST_DATA);


This works perfectly.

I'm using nginx and php-fpm, it would seem that the difference is in the way the requests gets here as with drupal I have a $_GET variable called 'q'

any ideas on this?
Ok it seems I'm implementing it wrong. 
The SoapServer::handle() source code shows why:

 if (SG(request_info).request_method &amp;&amp;
        strcmp(SG(request_info).request_method, "GET") == 0 &amp;&amp;
        SG(request_info).query_string &amp;&amp;stricmp(SG(request_info).query_string, "wsdl") == 0) {.....


the Get parameter must be wsdl, which Drupal rewrites.
Also in essence using the SoapServer drupal module you get around this.
references to implement this properly:

example
More info
Soap server module