且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

发送SOAP头与WSDL的SOAP请求与PHP

更新时间:2022-05-10 00:29:46

您应该能够创建一个标题,然后将其添加到客户端,以便它是为所有后续请求发送。您可能需要更改命名空间参数。

You should be able to create a header and then add it to the client so it is sent for all subsequent requests. You will probably need to change the namespace parameter.

$service = new SoapClient("http://localhost:16840/CTI.ConfigStack.WS/ATeamService.asmx?WSDL");
//                        Namespace               Header Name          value   must-understand
$header = new SoapHeader('http://tempuri.org/', 'AuthorisationHeader', $value, false);
$service->__setSoapHeaders(array($header));   

$service->AddPendingUsers($users, 3); // Example

的更多信息这里