---
title: "Difference between WCF and Web Service"  
description: "Attributes  WCF has [ServiceContract] attribute attached with the class.  WS has [WebService] attribute attached with the class.  WCF has [OperationCo"  
author: "Uttam Misra"  
published: 2010-10-29  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/32/difference-between-wcf-and-web-service  
category: "wcf"  
tags: ["wcf"]  
reading_time: 1 minute  

---

# Difference between WCF and Web Service

**[Attributes](https://www.mindstick.com/articles/13105/2-attributes-that-make-your-odoo-ecommerce-theme-productive-and-engaging)**\

WCF has [ServiceContract] [attribute](https://www.mindstick.com/blog/221/attributes-reflection) attached with the class.\
WS has [[WebService](https://www.mindstick.com/forum/166/webservice-method)] attribute attached with the class.\
WCF has [OperationContract] attribute attached with methods.\
WS has [WebMethod] attribute attached with methods.\
\

**Hosting**\
WCF can be hosted on IIS, WAS, of self-hosting.\
WS can be hosted on IIS.

**XML**\
WCF uses using System.Runtime.Serialization; [namespace](https://www.mindstick.com/articles/12552/namespace) for serialization.\
WS uses using System.Xml.Serialization; namespace for serialization.

**Transports**\
WCF support HTTP, TCP, MSMQ, P2P [transport protocols](https://www.mindstick.com/interview/34151/what-are-the-different-transport-protocols-signalr-can-use-for-communication).\
WS support Http protocol.

**Encoding**\
WCF supports XML, MTOM ([Messaging](https://www.mindstick.com/news/2265/new-eu-law-could-open-up-messaging-and-app-buying) Transmission [Optimization](https://yourviews.mindstick.com/view/85459/what-is-conversion-rate-optimization-and-how-to-get-started) Mechanism), Binary.\
WS supports XML, MTOM, DIME (Direct Internet Message [Encapsulation](https://www.mindstick.com/articles/12229/encapsulation-and-access-specifier)).

**Security**\
WCF provides reliable security for messaging and [transactions](https://www.mindstick.com/interview/864/explain-acid-rule-of-thumb-for-transactions) over net.\
WS doesn’t provide method level security & message delivery isn’t assured & can be lost without acknowledgement.

---

Original Source: https://www.mindstick.com/blog/32/difference-between-wcf-and-web-service

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
