Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.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函数时出现的问题_Php_Soap - Fatal编程技术网

使用PHP返回SOAP函数时出现的问题

使用PHP返回SOAP函数时出现的问题,php,soap,Php,Soap,使用此选项: <?PHP $client = new SoapClient('servername.wsdl'); $result = $client->GetUsersEmail(array('Password' => 'mypassword', 'username' => 'myusername')); var_dump ($result); ?> 我得到这个结果: 对象(stdClass)#1(1){[“GetUsersMailResult”]=>

使用此选项:

<?PHP
$client = new SoapClient('servername.wsdl');
$result = $client->GetUsersEmail(array('Password' => 
'mypassword',   'username' => 'myusername'));
var_dump ($result);
?>

我得到这个结果:

对象(stdClass)#1(1){[“GetUsersMailResult”]=>string(8)“myusername”}

还有另一个函数-IsValidUser- 当我将“getUsersMail”替换为“IsValidUser”时,我得到了一个正确的返回值:true或false.p

对SOAP完全陌生,我不知道我错过了什么

实际的.wsdl位于Intranet上,但这里有一个指向副本的链接。



您必须查找输出消息的xsd定义,可能它没有设置为字符串。

问题是我们无法在WSDL文件中看到。此文件定义返回的结构/类型以及存在的调用。这两个调用返回完全可能与您期望的不同,并且您没有遗漏任何内容。唯一知道的方法是知道servername.wsdl中的内容添加了指向的示例的链接。wsdl结果表明我的代码很好,并且服务器上的函数存在问题。谢谢你的帮助。
<wsdl:operation name="GetUsersEmail">
<wsdl:input wsaw:Action="http:/ / tempuri.org / IAuthenticationService / GetUsersEmail " message="tns: IAuthenticationService_GetUsersEmail_InputMessage "/>
<wsdl:output wsaw:Action="http: //tempuri.org/IAuthenticationService/GetUsersEmailResponse" message="tns:IAuthenticationService_GetUsersEmail_OutputMessage"/>