1 / 33

Web Services? We don’t need no stinking web server

Web Services? We don’t need no stinking web server. Barry Dorrans Charteris plc http://idunno.org. About the Speaker (the ego slide). MVP – Visual Tools, Security Senior Technologist @ Charteris plc barryd@idunno.org. Agenda. What is WCF? WCF versus Remoting

ita
Download Presentation

Web Services? We don’t need no stinking web server

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Services?We don’t need no stinking web server Barry Dorrans Charteris plc http://idunno.org

  2. About the Speaker(the ego slide) MVP – Visual Tools, Security Senior Technologist @ Charteris plc barryd@idunno.org

  3. Agenda What is WCF? WCF versus Remoting SOA, services, interfaces, oh my! Prove it smarty pants

  4. What is WCF? Indigo Remoting, Web Services, WSE Interoperability

  5. WCF versus RemotingWCF Plus Points Services require less permissions Binary messages are smaller/faster Versioning is easier

  6. WCF versus RemotingRemoting Plus Points Sharing code between client and server is easier

  7. WCF versus RemotingTwo Way Communication Callback Contract;Publish & Subscribe

  8. SOA, services, interfaces, oh my! WCF is an SOA approach Contract first, service and data SOAP or binary messages

  9. The ABCs of WCF Address Binding Contract

  10. Client Server Messaging Layer Endpoint Service Model Address Binding Channel Behaviour Behaviour Contract Binding Binding Channel Behaviour Behaviour Factory Listener Channel Address Address Channel *

  11. Address scheme:// <machineName>[:port]/path http://localhost:8080/Account/ net.tcp://localhost:8080/Account

  12. Binding Defines how you communicate with a service A service may have multiple bindings Defines the shape; security, transactions etc.

  13. Contract The external interface Contracts for service, data and message Message Exchange Patterns

  14. Message Exchange Patterns Request-Reply One-Way Duplex

  15. Service Contracts [ServiceContract()] public interface IMyService { [OperationContract] string MyOperation1(string myValue); [OperationContract] string MyOperation2(MyDataContract value); }

  16. Data Contracts [DataContract] public class MyDataContract { string _stuff; [DataMember] public string Stuff { get { return _stuff; } set { stuff = value; } } }

  17. Why data contracts? Message body or Message Header Control over the order of members Required versus optional parameters

  18. Creating our first service library Cross your fingers.

  19. So what have we learned? Services hosted inside apps Service behaviour in config Barry can’t type under pressure.

  20. So what have we learned? We need data contracts Why? WCF exposes nothing by default

  21. What if we want to host in IIS? Well ….(cross your fingers again)

  22. What if we want to host in IE? Add a .svc file <%@ServiceHost Service="RumorServerLibrary.RumourServiceImpl" %> <%@Assembly Name="RumorServerLibrary" %>

  23. But you hard coded stuff! Behold the power of config

  24. So what have we learned? Config good, code bad We can have multiple endpoints

  25. Configuration Settings Service Configuration EditorProtocols must have their own base address

  26. One half of the story Let’s write a client(your fingers are still crossed, right?)

  27. So what have we learned? svcutil is our friend use the config files

  28. It’s all your fault Exceptions and errors.

  29. So what have we learned? Raw exceptions are not helpful Marshall everything to SOAP faults Strong SOAP faults rock my world

  30. And finally, duplex channels Two communication Remoting is dead.

  31. So what have we learned? Server defines callback interface Client implements Do not mark as [ServiceContract]Publish / Subscribe model

  32. Books WCF Step by Step – John Sharp; MS Press Pro WCF – Peiris & Mulder; A Press WCF Unleashed – McMurty et al; SAMS

  33. Web WCF Blogs : http://wcf.netfx3.com/blogs/ .net 3.0 WCF site : http://wcf.netfx3.com/ WCF Extensions for VS 2005: http://www.microsoft.com/downloads/details.aspx?familyid=F54F5537-CC86-4BF5-AE44-F5A1E805680D

More Related