Windows Communication Foundation (WCF) Service


Published on

WCF Concepts

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • WS can be used to connect – by consuming all functions and operations expose to access the data – two choices – WCF - two reasons
  • What is WCF – before existent – different roles for diff technologies – develop diff solutions to use diff technologies – WCF different – powerful – grouping into one
  • Using ASMX and WSE, you can build powerful and interoperable service-oriented applications with Web services and Web service clients that allow for cross-platform interoperability and integration, and relatively easy service evolution and versioning strategies through loose coupling. With MSMQ you have a powerful mechanism for scalable, durable and volatile, queued messaging that takes care of getting data reliably from one place to the next. Enterprise Services provides transaction integration across multiple parties performing related work in a distributed environment, allows throttling access to limited, shared resources, allows pooling of object instances to optimize access to expensive-to-initialize resources, features a publish/subscribe mechanism for events, has a rich security model, and sits on top of a proven, platform-integrated, secure, and fast transport. Last but not least, Remoting is the Common Language Runtime (CLR) integrated mechanism for communicating with objects across application domain boundaries and is loved for its very flexible extensibility model, which lets developers rip and replace transports, proxy mechanisms and the way communication channels behave.
  • Based on the Google Analysis Report, WCF service has increasingly gains its popularity after being introduced in .Net Framework 3.0 in year 2006. and as shown in the graph here, the trends of using WCF is still increasing while the trends of Web Service / ASMX going down. Trends of WCF – increasingly gain popularity – WCF is still increasing – ASMX goin down – reason in next slide
  • Why we need WCF ?- instead of learning each- focus on one – all comm possible in one solution
  • "A" stands for Address: Where is the service?"B" stands for Binding: How do I talk to the service?"C" stands for Contract: What can the service do for me?(http://sjlim:34421/Service.svc)(basicHttpBinding)(WCFService.ServiceInterface)
  • XMLSerializerin ASMX translate every data field that set as public into XML whileDataContractSerializer in WCF allow programmer to explicit define which data member to be translated into XML. WCF has better performance as programmer can specific which data they want serialize instead of serialize everything in ASMXa. Only public fields or properties of the .NET types can be translated to Xml.b. Only the classes that implement IEnumerable can be translated.c. Classes that implement IDictionary, such as Hashtable cannot be serialized.ASMX limited to HTTP and work in stateless environment. Because of the stateless nature of the HTTP protocol a web server considers every request as a new one. This means that, if you want to track a series of related calls, you must establish a way of identifying if the current request is a new request or is related to another request.serialization is a process of converting object into steam of data contained XML to allow it to be transmittable over the Internet. DataContractSerializer in WCF has a better performance than XMLSerializer used in ASMX. The reasons is because in WCF, we can explicit specify which data field to be serialized instead of serialized everything in ASMX.Protocol support, ASMX limited to HTTP but WCF support HTTP, TCP, Named Pipe, MSMQ. Multiple protocol supported by WCF has allow one WCF Service can have multiple hosts for different communicationhosting options. ASMX can only be hosted in IIS but WCF can be hosted in IIS, WAS, self-hosting and Managed Windows Service.Developer can have much options in hosting selection based on the application scenario and hosting benefitsSecurity. setting in ASMX is limited. WCF support WSE that offer message layer security instead than transport layer. Message layer is important for security will be discuss in the advantages of WCF later.
  • Windows Process Activation Service
  • Normally, authentication and authorization in Web Service is done at IIS and transport layer only, which mean the message are being secured from point-to-point, message are not being secured when it reach the communication intermediaries (such as router) before the final receiver of message. WCF, WS-enhancement allow both transport and message layer security, mean message are being secured from one end to the another end rather than point to point. Thus, WCF offer better security and reliable communication.
  • To conclude, WCF is the most suitable technology that suit such scenario to develop Online Restaurant Management System that simplify the development effort, may be in future, we can access the same service using different mobile platform. And significantly, WCF has a better throughput performance.
  • Windows Communication Foundation (WCF) Service

    1. 1. AIA Group F5Restaurant SystemPresenterTwitter#SJLIM4SJ.Lim4@Facebook.comSJ5677@Gmail.comLim Sau Jian
    2. 2. Windows Communication
    3. 3. Agendao Problem Statemento Windows Communication Foundation (WCF)o Comparison of WCF and ASMXo Advantages of WCF over ASMXo WCF in Restaurant Management System (FYP)
    4. 4. Windows Phone and StorageWindows PhoneSQL Server DatabaseDirect CommunicationProblem … How ?Problem Statement
    5. 5. BluetoothSocketsVoIPProximity (NFC)Problem StatementCommunication Technologies in WindowsPhoneWeb ServiceData Sense WCF Service ASMX Web Service
    6. 6. Windows Communication Foundation (WCF)Web Service ASMXWSEMessaging Enterprise ServiceRemoting WCF ServicesFrameworkAll Technologies Into ONE
    7. 7. WCF WS / ASMXWCF service has increasingly gain its popularity after beingintroduced in .Net Framework 3.0 in year 2006.
    8. 8. WCF Design GoalsProductiveProgrammingUnification ofTechnologiesService-OrientedApplicationCommon Programming ModelCombinations of ASMX, MSMQ, WSE, COM+, Remotinginto single technology that fulfill multiple requirementsInteroperabilityWeb Service allow loose-coupled applicationinteroperate in different programming language andsystem platformEfficient DevelopmentDoesn’t need to learn different technology one by one.Minimum complexity and high productivity development.Service-OrientedApplicationProductiveProgrammingUnification ofTechnologies
    9. 9. Why need WCFWhy not we learn one technology to meet all different communication requirements ?
    10. 10. WCF Communication ModelsAll communications with WCF Servicewill happen via endpoints
    11. 11. Important Terms in EndpointsAddress define location where service is available (http://sjlim:34421/Service.svc)Bindings define how services is communicate (basicHttpBinding)Contract specify what the services and operations available. (WCFService.ServiceInterface)
    12. 12. ServiceWCFvs.ASMX
    13. 13. Comparison between WCF and ASMXSerialization Protocol HostingWCF and ASMX has been different in many features includehosting, protocols, bindings, serialization. encoding, webmethods, data contracts, messaging, security, performance, andexception handling. However, the main differences are:SecurityDataContractSerializer inWCF has a betterperformance thanXMLSerializer used in ASMX.ASMX limited to HTTP protocolonly but WCF supports protocolssuch as HTTP, TCP, NamedPipes, MSMQASMX can only be hosted in IISbut WCF can be hosted in IIS,WAS, self-hosting and ManagedWindows ServiceSecurity setting in ASMX islimited. WCF support WSEthat offer message layersecurity instead thantransport layer.
    14. 14. Advantages of WCFProductivityPerformanceTroubleshootingSecurityEnhanced ProductivityASMX Web Service technology are solely build for web services whileWCF is the newer technology that combines many communicationtechnologies into oneWCF allow service oriented application development in:Lesser Time – no need to learn different technologiesLow Complexity - programming technique are similar,minor changes to meet differenttechnologies requirements.
    15. 15. Advantages of WCFProductivityPerformanceTroubleshootingSecurityBetter PerformanceWCF is about 25-50% faster than AXMS. Better performance due to theuse of DataContractSerializer
    16. 16. Advantages of WCFProductivityPerformanceTroubleshootingSecurityEffective TroubleshootingWCF provides many troubleshooting features to developer. Each of thetroubleshooting can be simply enable at app.config or web.config toallow developer to interpret any error occur during runtime.
    17. 17. Advantages of WCFProductivityPerformanceTroubleshootingSecurityBetter Security and Reliable CommunicationThe support of WSE (Web Service Enhancement) in WCF allow bothtransport and message layer security, In WCF, all the bindings exceptbasicHttpBindings are secured by default.Message layer provides end-to-end securityTransport layer provides point-to-point security
    18. 18. Application to Project
    19. 19. ReasonsSimplify Development EffortInteroperability – Windows Phone, and future (Andriod, iPhone)Faster Performance
    20. 20. Thank you