8. Client Service Message Address Binding Contract (Where) (How) (What) Endpoints Endpoint A B C A B C A B C
9.
10.
11.
12. Read blog! Follow me! Mail me! @andriybuday http://andriybuday.com/ [email_address]
13.
14.
15. Standard Bindings Binding Interop Security Session TX Duplex BasicHttpBinding BP 1.1 N, T N N n/a WSHttpBinding WS M , T, X N , T, RS N , Yes n/a WSDualHttpBinding WS M RS N , Yes Yes WSFederationBinding Federation M N , RS N , Yes No NetTcpBinding .NET T , M T ,RS N , Yes Yes NetNamedPipeBinding .NET T T , N N , Yes Yes NetPeerTcpBinding Peer T N N Yes NetMsmqBinding .NET T , M, X N N , Yes No MsmqIntegrationBinding MSMQ T N N , Yes n/a
16.
Notas del editor
1980s - Object Oriented 1990s – Component Based (dynamic loading) 2000s – Service Oriented (doing messages.. That is when we think about distributed envirountemnt) WCF – is unified framework for building service oriented applications. Windows Communication Framework – what the HECK does that mean? WCF, WPF, WF, Microsoft’s merry-go-round of acronyms seems to have experienced exponential growth with the releases of 3.0 and 3.5. Is it all just marketing hype? Fortunately, no! WCF was first released in 3.0, and lives in its most current form in 3.5. WCF puts a wide swath of .NET service technologies all under the same roof. Windows Communication Framework utilizes declarative and configuration-driven programming to enable you to define multiple endpoints against the same code. In a lot of ways, it is very much a hybrid of legacy ASMX, WSE, Web Service Enhancements and remoting all in one. Juval Lowy very rightly describes WCF as “plumbing,” and as “an SDK for developing and deploying services on Windows.”
Replaces ASMX services. Web Services Enhancements ( WSE ) is an add-on to the Microsoft .NET Framework which includes a set of classes that implement additional WS-* Web service specifications chiefly in areas such as security, reliable messaging, and sending attachments. [1] Web Services are business logic components which provide functionality via the Internet using standard protocols such as HTTP. Web services communicate via either SOAP or REST messages. WSE provides extensions to the SOAP protocol and allows the definition of custom security, reliable messaging, policy, etc. All the COM+ services that are available today are available to .NET and COM objects. Some of these services include, transactions, object pooling and construction strings, JIT, synchronization, role-based security, CRM and BYOT.
TodoItem Content Priority IsDone DateTimeSent ITodoService Void SubmitTodo(TodoItem) List<TodoItem> GetTodoItems(); Void RemoveTodo(string id); [ServiceBehaviour(… InstanceContextMode] TodoService Endpoint Change first endpoint Talk on Metadata endpoint Talk on testing tool wcftestclient Time for me [13]
What is Endpoint. Take a look on existing configuraiton. Address, Binding, Contract Address – is where should we talk to our service – the actual network address Binding – how should we communication (transport protocol, wc…) Contract – what the service should contain… Talk more on the mex binding!!! Base address … Press F5 and talk where from metadata is downloaded and more on test client, what does it have etc.. Change base address to localhost:8080/todoservice Change the address for the first endpoint (ws) Add new endpoint basic basicHttpBinding ---- is basic SOAP interactions Contract is the same! Show how to add enpoint through the wisard TCP // evalservice New one: NamedPipes.. – is for the same machine!! Show config once again! Show the client and how it differs now I can simply choose! show from one, then from another HIGLIGHT that this is the main key feature of the WCF! you don’t need to rewrite your code once again Time [12]
IIS hosting - new WCF site - delete existing services - add reference - rename svc file - specify TodoServiceLibrary.TodoService and don’t need code behind it - Configure our web.config - change name of the service - reconfigure to use ITodoService - IIS version plays role - view in browser for svc file May show loading metadata from the IIS hosted application Map directory the the site’s directory! Hosting in Win Service! ServiceHost host … typeof(TodoService) host.Start(), host.Close() serviceMetadata httpGetEnabled = true Create installer, change User account to LocalSystem build project ? wsdl