Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php SoapClient调用Web服务_Php_Soap_Wsdl_Soap Client - Fatal编程技术网

Php SoapClient调用Web服务

Php SoapClient调用Web服务,php,soap,wsdl,soap-client,Php,Soap,Wsdl,Soap Client,我正在尝试调用一个基于SOAP的Web服务。以下是我的Web服务的WSDL <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:var="some_namespace"> <soapenv:Header/> <soapenv:Body> <var:SomeServiceRequest name="xxx" sch

我正在尝试调用一个基于SOAP的Web服务。以下是我的Web服务的WSDL

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:var="some_namespace">
    <soapenv:Header/>
    <soapenv:Body>
        <var:SomeServiceRequest name="xxx" school="yyy" format="pdf" senderName1="aaa" />
    </soapenv:Body>
</soapenv:Envelope>

我可以问一下这个
$this->getWSDLUrl()返回了什么吗?
Web服务的WSDL URL。。。
$soapclient = new SoapClient($this->getWSDLUrl(), array('trace' =>true,
                                                        'soap_version'   => SOAP_1_2,
                                                       ));

$headerbody = array('UsernameToken'=>array('Username'=>'someusername', 
                                            Password'=>'somepassword'));


$header = new SoapHeader('https://xxx/SoapConnector','Security',$headerbody);
$soapclient->__setSoapHeaders($header);
$oResponse = $soapclient->SomeService(array('name'=>'asd', 'school'=>'sdf','format'=>'asdf'));