SoapClient调用继续返回null

时间:2011-11-10 17:06:30

标签: php soap

我现在已经在这方面坚持了一段时间,而且我一直无处可去。

$client = new SoapClient($wsdl, array('trace' => 1));
print_r($client->__getFunctions());
$params->param1 = $cust;
$params->param2 = "1f0de966909641061b729d383bd41bb2f0c3f4db";
$response = $client->ValidateLicenseKey($params);
print_r($params);
print_r($response);
echo "Last Request: ".$client->__getLastRequest();
echo "Last Response: ".$client->__getLastResponse();

输出如下:

Array
(
    [0] => ValidateLicenseKeyResponse ValidateLicenseKey(ValidateLicenseKey $parameters)
    [1] => CreateProviderResponse CreateProvider(CreateProvider $parameters)
    [2] => SetHardwareProfileResponse SetHardwareProfile(SetHardwareProfile $parameters)
    [3] => UpdateCurrentVersionResponse UpdateCurrentVersion(UpdateCurrentVersion $parameters)
    [4] => SoftwareUpdateAvailableResponse SoftwareUpdateAvailable(SoftwareUpdateAvailable $parameters)
    [5] => GetSoftwareUpdateResponse GetSoftwareUpdate(GetSoftwareUpdate $parameters)
)
stdClass Object
(
    [param1] => satsys
    [param2] => 1f0de966909641061b729d383bd41bb2f0c3f4db
)
stdClass Object
(
    [ValidateLicenseKeyResult] => 
)
Last Request: <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:ValidateLicenseKey/></SOAP-ENV:Body></SOAP-ENV:Envelope>
Last Response: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><ValidateLicenseKeyResponse xmlns="http://tempuri.org/"><ValidateLicenseKeyResult>false</ValidateLicenseKeyResult></ValidateLicenseKeyResponse></s:Body></s:Envelope></pre>

为什么在地球上print_r建议返回为空?这只是一个简单的调用,用于检查密钥是否在数据库中。其他任何函数都没有返回结果。有人可以解释这里出了什么问题吗?

1 个答案:

答案 0 :(得分:0)

返回值不为空,为false。使用var_dump可以更清楚地查看变量类型。解析的响应对象是响应XML的有效表示。