我必须使用SOAP
将日期转移到我们的ERP
系统中。问题是当我使用http
wsdl
时一切正常,但是如果我更改为https
的链接,则会出现错误:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'HTTPS...
我对此不太了解,因为在Web服务器上,我可以绑定两个地址http
或https
。而且我都可以在Web浏览器中打开open,而没有任何问题。
我是否需要在代码中添加一些额外内容以允许https
?
我当前的请求(标准):
$UserID = 'domain\username';
$Pwd = "password";
$ns = 'HTTP://URL/file.svc?wsdl';
if (!defined('USERPWD')){define('USERPWD', $UserID.':'.$Pwd);};
// we unregister the current HTTP wrapper
stream_wrapper_unregister('http');
// we register the new HTTP wrapper
stream_wrapper_register('http', 'NTLMStream') or die("Failed to register protocol");
$options['trace'] = 1;
$options['soap_version'] = SOAP_1_1;
$options['compression'] = SOAP_COMPRESSION_ACCEPT;
try
{
// Initialize Soap Client
$client = new NTLMSoapClient($ns,$options);
$client->setUSERPWD(USERPWD);
这是工作时的示例,但是一旦我将url更改为https
,一切都会停止。