-1

我正在尝试在 php 中使用具有身份验证的复杂类型的 Web 服务。任何人都可以向我展示示例 php 代码。我已阅读完整的 php.net 文档,但找不到任何有用的东西。

4

1 回答 1

0

I used a SOAP extension to consume the webservice and appended the authentication to a url, used "crxml" to parse it as the response contained a namespace it was very hard parsing it using xpath.

$login = 'username';
$password = 'password';
// establish connection and pass the credentials
$client = new SoapClient(
     'https://' . urlencode($login) . ':' . urlencode($password) . '@url?wsdl',
     array(
         'login' => $login,
         'password' => $password,
         'trace' => TRUE
     )
 );
于 2012-10-23T05:24:23.640 回答