似乎无法从我的 SoapClient 获得响应
我刚刚开始通过 php 进行肥皂通信。
我可以访问一个 Web 服务,该服务根据“用户名”、“密码”和“域”三个属性返回 true 或 false
这是我的匿名请求代码:
//VARS
$username = 'example';
$password = 'example';
$domain = 'example';
$client = new SoapClient("https://www.example.com/example.wsdl");
try {
$client->authenticate(array($email, $password, $domain));
echo $client->__getLastResponse();
} catch (SoapFault $e) {
echo $e->getMessage();
}
die();
现在,正如我所提到的,我对此很陌生,所以我不熟悉确保我写的内容是正确的,请帮忙!
以下是 wsdl 的相关部分(再次匿名):
//MESSAGE
<message name="AuthenticateRequest">
<part type="xsd:string" name="username"/>
<part type="xsd:string" name="password"/>
<part type="xsd:string" name="domain"/>
</message>
<message name="AuthenticateResponse">
<part type="xsd:boolean" name="authenticationResponse"/>
</message>
//OPERATION
<portType name="LDAPPortType">
<operation name="authenticate">
<documentation>
Connects to the LDAP server with the parameters provided. If successful, this function then attempts to bind to the LDAP directory with the user's credentials. The function returns TRUE on success or FALSE on failure.
</documentation>
<input message="tns:AuthenticateRequest"/>
<output message="tns:AuthenticateResponse"/>
</operation>
</portType>
我错过了什么重要的事情吗?
感谢您的帮助,非常感谢!
I'm just getting started with soap communication through php.
I have access to a webservice that returns a true or false dependant on three attributes 'username', 'password' and 'domain'
Here's my anonymised request code:
//VARS
$username = 'example';
$password = 'example';
$domain = 'example';
$client = new SoapClient("https://www.example.com/example.wsdl");
try {
$client->authenticate(array($email, $password, $domain));
echo $client->__getLastResponse();
} catch (SoapFault $e) {
echo $e->getMessage();
}
die();
Now, as I mentioned, I'm new to this so I'm not sure that what I've written is even correct, please help!
Here are the relevant parts of the wsdl (again, anonymised):
//MESSAGE
<message name="AuthenticateRequest">
<part type="xsd:string" name="username"/>
<part type="xsd:string" name="password"/>
<part type="xsd:string" name="domain"/>
</message>
<message name="AuthenticateResponse">
<part type="xsd:boolean" name="authenticationResponse"/>
</message>
//OPERATION
<portType name="LDAPPortType">
<operation name="authenticate">
<documentation>
Connects to the LDAP server with the parameters provided. If successful, this function then attempts to bind to the LDAP directory with the user's credentials. The function returns TRUE on success or FALSE on failure.
</documentation>
<input message="tns:AuthenticateRequest"/>
<output message="tns:AuthenticateResponse"/>
</operation>
</portType>
Have I missed anything crucial?
Thanks for your help, it's greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您在此行中需要
$username
而不是$email
另外尝试将数组中的参数名称指定为:
I think you are going to need
$username
instead of$email
in this lineAlso try to specify parameter names in array as: