wcf configuration - the basics
Post on 10-May-2015
950 Views
Preview:
DESCRIPTION
TRANSCRIPT
2014
WCF ConfigurationThe basics
2
The most important thing to remember about WCF services is just as simple as…
3
Address: Service’s URI
Binding: Specifies transports (HTTP, TCP …) and protocols (Security, Reliability …)
Contract: Interface that defines the contract
4
Major Sections of the Configuration File-- Server Side --
<configuration> <system.serviceModel> <services>
<endpoint></endpoint>
</services><bindings>
</bindings><behaviors>
</behaviors> </system.serviceModel></configuration>
5
<services> element• Contains all services the application hosts
<servicesname=“<Complete Namespace>.OfferService”behaviorConfiguration=“OfferManagerServiceBehavior” >
<endpointaddress=“net.tcp://localhost:808/OfferManager.dev/OfferService.svc”binding=“netTcpBinding”contract=“<Complete Namespace>.IOfferManager”bindingConfiguration=“netTcpBinding”>
</endpoint></services>
[This section is optional: a set of default endpoints are automatically added to your service]
6
<binding> element• contains the specifications for all bindings that can be used by endpoints• system provided or custom
<bindingsname=“netTcpBinding”
portSharingEnabled="true" maxBufferSize="65536000" maxConnections="100" maxReceivedMessageSize="65536000“…
<Security mode="Transport" /></bindings >
[This section is optional]
7
<behaviors> element• elements that define the behaviors for a service or endpoint
<behaviors><serviceBehaviors>
<behavior name="OfferManagerServiceBehavior"><serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true"/>
</behavior></serviceBehaviors>
<endpointBehaviors><behavior name="myBehavior">
<callbackDebug includeExceptionDetailInFaults="true" />
</behavior></endpointBehaviors>
</behaviors>[This section is optional]
8
Demo• Open Visual Studio and create a new WCF project
• Edit the Web.Config file and remove all the <system.serviceModel> section• Right click on the created SVC and select « View in browser »
• It will work!
9
WCFConfiguration Editor
10
WCFConfiguration Editor
11
Major Sections of the Configuration File-- Client Side --
• At Betclic, no client side service configuration is needed because we’re using a PeerToPeer WCF library based on a service directory. Client side code looks like that one:
IAlertServices srv = Locator.GetProxy<IAlertServices>();
• But if you need a client side configuration, just use: the WCFConfigurator Editor!
(turn the page to see how)
12
WCFConfiguration Editor – Client configuration - Demo
• Open Visual Studio and create an empty web application
• Edit the Web.Config file with the WCFConfigurator editor (see slide#9)
• On the left pane (Config) Select « Client » and click on « Create a new client…»
• Choose the manual creation mode and select the service assembly from which you want to create a client
• Go through the wizard and you should have the right configuration in your Web.Config file!
13
Links
• Configuring Services Using Configuration Files• Configuring Bindings for WCF Services• System-Provided Bindings• Simplified Configuration• Choosing a Transport
• Our WCF Training (By Cybermaxs)
We want our Sports betting, Poker, Horse racing and Casino & Games brands to be easy to use for every gamer around the world. Code with us to make that happen.
Look at all the challenges we offer HERE
We’re hiring !
Check our Employer Page
Follow us on LinkedIn
About Us• Betclic Everest Group, one of the world leaders in online
gaming, has a unique portfolio comprising various complementary international brands: Betclic, Everest, Bet-at-home.com, Expekt, Monte-Carlo Casino…
• Through our brands, Betclic Everest Group places expertise, technological know-how and security at the heart of our strategy to deliver an on-line gaming offer attuned to the passion of our players. We want our brands to be easy to use for every gamer around the world. We’re building our company to make that happen.
• Active in 100 countries with more than 12 million customers worldwide, the Group is committed to promoting secure and responsible gaming and is a member of several international professional associations including the EGBA (European Gaming and Betting Association) and the ESSA (European Sports Security Association).
top related