480 likes | 647 Views
http://debugmode.net. DEBUGMODE_. Introducing WCF. Dhananjay Kumar. From Objects to Services. Object-Oriented. Polymorphism Encapsulation Subclassing. 1980s. Component-Based. Interface-based Dynamic Loading Runtime Metadata. 1990s. Service-Oriented. Message-based Schema+Contract
E N D
http://debugmode.net DEBUGMODE_ Introducing WCF Dhananjay Kumar
From Objects to Services Object-Oriented Polymorphism Encapsulation Subclassing 1980s Component-Based Interface-based Dynamic Loading Runtime Metadata 1990s Service-Oriented Message-based Schema+Contract Binding via Policy 2000s
WCF Unified framework for rapidly building service-oriented applications
WCF Microsoft Innovation & Practice Team, MSCoE
Message Services and Clients Client Service Message
Endpoint Endpoint Endpoint Endpoints Client Service Message
End Points Microsoft Innovation & Practice Team, MSCoE
C C C B B B A A A A+B+C Client Service Message Address Binding Contract (Where) (How) (What)
Address (A) Every service is associated with a unique address.
Binding (B) basicHttpBinding
Binding (B) wsHttpBinding
Binding (B) wsFederationHttpBinding
Binding (B) webHttpBinding
Binding (B) wsDualHttpBinding
Binding (B) netTCPBinding
Binding (B) netNamedPipeBinding
Binding (B) netMSMQBinding
Binding (B) netPeerTCPBinding
Binding (B) basicHttpContextBinding
Binding (B) Choosing Binding WCF To WCF No Yes Disconnected Calls No Yes Legacy ASMX Cross Machine No Yes No Yes WS Basic IPC TCP MSMQ
Binding (B) Binding Classes
Binding (B) Configuring Binding <endpoint address="Calculator" bindingSectionName="basicProfileBinding" bindingConfiguration="Binding1" contractType="ICalculator" /> <bindings> <basicProfileBinding> <binding configurationName="Binding1" hostnameComparisonMode="StrongWildcard" transferTimeout="00:10:00" maxMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" </binding></basicProfileBinding></bindings>
Contract (C) Types of Contracts 31
Contract (C) Service Contract
Contract (C) Service Contract
Contract (C) Service Contract
Contract (C) Data Contract
Contract (C) Data Contract
Contract (C) Data Contract
Contract (C) Message Contract
Contract (C) Fault Contract
Defining Endpoints <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.serviceModel> <services> <service serviceType="CalculatorService"> <endpoint address="Calculator" bindingSectionName="basicProfileBinding" contractType="ICalculator" /> </service> </services> </system.serviceModel> </configuration>
Multiple End Point • <endpointaddress="http://localhost:8890/a" binding="wsHttpBinding" contract="HotsingSamples.IService1"/> • <endpointaddress="http://localhost:8000/b" binding="basicHttpBinding" contract="HotsingSamples.IService1"/> • <endpointaddress="net.tcp://localhost:8001/c" binding="netTcpBinding" contract="HotsingSamples.IService1"/>
Creating WCF Service Defining .Net service interface to serve as the Service contract Implement Service Contract in .Net class as Service type and configure its behavior Configure the End Point where service will expose , by specifying A,B,C Host Service type in application using WCF hosting infrastructure At client side ,By using description of target End Point create PROXY. And write code against this Proxy.
Transport Encoder Protocol(s) Transport Encoder Protocol(s) Architecture: Messaging Runtime Service Contract andBehaviors Client Dispatcher Binding Address
http://dhananjaykumar.net DEBUGMODE_ Q & A Dhananjay Kumar