如何使用 HTTPS Web 服务和 .PEM 客户端证书创建 PHP SOAP?
当我这样做时,我收到以下错误:
数组(2){[0]=>字符串(38)“testeResponse teste(teste $parameters)”[1]=>字符串(38)“testeResponse teste(teste $parameters)”}
致命错误:未捕获的 SoapFault 异常:[wsse:InvalidSecurity] D:\Inetpub\wwwroot\SOAP\index.php:47 中缺少 SOAP 标头 堆栈跟踪:#0 [内部函数]:SoapClient->__call('teste', Array ) #1 D:\Inetpub\wwwroot\SOAP\index.php(47): SoapClient->teste(Array) #2 {main} 在第 47 行的 D:\Inetpub\wwwroot\SOAP\index.php 中抛出
编码:
$client = new SoapClient($wsdl, array(
'local_cert' => $localCert,
'passphrase' => $passphrase,
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL,
'exceptions' => true,
'trace' => true)
);
$something = $client->teste(array());
echo $something->testeResult;