简体   繁体   English

如何创建不在IIS中托管的ASP.NET Web服务?

[英]How can I create an ASP.NET web service that isn't hosted in IIS?

I want to create a stand-alone (ie not hosted in IIS) web service in ASP.NET. 我想在ASP.NET中创建一个独立的(即不在IIS中托管)Web服务。 Is this possible, and if so what's the best way to do it? 这是可能的,如果是这样,最好的方法是什么?

So, you want to use ASP.NET to generate a web service, but you don't want to host ASP.NET using IIS. 因此,您希望使用ASP.NET生成Web服务,但您不希望使用IIS托管ASP.NET。 (For those reading this, the question was made clearer in an comment to Sir Psycho's response). (对于那些阅读此内容的人来说,在对Sir Psycho的回应的评论中,问题更清楚了)。

Then this article would be a good start: 然后这篇文章将是一个良好的开端:
http://aspalliance.com/articleViewer.aspx?aId=220&pId= http://aspalliance.com/articleViewer.aspx?aId=220&pId=

It describes how you can use System.Web.Hosting namespace to process asp.net from the command line, and output the resulting HTML (or in your case XML). 它描述了如何使用System.Web.Hosting命名空间从命令行处理asp.net,并输出生成的HTML(或者在您的情况下为XML)。

Assuming you want data returned like a normal web request, you will to set up a socket to listen on port 80, interpret the HTTP requests, then use code similar to that in the article to output the results as a response to the web request. 假设您希望像普通Web请求一样返回数据,您将设置一个套接字以侦听端口80,解释HTTP请求,然后使用类似于文章中的代码输出结果作为对Web请求的响应。

打开Visual Studio,启动一个新项目并选择“Web服务应用程序”

I don't know if this answers the question exactly. 我不知道这是否完全回答了这个问题。 If you want to create a webservice, is there a reasonable way to not require IIS but not have to handle data at a socket level.? 如果要创建Web服务,是否有合理的方法可以不需要IIS但不必在套接字级别处理数据。

暂无
暂无

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

相关问题 如何处理ASP.NET网页和IIS中托管的WCF服务之间的跨域请求? - How to handle cross domain request between an asp.net web page and a WCF service hosted in IIS? 无法调试在Visual Studio 2015上开发并托管在IIS上的asp.net Web应用程序 - Can't debug my asp.net web app developped on visual studio 2015 and hosted on IIS ASP.NET Core 3.1 Web API: can it be self-hosted as Windows service with https and use some certificate like IIS? - ASP.NET Core 3.1 Web API : can it be self-hosted as Windows service with https and use some certificate like IIS? 当托管在Azure应用程序服务中时,如何控制添加到ASP.NET核心Web应用程序中的HTTP响应标头? - How can I control the HTTP response headers added to my ASP.NET core web application when hosted in Azure app service? Web服务可在asp.net中工作,但不能在IIS中工作 - Web service works in asp.net but not IIS 为什么 Azure 中托管的 ASP NET Web 服务不执行任何操作? - Why isn't my ASP NET web service hosted in Azure doing anything? 调试 IIS 网站时,ASP.NET Core 2 Web 应用程序未加载用户机密 - ASP.NET Core 2 web application isn't loading user secrets when debugging IIS website 如何在本地iis上部署asp.net Web应用程序? - How can I deploy an asp.net web application on my local iis? 无法连接托管在 Azure Web 应用程序上的安全 Asp.Net Core Web 套接字(使用 TLS) - Can't connect secured Asp.Net Core Web Socket hosted on Azure Web App (using TLS) ASP.NET:为什么我不能在一个页面中两次调用Web服务? - ASP.NET: Why can't I call a web-service twice in one page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM