View
225
Download
0
Tags:
Embed Size (px)
Citation preview
Service Model
Programming Model
Only WCF Services can leverage AppFabric
Service Configuration (web.config)Service Configuration (web.config)
Service EndpointService Endpoint
Address (http://localhost/MyCalc.svc)Address (http://localhost/MyCalc.svc)
Binding(basicHttp)Binding(basicHttp)
Service Contract (ICalculator)Service Contract (ICalculator)
•Host
•Service Implementation
•Service Contract
•Data Contract
•Service Endpoint (Address, Binding Contract)
•Service Behavior
Key Service Key Service ConceptsConcepts
Service Contract (ICalculator)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)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)Service Behaviors (Metadata)
Data ContractData Contract
Rectangle double width, double height
Rectangle double width, double height
•Proxy
•Endpoints
•Messages
•Service Instance
Key Client Key Client ConceptsConcepts
Service InstanceService Instance
Proxy Instance (MyCalcClient)Proxy Instance (MyCalcClient)
Client Configuration (app.config)Client Configuration (app.config)
Client EndpointClient Endpoint
Address (http://localhost/MyCalc.svc)Address (http://localhost/MyCalc.svc)
Binding(basicHttp)Binding(basicHttp)
Service Contract (ICalculator)Service Contract (ICalculator)
proxy.Add(5,
2)proxy.Add(5,
2)
Add(5,2) 7
11
Tracked Events
Normal
Operation:
ServiceHost events
Aggregates for
Operations
Completed Calls
Troubleshooting:
Throttling
Service Exceptions
User Defined Errors
Failed Calls
Faulted Calls14
15
16
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
error event id's 301,302,303 mean error, warning, info respectively
WCFUserEventProvider eventWriter = new WCFUserEventProvider();eventWriter.WriteErrorEvent(“AddOperation”, “An error occurred.”);
Introducing WCF Services