In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
The main content of this article is to explain "what are the advantages and disadvantages of WCF self-hosting". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the advantages and disadvantages of WCF self-hosting?"
Self-hosting is the most flexible and convenient way to host WCF services. To be able to self-host services, two conditions must be met. *, which requires a WCF runtime; second, a managed .NET application that can host ServiceHost. You need to write the code to start and stop the host yourself.
Here are the advantages of WCF self-hosting:
◆ ease of use: it only takes a few lines of code to get the service running.
◆ flexibility: the lifetime of the service can be easily controlled through ServiceHost's Open () and Close () methods.
◆ debuggability: WCF services hosted in a self-hosting environment can be debugged using familiar debugging methods without having to connect to a single application to activate the service.
◆ ease of deployment: in general, deploying a simple Windows application is as easy as using xcopy. You don't have to deploy complex scenarios in server farms and similar places to deploy simple Windows applications to act as WCF ServiceHost.
◆ supports all bindings and transports: self-hosting does not limit you to using existing binding and transport technologies. On Windows XP and Windows Server 2003, IIS restricts you to HTTP.
The following disadvantages of WCF self-hosting:
◆ availability is limited: services can only be accessed while the application is running.
◆ functionality is limited: self-hosted applications are limited in terms of support for high availability, manageability, reliability, recoverability, versioning, and deployment scenarios. At the very least, the existing WCF does not provide this support, so in the case of self-hosting, you must implement these functions yourself; for example, IIS provides several of these features by default.
In other words, self-hosting should not be considered for enterprise-level solutions. Self-hosting is suitable for the development or demonstration phase of an enterprise project. In addition, services can be self-hosted when you want user desktop applications to communicate with each other or in peer-to-peer situations.
In order to better illustrate self-hosting in the actual working environment, this chapter provides a WinForms application that carries services for tracking QuickReturns Ltd. A quotation issued by a securities firm in a case study. In this scenario, there are two different WinForms applications. One is the Securities Dealer Manager application, which allows securities firms to publish quotations and trade securities. The other program is a separate WinForms application that tracks published quotes. Such as the list, the program exposes a service that implements the ITradeTrackingService convention, thereby enabling the tracking of quotes. The Securities Dealer Manager application invokes the service after successfully publishing the quote through TradeService.
Using System.ServiceModel; using QuickReturns.StockTrading.ExchangeService.DataContracts; namespace QuickReturns.StockTrading.TradeTrackingService.Contracts {[ServiceContract ()] interface ITradeTrackingService {[OperationContract ()] void PublishQuote (Quote quote);}} at this point, I believe you have a deeper understanding of "what are the advantages and disadvantages of WCF self-hosting". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.