如何用urn调用Soap客户端PHP?

时间:2015-12-07 11:19:43

标签: php web-services soap wsdl

嗨我有这个WSDL,当我在soapUI中测试时,它运行良好。 但我有问题从php soap客户端调用它。

        <soapenv:Envelope 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
        xmlns:urn="urn:uXXX">
           <soapenv:Header/>
           <soapenv:Body>
              <urn:Pesquisar soapenv:encodingStyle=
                 "http://schemas.xmlsoap.org/soap/encoding/">
                 <active xsi:type="xsd:boolean">true</active>
              </urn:Pesquisar>
           </soapenv:Body>
        </soapenv:Envelope>

我正在尝试这样的PHP:

$client = new \SoapClient($mywsdl);
$headers[] = new \SoapHeader('urn:uXXX', 'urn');
$client->__setSoapHeaders($headers);
var_dump($client->Pesquisar(['parameters'=>['active' => true]]));

PS:这个soap,doens有身份验证,因为我在可以访问soap服务器的服务器内。

0 个答案:

没有答案