$SOAP_CONFIG = array(
'login' => $user,
'password' => $password,
'authentication' => SOAP_AUTHENTICATION_BASIC,
'soap_version' => SOAP_1_1,
'connection_timeout' => 15,
'encoding' => 'UTF-8'
);
try {
// $arrContextOptions=array("ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false,'crypto_method' => STREAM_CRYPTO_METHOD_TLS_CLIENT));
// $options = array(
// 'soap_version'=>SOAP_1_2,
// 'exceptions'=>true,
// 'trace'=>1,
// 'cache_wsdl'=>WSDL_CACHE_NONE,
// 'stream_context' => stream_context_create($arrContextOptions)
// );
$client = new SoapClient($url, $SOAP_CONFIG);
// $client = new SoapClient($url, $options);
print_r($client);
} catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
我具有用于Web服务的上述配置,以便使用soap客户端获取SAP数据。
我明白了:
异常错误!
SOAP错误:解析WSDL:未知的必需WSDL扩展'http://schemas.xmlsoap.org/ws/2004/09/policy'null
了解如何解决此问题的任何想法
Update
尝试:
$SOAP_AUTH= array( 'login' => $user, 'password' => $password);
#SpecifyWSDL
#CreateClient Object, download and parse WSDL
$client= new SoapClient($url,$SOAP_AUTH);