场景:

今天在生产机器上调用webservice失败 报 ...failed to load external entity...

wget一下地址发现报500错误  把wsdl去掉再wget 发现就没有任何问题 ,一想估计是生成wsdl协议时出错了  于是找一下接口方看看,但没有发现任何问题。

用soapUI加载失败

WSDLException (at /SOAP-ENV:Envelope): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'. 

用浏览器打开接口地址发现一条信息(wget居然没给我显示出来)

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>WSDL generation is not supported yet</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

WSDL generation is not supported yet  看到这句话 我在想平时加上wsdl难道是虚假的没用的?

单写一个php测试soap代码

$client = new SoapClient(null,array('location'=>'http://xxx.com/WebServerApi.php?wsdl','uri' =>'http://127.0.0.1/'));

发现去掉wsdl  和加上wsdl  完全没有任何影响,都能调取数据

再看看SoapClient方法解释

Description

public SoapClient::SoapClient ( mixed $wsdl [, array $options ] )
This constructor creates SoapClient objects in WSDL or non-WSDL mode. Parameters wsdl
URI of the WSDL file or NULL if working in non-WSDL mode
.

第一个参数是填的null  表示不需定义wsdl,用这种方式是无法跨语言访问服务,因为我们访问拿不到wsdl,php之间调用还是可以,果然代码里面的地址写成?wsdl是装逼用的。

如果把null改为wsdl地址就会抛出异常

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://xxx.com/WebServerApi.php?wsdl' : failed to load external entity 

ok 原因找到 结案!

最新文章

  1. iOS 圆角图片
  2. FMDB 版本迁移
  3. MongoDB空间整理
  4. Codeforces Round #205 (Div. 2) : A
  5. ORA-01722: invalid number,ORA-12801
  6. webservice中采用协议Http,它是指什么意思
  7. ue4中窗口打开web地址
  8. Codeforces 626C Block Towers(二分)
  9. 3.关于QT中的MainWindow窗口,MenuBar,ToolBar,QuickTip等方面的知识点
  10. OGG微服务架构入门
  11. Windows10安装pycocotools方法,亲测可用!
  12. (01) 什么是Spring Boot
  13. Install Kernel 3.10 on CentOS 6.5
  14. mysql 的 docker 镜像使用
  15. Linux中dpkg工具update-alternatives实现符号链接软件版本的切换(转)
  16. Tasks遇到的一些坑,关于在子线程中对线程权限认证。
  17. hive介绍
  18. Windows Phone 页面切换动画
  19. 「小程序JAVA实战」小程序视频列表到详情功能(58)
  20. IOS 了解新技术(UIPresentationController,屏幕适配)

热门文章

  1. 在js文件中写el表达式取不到值的原因及解决方法
  2. Yii 多表关联relations
  3. BZOJ4887:[TJOI2017]可乐(矩阵乘法)
  4. heatmap for arcgisjsapi
  5. Filter实现字符集统一设置
  6. 如果将自己的项目共享到github上
  7. selenium处理table表格
  8. Android平台上PMEM的使用及Platform设备注册(二)
  9. iOS视频处理
  10. Spring知识点小结(三)