3. Agenda
o Problem Statement
o Windows Communication Foundation (WCF)
o Comparison of WCF and ASMX
o Advantages of WCF over ASMX
o WCF in Restaurant Management System (FYP)
4. Windows Phone and Storage
Windows Phone
SQL Server Database
Direct Communication
Problem … How ?
Problem Statement
6. Windows Communication Foundation (WCF)
Web Service ASMX
WSE
Messaging Enterprise Service
Remoting WCF Services
Framework
All Technologies Into ONE
7. WCF Trends
WCF
ASP.net WS / ASMX
WCF service has increasingly gain its popularity after being
introduced in .Net Framework 3.0 in year 2006.
8. WCF Design Goals
Productive
Programming
Unification of
Technologies
Service-Oriented
Application
Common Programming Model
Combinations of ASMX, MSMQ, WSE, COM+, Remoting
into single technology that fulfill multiple requirements
Interoperability
Web Service allow loose-coupled application
interoperate in different programming language and
system platform
Efficient Development
Doesn’t need to learn different technology one by one.
Minimum complexity and high productivity development.
Service-Oriented
Application
Productive
Programming
Unification of
Technologies
9. Why need WCF
Why not we learn one technology to meet all different communication requirements ?
11. Important Terms in Endpoints
Address 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)
13. Comparison between WCF and ASMX
Serialization Protocol Hosting
WCF and ASMX has been different in many features include
hosting, protocols, bindings, serialization. encoding, web
methods, data contracts, messaging, security, performance, and
exception handling. However, the main differences are:
Security
DataContractSerializer in
WCF has a better
performance than
XMLSerializer used in ASMX.
ASMX limited to HTTP protocol
only but WCF supports protocols
such as HTTP, TCP, Named
Pipes, MSMQ
ASMX can only be hosted in IIS
but WCF can be hosted in IIS,
WAS, self-hosting and Managed
Windows Service
Security setting in ASMX is
limited. WCF support WSE
that offer message layer
security instead than
transport layer.
14. Advantages of WCF
Productivity
Performance
Troubleshootin
g
Security
Enhanced Productivity
ASMX Web Service technology are solely build for web services while
WCF is the newer technology that combines many communication
technologies into one
WCF allow service oriented application development in:
Lesser Time – no need to learn different technologies
Low Complexity - programming technique are similar,
minor changes to meet different
technologies requirements.
17. Advantages of WCF
Productivity
Performance
Troubleshootin
g
Security
Better Security and Reliable Communication
The support of WSE (Web Service Enhancement) in WCF allow both
transport and message layer security, In WCF, all the bindings except
basicHttpBindings are secured by default.
Message layer provides end-to-end security
Transport layer provides point-to-point security
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 ASP.net 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.