Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
Technical Personnal Blog

Technical Personnal Blog

Technical Personnal Blog

Technical Personnal Blog

  • Tech
  • Blog
  • Open Source
  • VEGAS
  • CARD
  • Favorite Link
  • Shop
  • Cart
  • Checkout
  • My account
  • Tech
  • Blog
  • Open Source
  • VEGAS
  • CARD
  • Favorite Link
  • Shop
  • Cart
  • Checkout
  • My account
Close

Search

  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
Subscribe
BlogOpen SourceTech

Difference between Web Services , Web API , WCF

By techsupport
June 27, 2016 3 Min Read
Comments Off on Difference between Web Services , Web API , WCF

more…

First why we use this technologies?

If you have any logic and need to make it shared and compatible with any machines and any software you will need to put this logic or methods on the web or shared network and make results as XML or JSON to be compatible with different framework .

so you will need technologies such as  web service , web api , WCF  to make this

Web Services

used to make your logic code accessible over web and HTTP protocol.

web services use SOAP (Simple Object Access Protocol) that use HTTP + XML

web services return its result as XML (Extensible Markup Language) and can return JSON (JavaScript Object Notation) but common that return XML

web services is action-based model that mean web services contain action not related to specific object or resource for example web service contain method for Add two integer numbers and method for Add two complex numbers and method for multiply and so on all in one web services

commonly using web service in simplex communication (Server to Client ) not in half duplex or full duplex communication

to create Web service for example in . net create web service project and add your methods and decorated it [web method] attribute and to use it add web reference

web service use WSDL (web services Description Language) to describe web service and its functionality

and use UDDI (universal Description ,Discovery and Integration ) to hosting and publishing web services

Web API

web API like web services used to put your logic globally and compatible with different framework
But web API use REST  API
RESTful API is resource based that mean your logic methods related with resource or object for example make web api that make mathematics operations on integer and complex numbers
you will build two classes one for control integer service operation and second to control complex numbers services operation so RESTful API is resource based
RESTful API use six constraints to create valid REST architectures:-
  1. Uniform Interface
  2. Stateless
  3. Cacheable
  4. Client -Server
  5. Layered System
  6. Code on demand (optional)

Uniform Interface:

that mean must there is separation between structure and implementation of web API
first you create interface and define your abstract methods (define name of method and input and output without any implementation body)
and in implementation process web API controller will implement interface and create all logic

Stateless

mean REST api stateless protocol because it use HTTP protocol that mean server not known any thing about user request after send response . server not store any information about user all needed data will send as parameter to service operation

Cacheable

mean REST api result can be cached to increase performance

Client -Server 

mean REST API use client – server model

Layered System 

mean REST API has layered application and organized level . service operation not has direct access on database but call data access layer to use database and any business logic must implemented in  business logic layer

Code on demand 

this option constraint that mean if you need services operation (method) return logic or code , you can return it as javascript code
finally web API can represent result as XML or JSON

WCF

it is Microsoft technology to build logic on web like web service and web API

but WCF is more larger and detailed . WCF not depend on only HTTP Protocol but it can use other different network protocol like TCP , MSMQ and more

WCF used to build any communication types Simple , half duplex , full duplex

to create WCF :

create data contract to define result data and its members to serialization / deserialization

and make them by decorate interface [DataContract] attribute and its memeber [DataMember]

create service contract to define services functionality structure

and decorate interface [ServiceContract] and its methods [OperationContract]

implement service contract interface and define method logic in service class

define end point (ABC)

A => Address of service

B => Binding Protocol

C =>Contract

Author

techsupport

Follow Me
Other Articles
Previous

Windows API

Next

File2XL : Open a csv file into MS-Excel with pre-formatted cells

Categories

  • Android
  • Blog
  • Favorite Link
  • linux
  • Open Source
  • opencart
  • social
  • Tech
  • Uncategorized

Archives

  • January 2025
  • March 2024
  • August 2023
  • March 2023
  • February 2023
  • November 2021
  • August 2021
  • April 2021
  • March 2021
  • December 2020
  • October 2020
  • September 2020
  • July 2020
  • June 2020
  • May 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • June 2019
  • October 2018
  • August 2018
  • May 2018
  • April 2018
  • March 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • June 2017
  • March 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • January 2016
  • December 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
Copyright 2026 — Technical Personnal Blog. All rights reserved. Blogsy WordPress Theme