Diving Into Services

1,029 views

Published on

WCF Presentation for the St Louis .NET User Group - May 2009

Published in: Technology
1 Comment
1 Like
Statistics
Notes
  • Hey

    thanks for posting this!!! I was at the user's group last month and this was a great presentation you gave.

    tk
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
1,029
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
37
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Diving Into Services

  1. 1. Diving Into Services With WCF Chris Deweese
  2. 2. Announcements / Contact Chris • Twitter: @cdeweese • Web: http://christopherDeweese.com • From IL? See me about an IL Metro .NET Users Group • St Louis Day of .NET August 28-29 @Ameristar in St Charles
  3. 3. Agenda • Part 1 – WCF Basics ▫ What & Why of WCF ▫ Key Concepts ▫ WCF Architecture ▫ ABCs of WCF ▫ Code! And Demo • Part 2 – Advanced WCF ▫ Business Case ▫ Architecture ▫ Code! And Demo
  4. 4. What is WCF • Framework for building service-oriented applications • Separates the logic of services from the channels they communicate on • Messages based on Simple Object Access Protocol (SOAP) • Support for REST & Plain-old Xml (POX) as of .NET 3.5
  5. 5. Why WCF • Evolution of service oriented thinking • Remoting, Message Queuing, and ASMX were designed on different stacks • WCF unifies the programming model for exposing services through different channels (Web, Message Queues, TCP) ▫ Service logic and function is not dependent on the channel or transport
  6. 6. Key WCF Concepts • Service – Unit of work exposed to the world. • Endpoint – the collection of the services address, binding, and contract. • Binding – How you interact with the service at the wire level. • Channel – Picks the message up from the wire format and brings it into the WCF stack. • Dispatcher – Manages execution of service code by routing messages to the appropriate service instance and method. • Behavior – How you can control the local execution of a service.
  7. 7. Hosting WCF Services • In Process • Windows Service • Web Service (IIS) • Windows Activation Services ▫ WAS allows you to host a service on any binding
  8. 8. WCF Architecture
  9. 9. ABC’s of WCF
  10. 10. Address • “Dude where’s my service?” • The location of the service on the network where it can be reached. ▫ http://localhost/wantedperson/v1/wanted.svc ▫ net.msmq://localhost/private/wantedpersonv1 ▫ net.tcp://localhost:6000/wantedpersonv1 • Set via configuration or through code
  11. 11. Binding • “How do I talk to this thing?” • The protocol and policies used to connect to the service at it’s address. • WCF Provided Bindings ▫ Http(BasicHttp, WsHttp, WsDualHttp, WsFederation) ▫ NetMsmq ▫ MsmqIntegration ▫ NetNamedPipe ▫ NetTcp ▫ NetPeerTcp • Set via configuration or through code
  12. 12. Contract • “What’s it going to do for me?” • Defines the operations, inputs, outputs, and message exchange patterns of the service. • Defined using an Interface; wired into WCF by using the ServiceContract attribute. Methods use the OperationContract attribute. Classes use the DataContract attribute and members use the DataMember attribute. • WCF Serialization is “Opt-In”
  13. 13. WCF Basics – Demo and Code!
  14. 14. Photo by szeke: http://www.flickr.com/photos/pedrosz/
  15. 15. Part II: Advanced WCF
  16. 16. Concepts Demonstrated • Tracing • Fault Contracts • Multiple Endpoints • Custom Service Host • Custom Service Behavior ▫ Unity Integration for Inversion of Control ▫ Unity Lifetime Manager (Singleton) • Service Instancing Behavior • Enterprise Library Exception Handling Integration
  17. 17. WCF Advanced – Demo and Code!
  18. 18. Questions?

×