Web服务和IIS [英] Web Services and IIS

查看:44
本文介绍了Web服务和IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ASP.Net的新手.我已经在C#.net中编写了一个Web服务.它已成功编译和构建,在调试时,我可以看到它在系统托盘中正在运行.但是,当我尝试使用本地主机地址从自己的PC与Web服务通信时,没有得到响应.是因为我的PC上未安装IIS服务器.我不知道是否需要安装IIS来托管Web服务.让我知道是否需要安装IIS?如果不是,那可能是什么问题?

I am new to ASP.Net. I have written a webservice in C# .net. It is compiled and built successful and while debugging, I can see it running in the system tray. But when I try to communicate with the webservice from my own PC using localhost address, I am not getting response. Is it due to IIS server not installed on my PC. I dont know whether IIS is needed to be installed for hosting a web service. Let me know if IIS is needed to be installed? If not what could be the problem?

推荐答案

每个Web应用程序都需要部署在某个Web服务器上.在VS IDE上工作时,它提供了自己的Web开发服务器.因此,如果您在同一解决方案中拥有服务,则可以添加引用,并且我不需要IIS.但是,如果您有另一个项目,并且想直接从localhost使用,则需要将其托管在IIS中.

您可以尝试一张支票.在IE上键入Web服务的URL,并检查是否可以使用wsdl和方法
Every web application need to be deployed on some web server. While working on VS IDE, it provides it own web development server. So if you have service in the same solution then you can add reference and you don''t need IIS I guess. But if you have another project and want to use directly from localhost, you need host it in IIS.

One check you can try. Type the URL of webservice on IE and check whether you''ll able the wsdl and method


从PC访问Webservice时使用的URL是什么?是http://localhost/serviceName吗?如果您将服务托管在另一台计算机上,则应像这样访问它,即http://hostIPorHostName/serviceName.
what is the URL you are using when accessing the webservice from your PC? Is it like, http://localhost/serviceName? If you are hosting the service on another machine, you should access it like this, http://hostIPorHostName/serviceName.


感谢您的快速回复:)

是的,我可以从URL中看到服务列表.我可以从浏览器调用服务.但这在我为Web服务添加了Web参考的应用程序中不起作用.
Thanks for quick reply :)

Yeah, I am able to see the list of services from the URL. I am able to invoke the services from the browser. But it is not working from application where I have added the web reference for the webservice.


这篇关于Web服务和IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆