Download presentation
Presentation is loading. Please wait.
2
Service Model Programming Model
3
Only WCF Services can leverage AppFabric
4
Define service Host in AppFabric Test with WCF Test Client
5
Define service contract and entities Implement service Configure service Host in IIS & AppFabric Test with WCF Test Client
6
Host (IIS | AppFabric ) Service Configuration (web.config) Service Endpoint Address (http://localhost/MyCalc.svc) Binding(basicHttp) Service Contract (ICalculator) Host Service Implementation Service Contract Data Contract Service Endpoint (Address, Binding Contract) Service Behavior Key Service Concepts Service Contract (ICalculator) Operations (signatures) double Add(double a, double b) double GetArea(Rectangle r) Operations (signatures) double Add(double a, double b) double GetArea(Rectangle r) Service Implementation (MyCalc: ICalculator) Operations (implementation) double Add(double a, double b) double GetArea(Rectangle r) Operations (implementation) double Add(double a, double b) double GetArea(Rectangle r) Service Behaviors (Metadata) Data Contract Rectangle double width, double height Rectangle double width, double height
9
Create Client App Add Reference to Data Contract Assemblies (optional) Add Service Reference Instantiate Proxy Call Methods on Proxy
10
Proxy Endpoints Messages Service Instance Key Client Concepts Client Service Instance Proxy Instance (MyCalcClient) Client Configuration (app.config) Client Endpoint Address (http://localhost/MyCalc.svc) Binding(basicHttp) Service Contract (ICalculator) proxy.Add(5,2 ) Send Message Add(5,2) Receive Message 7
11
11
14
Tracked Events Normal Operation: ServiceHost events Aggregates for Operations Completed Calls Troubleshooting: Throttling Service Exceptions User Defined Errors Failed Calls Faulted Calls 14
15
15
16
16
18
DiagnosticSection config = (DiagnosticSection) WebConfigurationManager.GetSection("system.serviceModel/diagnostics"); providerId = new Guid(config.EtwProviderId); myEventProvider = new EventProvider(providerId); errorDescriptor = new EventDescriptor(ErrorEventId, Version, Channel, ErrorLevel, Opcode, Task, Keywords); myEventProvider.WriteEvent(ref errorDescriptor, title, serviceName, errorMessage); error event id's 301,302,303 mean error, warning, info respectively WCFUserEventProvider eventWriter = new WCFUserEventProvider(); eventWriter.WriteErrorEvent(“AddOperation”, “An error occurred.”);
20
Introducing WCF Services
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.