简体   繁体   English

?wsdl php Web服务显示无发现信息无法添加参考

[英]?wsdl php web service show no discovery information can not add reference

I got this error. 我得到了这个错误。 That's why I can't add a reference to my project. 这就是为什么我无法添加对我的项目的引用。

You need to have a valid WSDL for your WebService. 您需要为您的WebService使用有效的WSDL。 ( WSDL Documentation ) WSDL文档

Try accessing the WebService's url with ?wsdl in the end. 最后尝试使用?wsdl访问WebService的URL。 Example: 例:

http://my.url.com/webServiceFile.aspx becomes http://my.url.com/webServiceFile.aspx?wsdl http://my.url.com/webServiceFile.aspx变为http://my.url.com/webServiceFile.aspx?wsdl

You should see something like this . 您应该看到类似这样的内容 If you get an error message, then the WebService you're trying to access is not valid. 如果收到错误消息,则您尝试访问的WebService无效。

EDIT: I just realised that the URL field in your screenshot was blank because you did not enter anything in there. 编辑:我只是意识到屏幕快照中的URL字段为空,因为您没有在其中输入任何内容。 You need to know the URL of your WebService and then insert it into that field, making sure you have ?wsdl at the end. 您需要知道WebService的URL,然后将其插入该字段,并确保末尾有?wsdl

It needs to be something like: 它必须是这样的:

http://<your domain>.com/<WebService file>.aspx?wsdl

Try to add: 尝试添加:

header("Content-Type: text/xml");

before you print your wsdl. 在打印wsdl之前。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM