简体   繁体   English

SOAP Web服务故障排除

[英]Troubleshooting SOAP web service

I am trying to invoke the Web Service PersonalDetails_Update by passing an array of values to it. 我试图通过将值数组传递给Web服务来调用PersonalDetails_Update。 These values are being successfully written to the database that the web service is designed to do. 这些值已成功写入Web服务设计要执行的数据库中。 However, it is also supposed to return an ID for the record written to the database. 但是,还应该返回写入数据库的记录的ID。 But I don't get anything back. 但是我什么也没回来。 Just a blank screen with no XML or underlying source. 只是一个没有XML或基础源的空白屏幕。

When using getLastRequest, I get this error: 使用getLastRequest时,出现此错误:

Fatal error: Uncaught SoapFault exception: [Client] Function ("getLastRequest") is not a valid method for this service in

Code used to pass data to web service and request/response headers: 用于将数据传递到Web服务和请求/响应标头的代码:

$client->PersonalDetails_Update(array('personaldetails' => $params));
printf("<br/> Request = %s </br>", htmlspecialchars($client->getLastRequest()));
$result = $client->__getLastResponse();
$header = $client->__getLastResponseHeaders();

When using getLastResponse and getLastResponseHeaders, I don't get anything back. 当使用getLastResponse和getLastResponseHeaders时,我什么也得不到。

you forgot the "__": 您忘记了“ __”:

printf("<br/> Request = %s </br>", htmlspecialchars($client->__getLastRequest()));

your soap client thinks "getLastRequest" is a method of a soap service this way, not a soap client method. 您的肥皂客户端认为“ getLastRequest”是这种肥皂服务方法,而不是肥皂客户端方法。

also you should tell us what soap client you are using. 您还应该告诉我们您使用的是什么肥皂客户。 i assume you use php built-in soap client... 我认为您使用的是PHP内置肥皂客户端...

use __soapCall method to be sure, you are making a request to the service: 确保使用__soapCall方法,您正在向服务发出请求:

try {
    $result = $client->__soapCall('PersonalDetails_Update', array('personaldetails' => $params));
} catch (SoapFault $exception) {
    echo 'soap fault occured: '.$exception->getMessage().'<br/>';
}

you should check if the returned value is a soap fault.. see the manual 你应该检查返回值是一个SOAP错误..看到手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM