• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

phpsoap连接https的wsdl报错SOAP-ERROR:ParsingWSDL:Couldn'tloadfrom

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

转发:https://blog.csdn.net/keyunq/article/details/51804728

SOAP-ERROR: Parsing WSDL:Couldn’t load from “xxxxxxx” 解决方案

用php的soapclient连接第三方的webservice,是https的,连接报错SOAP-ERROR: Parsing WSDL:Couldn’t load from “xxxxxxx”

首先排查 php的soap扩展是否安装 
openssl扩展 
服务器本身安装openssl

排除第三方对本服务器的IP限制

最后怀疑是https需要ssl验证,而本机没有pem文件

可以通过如下设置,忽略ssl验证

verify_peer:指定是否验证ssl,默认为true 
将verify_peer设为false

另外,允许引用外部xml实体 
加libxml_disable_entity_loader(false);语句

libxml_disable_entity_loader(false);
$opts = array(
    'ssl'   => array(
            'verify_peer'          => false
        ),
    'https' => array(
            'curl_verify_ssl_peer'  => false,
            'curl_verify_ssl_host'  => false
     )
);
$streamContext = stream_context_create($opts);
$client = new SoapClient("https://urlToSoapWs",
  array(
      'stream_context'    => $streamContext
  ));
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

禁止引用外部xml实体 
libxml_disable_entity_loader(true);

nginx 报错 upstream timed out (110: Connection timed out)解决方案

nginx每隔几个小时就会报下面的错误:

2013/05/18 21:21:36 [error] 11618#0: *324911 upstream timed out (110: Connection timed out) while reading response header from upstream, 
client: 42.62.37.56, server: localhost, request: “GET /code-snippet/2747/HTML5-Canvas-usage HTTP/1.0”, 
upstream: “fastcgi://127.0.0.1:9002”, host: “outofmemory.cn”, referrer: “http://outofmemory.cn/code-snippet/tagged/canvas“报这个错误之后,整个服务器就不响应了,但是nginx后面的webpy程序没有任何错误,后端的数据库也很正常,从网上查了很多资料,都是说要修改proxy_read_timeout,proxy_send_timeout和proxy_buffer几个相关设置的值。

如下配置,要放在server配置节之内

large_client_header_buffers 4 16k;
client_max_body_size 30m;
client_body_buffer_size 128k;
proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300;
proxy_buffer_size 64k;
proxy_buffers   4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

fastcgi_connect_timeout 300;
fastcgi_read_timeout 300;
fastcgi_send_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers   4 32k;
fastcgi_busy_buffers_size 64k;
fastcgi_temp_file_write_size 64k;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

你可以看到上面是proxy_和fastcgi_两种配置,就是说如果你的nginx后面是proxy,就设置proxy相关的配置,如果是fastcgi就设置fastcgi相关的配置。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
php递归生成后台菜单数据发布时间:2022-07-10
下一篇:
哈夫曼树详解——PHP代码实现发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap