wcf configuration - the basics
DESCRIPTION
This presentation describes the most common WCF configuration sections and how they are organizedTRANSCRIPT
![Page 1: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/1.jpg)
2014
WCF ConfigurationThe basics
![Page 2: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/2.jpg)
2
The most important thing to remember about WCF services is just as simple as…
![Page 3: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/3.jpg)
3
Address: Service’s URI
Binding: Specifies transports (HTTP, TCP …) and protocols (Security, Reliability …)
Contract: Interface that defines the contract
![Page 4: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/4.jpg)
4
Major Sections of the Configuration File-- Server Side --
<configuration> <system.serviceModel> <services>
<endpoint></endpoint>
</services><bindings>
</bindings><behaviors>
</behaviors> </system.serviceModel></configuration>
![Page 5: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/5.jpg)
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]
![Page 6: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/6.jpg)
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]
![Page 7: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/7.jpg)
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]
![Page 8: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/8.jpg)
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!
![Page 9: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/9.jpg)
9
WCFConfiguration Editor
![Page 10: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/10.jpg)
10
WCFConfiguration Editor
![Page 11: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/11.jpg)
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)
![Page 12: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/12.jpg)
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!
![Page 13: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/13.jpg)
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)
![Page 15: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/15.jpg)
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
![Page 16: WCF Configuration - The basics](https://reader035.vdocuments.site/reader035/viewer/2022062405/554f889cb4c905435d8b4d0a/html5/thumbnails/16.jpg)
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).