这是一个在PHP中使用SOAPClient进行身份验证的示例 - 您只需将其适用于您正在使用的WSDL->
// Setting "trace" will allow us to view the request that we are making, after we have made it.
$objClient = new SoapClient("http://www.somewhere.com/wsdls/some.wsdl", array('trace' => true));
// These parameters satisfy this specific remote call.
$arrParameters_Login = array('username' => 'username', 'password' => 'password');
// Invoke the remote call "login()".
$objLogin = $objClient->login($arrParameters_Login);
// Grab session ID that this remote call will provide.
$strSessionID = $objLogin->loginReturn->sessionId;
然后,您将需要使用在登录响应中发送给您的sessionid/session代码 - 可能是在头文件中 - 它专用于每个WSDL。
您是如何验证身份的?你可以发表一个例子吗? – ManseUK
我应该使用WSDL文件提供的登录方法,您可以在wsdl中看到它或参阅http://goo.gl/G2PJk – Lashae
请参阅下面的答案 - 添加了一些代码作为如何使用的示例使用webservice进行身份验证 - 我可以看到登录方法以及该方法的输出是loginResponse - 在我的答案中使用代码并更新它以匹配您的wsdl ... – ManseUK