In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to configure WCF services for you. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
With the rapid development of WCF, its performance has also increased, but there are a lot of people have a headache about configuration files, so let's teach you now. Multiple services can be defined in the WCF services configuration section, and each service is placed in the service configuration section, and the WCF host program can find these defined services and publish them through the configuration file. The WCF services configuration section contains name and behaviorConfiguration attributes. Where name is configured with a type name that implements ServiceContract. The type name must fully contain the namespace and type name.
The configuration value of behaviorConfiguration is related to the contents of the subsequent behaviors configuration section. Endpoint is the body of the service configuration section, where the endpoint configuration section contains three components of endpoint: Address, Binding, and Contract. Because the specific binding configuration is done in the bindings configuration section, the bindingConfiguration property is configured in endpoint to point to the specific binding configuration. As follows:
Services servicename= "BruceZhang.MyService" behaviorConfiguration= "MyBehavior" endpointaddress= "binding=" netTcpBinding "bindingConfiguration=" DuplexBinding "contract=" BruceZhang.IHello "/ / service / services
We can also define multiple endpoint, for example:
Services service name= "Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration= "CalculatorServiceBehavior" endpointaddress= "binding=" wsHttpBinding "contract=" Microsoft.ServiceModel.Samples.ICalculator "/ endpointaddress=" mex "binding=" mexHttpBinding "contract=" Microsoft.ServiceModel.Samples.IMetadataExchange "/ / service / services
If the address value is empty, then the address of endpoint is the default base address (BaseAddress). For example, the address of the ICalculator service is http://localhost/servicemodelsamples/service.svc, while the address of the IMetadataExchange service is http://localhost/servicemodelsamples/service.svc/mex. The so-called base address can be defined by configuring host in the WCF services configuration section:
Service name= "Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration= "CalculatorServiceBehavior" host baseAddresses addbaseAddress= "http://localhost/ServiceModelSamples/service.svc"/ / baseAddresses / host endpoint... / / this is the end of the service article on "how to configure WCF services". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.