Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.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中使用soap调用web服务_Php_Soap - Fatal编程技术网

如何在php中使用soap调用web服务

如何在php中使用soap调用web服务,php,soap,Php,Soap,HTTP/1.1200ok 内容类型:text/xml;字符集=utf-8 内容长度:长度 Its output should be like this : 一串 int 一串 int 将PHP本机与服务WSDL一起使用,如下所示: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd

HTTP/1.1200ok 内容类型:text/xml;字符集=utf-8 内容长度:长度

Its output should be like this :

一串
int
一串
int
将PHP本机与服务WSDL一起使用,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    

xmlns:xsd="http://www.w3.org/2001/XMLSchema"    
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
 <getZoneInfoResponse xmlns="http://autotask.net/ATWS/v1_5/">
  <getZoneInfoResult>
    <URL>string</URL>
    <ErrorCode>int</ErrorCode>
    <DataBaseType>string</DataBaseType>
    <CI>int</CI>
  </getZoneInfoResult>
 </getZoneInfoResponse>
 </soap:Body>
 </soap:Envelope>

至少,你应该瞄准这样的目标。可以找到更多

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    

xmlns:xsd="http://www.w3.org/2001/XMLSchema"    
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
 <getZoneInfoResponse xmlns="http://autotask.net/ATWS/v1_5/">
  <getZoneInfoResult>
    <URL>string</URL>
    <ErrorCode>int</ErrorCode>
    <DataBaseType>string</DataBaseType>
    <CI>int</CI>
  </getZoneInfoResult>
 </getZoneInfoResponse>
 </soap:Body>
 </soap:Envelope>
$atservices_wsdl = "https://www.autotask.net/atservices/1.5/atws.wsdl";
$atservices_client = new SoapClient($atservices_wsdl);

$zone_info = $atservices_client->getZoneInfo("SomeUserName");

print_r($zone_info); // review the returned object converted from SOAP response.

echo $zone_info->DataBaseType; // this might work if it's not behind a Response object.
$soap = new SoapClient('link/to/.wsdl');
$result = $soap->__soapCall('getZoneInfo', array('UserName' => $username));
var_dump($result);