Presentation is loading. Please wait.

Presentation is loading. Please wait.

WCF.

Similar presentations


Presentation on theme: "WCF."— Presentation transcript:

1 WCF

2 Overview of WCF Architecture

3 Service-Oriented Development with WCF

4 Sending a WCF Message

5 The ABC of Endpoints

6 Endpoint sandara Address Binding Contract (kur) Transport (kaip)
Encoding Security Contract (ką) ServiceContract OperationContract DataContract

7 Structure of a Service

8 A Unified Programming Model

9 Communicating with Non-WCF Services

10 Using a Language-Level Interface As a Service Contract

11 Example of a Simple Contract

12 The ServiceContract Attribute

13 The OperationContract Attribute

14 Data and Messages

15 Contracts, Metadata, and Artifacts

16 Implementing a Simple WCF Service in Visual Studio 2008

17 Defining the Service Contract and Service Class

18 Hosting the Service

19 Configuring the Service

20 Demonstration: Creating a Simple Bank Service

21 Consuming a Simple WCF Service in Visual Studio 2008

22 Importing the Metadata

23 Calling the Service by Using the Proxy

24 Demonstration: Calling the Simple Bank Service

25 Productivity Using Visual Studio .NET 2003
class HelloService { [WebMethod] public String Hello(String Greeting) { X509CertificateCollection collection = new X509CertificateCollection(); IntPtr blob = Marshal.AllocHGlobal(Marshal.SizeOf( typeof(CRYPTOAPI_BLOB))); IntPtr data = (IntPtr)((int)blob + Marshal.SizeOf(typeof(CRYPTOAPI_BLOB))); SeqAckRange range = new SeqAcknRange(id, low, high ); SeqAckRange[] ranges = { range }; ReliableQueue.ProcessAcks( ranges ); BeginTransaction (NULL, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, &pITransaction); return Greeting; } 20,379 lines security 5,988 lines reliable messaging 25,507 lines transactions 4,442 lines infrastructure Total lines 56,296

26 Productivity Using Visual Studio .NET 2003 and WSE
class HelloService { [WebMethod] public String Hello(String Greeting) { foreach ( SecurityToken tok in requestContext.Security.Tokens { X509SecurityToken token = tok as X509SecToken } SeqAckRange range = new SeqAcknRange(id,low,high ); SeqAckRange[] ranges = { range }; ReliableQueue.ProcessAcks( ranges ); BeginTransaction (NULL, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, &pITransaction); return Greeting; 10 lines security 1,804 lines reliable messaging 25,507 lines transactions Total lines 27,321

27 Productivity Using Visual Studio 2005 and WCF
[ServiceContract] class HelloService { [OperationContract] [PrincipalPermission(SecurityAction.Demand, Role = “Adminstrators")] [TransactionFlow(TransactionFlowOption.Mandatory)] [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] String Hello(String Greeting) {return Greeting;} } <bindings> <wsHttpBinding> <binding name="Binding1“ transactionFlow="true"> <security mode="Message"> <message clientCredentialType="Windows“/> </security> <reliableSession enabled="true" /> </binding> </wsHttpBinding> </bindings> 1 code + 2 config (elem.) security 0 code + 1 config (elem.) reliable messaging 2 code + 1 config (attr.) transactions Total lines: 3 code (what) + 4 config (how)

28 WCF bindings Binding Class Name Transport Message Encoding
Message Version Security Mode RM Tx Flow* BasicHttpBinding HTTP Text SOAP 1.1 None X WSHttpBinding SOAP 1.2 WS-A 1.0 Message Disabled WS-AT NetTcpBinding TCP Binary SOAP 1.2 OleTx NetNamedPipes- Binding Named Pipes NetMsmqBinding MSMQ CustomBinding You decide Notes: X = Not Supported, WS-A = WS-Addressing, WS-AT = WS-AtomicTransactions, OleTx = OleTransactions * Transaction flow is always disabled by default, but when you enable it, these are the default protocols


Download ppt "WCF."

Similar presentations


Ads by Google