Web services allow applications to communicate over the web through XML. Windows Communication Foundation (WCF) and Web API both enable building web services, but WCF focuses on interoperability across protocols while Web API is ideal for building RESTful services compatible with browsers and devices. WCF supports features like transactions and reliability but requires defining bindings, while Web API is simpler and uses HTTP verbs for CRUD actions. The choice depends on requirements for interoperability versus a RESTful approach.
2. WHAT IS WEB SERVICES?
Web services are XML-based information exchange
systems that use the Internet for direct application-
to-application interaction.
3. WHY WEB SERVICES ?
Exposing the Existing Function on the network
Interoperability
Standardized Protocol
Low Cost Communication
Reusability
5. There are three distinct roles as given below.
1. Provider - The provider creates the web service and makes it available to
client application who want to use it.
2. Requestor - A requestor is nothing but the client application that needs to
contact a web service. The client application can be a .Net, Java, or any
other language based application which looks for some sort of functionality
via a web service.
3. Broker - The broker is nothing but the application which provides access
to the UDDI(Universal description ,discovery and integration).
i. Publish - A provider informs the broker (service registry) about the
existence of the web service by using the broker's publish interface to
make the service accessible to clients
ii. Find - The requestor consults the broker to locate a published web
service.
iii. Bind - With the information it gained from the broker(service registry)
about the web service, the requestor is able to bind, or invoke, the web
service.
6. WCF is stand for Windows Communication Foundation. which means
interoperability. It used create a distributed and interoperable Application.
Distributed Application
Interoperable
Protocols
Hosting Mechanisms
In Web Service ,we need to create two different Services for two
different clients and WCF create one single service can be
consumed by two different clients- either they want same protocol
or a different protocol.
7.
8. BasicHttpBinding
•It is suitable for communicating with ASP.NET Web services (ASMX)-based services
that comfort with WS-Basic Profile conformant Web services.
•This binding uses HTTP as the transport and text/XML as the default message
encoding.
•Security is disabled by default
•This binding does not support WS-* functionalities like WS- Addressing, WS-Security,
WS-ReliableMessaging
•It is fairly weak on interoperability.
WSHttpBinding
•Defines a secure, reliable, interoperable binding suitable for non-duplex service
contracts.
•It offers lot more functionality in the area of interoperability.
•It supports WS-* functionality and distributed transactions with reliable and secure
sessions using SOAP security.
•It uses HTTP and HTTPS transport for communication.
Reliable sessions are disabled by default.
Note : Web Service security use for XML signature and XML encryption. It is an
extension to SOAP to apply security to web services.
9. WSDualHttpBinding
•This binding is same as that of WSHttpBinding, except it supports duplex service. Duplex
service is a service which uses duplex message pattern, which allows service to
communicate with client via callback.
•In WSDualHttpBinding reliable sessions are enabled by default. It also supports
communication via SOAP intermediaries.
WSFederationHttpBinding
•This binding support federated security. It helps implementing federation which is the ability
to flow and share identities across multiple enterprises or trust domains for authentication
and authorization. It supports WS-Federation protocol.
NetTcpBinding
•This binding provides secure and reliable binding environment for .Net to .Net cross
machine communication. By default it creates communication stack using WS-
ReliableMessaging protocol for reliability, TCP for message delivery and windows security
for message and authentication at run time. It uses TCP protocol and provides support for
security, transaction and reliability
10. NetMsmqBinding
•This binding provides secure and reliable queued communication for cross-machine
environment.
•Queuing is provided by using MSMQ as transport.
•It enables for disconnected operations, failure isolation and load leveling.
NetPeerTcpBinding
•This binding provides secure binding for peer-to-peer environment and network
applications.
•It uses TCP protocol for communication
•It provides full support for SOAP security, transaction and reliability.
11. WEB API
ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a
broad range of clients, including browsers and mobile devices. It is an ideal platform for
building RESTful applications on the .NET Framework.
12. • an ideal platform for building RESTful services.
• Web API can be hosted in IIS, Self-hosted or other web server that supports
.NET 4.0+.
• ASP.NET Web API supports different formats of response data. Built-in
support for JSON, XML, BSON format.
• Web API can be hosted with in the application or on IIS.
To expose our service data to the browser and as well as all these modern
devices apps in fast and simple way, you should have an API which is
compatible with browsers and all these devices.
It supports convention-based CRUD Actions since it works with HTTP verbs
GET,POST,PUT and DELETE.
It is only based on HTTP and easy to define, expose and consume in a
REST-ful way.