简体   繁体   English

IIS之外的.Net Web服务

[英].Net web service outside of IIS

I am still relatively new to web service development and I need to make a web service in C# .Net. 我对Web服务开发还比较陌生,我需要在C#.Net中创建Web服务。 I have created web services before in Java and run them using Tomcat. 我以前用Java创建过Web服务,并使用Tomcat运行它们。 Do I have to use IIS to run a .Net webservice or can I use a third party web server (Tomcat or something else)? 我是否必须使用IIS来运行.Net Web服务,还是可以使用第三方Web服务器(Tomcat或其他)?

Thanks 谢谢

WCF is the successor of Web services. WCF是Web服务的后继者。

If you use WCF, you can host in a Windows Service or in IIS. 如果使用WCF,则可以在Windows服务或IIS中托管。

Hosting and Consuming WCF Services 托管和使用WCF服务

IIS has an ISAPI extension that can ran .NET pages and services. IIS具有可以运行.NET页和服务的ISAPI扩展。 I'm not aware of any other web servers have any such extensions. 我不知道任何其他Web服务器具有任何此类扩展名。

Update : 更新

I just did some more research. 我只是做了一些研究。 Using Mono project will allow you following: 使用Mono项目可让您执行以下操作:

Apache hosting : use mod_mono , a module that allows Apache to serve ASP.NET applications. Apache主机 :使用mod_mono ,该模块允许Apache服务ASP.NET应用程序。 FastCGI hosting : use the FastCGI hosting if you have a web server that supports the FastCGI protocol for extending the server. FastCGI托管 :如果您的Web服务器支持用于扩展服务器的FastCGI协议,请使用FastCGI托管。 You also may use a web server that only has support for CGI using cgi-fcgi. 您也可以使用仅使用cgi-fcgi支持CGI的Web服务器。 XSP : this is a simple way to get started, a lightweight and simple webserver written in C#. XSP :这是入门的简单方法,这是一个用C#编写的轻巧简单的Web服务器。

The hosting environment simply needs to be able to host ASP.NET applications to run an ASP.NET webservice. 托管环境只需要能够托管ASP.NET应用程序即可运行ASP.NET Web服务。 This means that you can use the likes of Cassini, Mono on Tomcat or even in a custom environment that hosts the Http Pipeline with http.sys. 这意味着您可以在Tomcat上甚至在使用http.sys托管Http Pipeline的自定义环境中使用Cassini,Mono之类的东西。

You do not have to host WCF in IIS, but there are several benefits, and possible limits (depending on version of IIS), to doing so. 不必在IIS主机WCF,但有几个好处,以及可能的限制(根据IIS的版本),这样做。 The great thing about WCF is that you have several hosting options. 关于WCF的妙处是您有几个托管选项。

IIS is becoming the 'application server' of the Windows world and is a very attractive host for WCF, depending on your needs. IIS正在成为Windows世界的“应用程序服务器”,并且根据您的需要,它是WCF的非常有吸引力的主机。 Hosting in IIS is likely very analogous to hosting in Tomcat or other J2EE server in the Java world - this analogy becomes truer once ' Dublin ' ships. 在IIS中托管可能非常类似于在Java世界中的Tomcat或其他J2EE服务器中托管-一旦“ 都柏林 ”发货,这种比喻就变得更加真实。

See Hosting in Internet Information Services for some additional benefits, and possible constraints, to hosting in IIS. 有关在IIS中进行托管的其他一些好处以及可能的限制,请参阅在Internet Information Services中进行托管。

You don't need to run IIS to host a service. 您不需要运行IIS来托管服务。

.net (via WCF) provides all functionality required to turn any application into webservice host via the ServiceHost class. .net(通过WCF)提供了通过ServiceHost类将任何应用程序转换为Web服务主机所需的所有功能。

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

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