soapCall返回xml,函数名称为小写

时间:2014-09-18 11:35:27

标签: php xml soap soap-client

我试图在名为http://www.example.com/ex.wsdl的Web服务中使用名为GetExample的函数,但是当我使用__soapCall函数时,xml会变为小写。实施例

$server="http://www.example.com/example.wsdl";
$soapClient = new SoapClientDebug($server,  array('trace' => TRUE)); 

$parametros = array('Cups' => '8','Tarifa'=>'2');
$function = 'GetExample';   
$resultado = $soapClient->__soapCall($funcion, array($parametros));

这是SoapClientDebug类:

class SoapClientDebug extends SoapClient
{
    public $sendRequest = true;


    public function __doRequest($request, $location, $action, $version, $one_way=0) {
        if ($this->sendRequest) {
            var_dump($request);
            return parent::__doRequest($request, $location, $action, $version, $one_way);
        }
        else {
            return '';
        }
    }
}   

$ request var_dump如下所示:

<soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://com/example/WS/OmieServices"><soap-env:body><ns1:getexample><ns1:cups>8</ns1:cups><ns1:tarifa>2</ns1:tarifa></ns1:getexample></soap-env:body></soap-env:envelope>

如果函数名称是小写,则Web服务不返回任何内容。我已经看过soapClient构造,我在http://php.net/manual/es/soapclient.soapclient.php

中没有看到任何相关内容

0 个答案:

没有答案