简体   繁体   English

在Visual Studio中使用PHP Web服务

[英]Consuming a php webservice in visual studio

Is it possible to consume a php webservice in visual studio? 是否可以在Visual Studio中使用php Web服务? I have a webservice with a wsdl file created by nusoap, when I try to add the web reference in visual studio the name of the service and the methods show up but it complains that the 'wsdl is not a known document type' and the discovery document could not be found. 我有一个由nusoap创建的wsdl文件的网络服务,当我尝试在Visual Studio中添加网络引用时,该服务的名称和方法会显示出来,但它抱怨“ wsdl不是已知的文档类型”和发现找不到文件。

Any suggestions would be appreciated. 任何建议,将不胜感激。

thanks, Richard 谢谢,理查德

Responses to suggestions: 对建议的回应:

  • Well there is no asmx file at the moment, since the .net app is using the functions of the php webservice and not the other way around. 好吧,目前没有asmx文件,因为.net应用程序正在使用php webservice的功能,而不是相反。 Maybe nusoap can create a asmx? 也许nusoap可以创建一个asmx? I think that is just for the .net side though. 我认为这只是针对.net方面。

  • I 'm trying with nusoap because it automatically creates the wsdl for you, however I did try the inbuilt soap handing of php first with my own wsdl file but got the same error as with nusoap. 我正在尝试使用nusoap,因为它会自动为您创建wsdl,但是我确实尝试使用我自己的wsdl文件首先尝试了php的内置肥皂处理,但出现了与nusoap相同的错误。

  • Seems the problem in the end was really my webserver, my files where encoded in utf8 and it didn't like that. 最终问题似乎出在我的Web服务器上,我的文件是用utf8编码的,它不是那样的。 Thanks for the answers though. 谢谢你的回答。

I use the pattern of the code found here . 我使用此处找到的代码模式。 It works for me. 这个对我有用。 Also did you check to the wsdl by browsing to the url of the service? 您是否也通过浏览到服务的URL来检查wsdl? It may be that your service is generating an invalid .wsdl file. 可能是您的服务正在生成无效的.wsdl文件。

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

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