Difference between WCF and Web service

Jul 28, 2010 Posted by Lara Kannan 0 comments
Difference between WCF and Web service

Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service, following table provides detailed difference between them.

FeaturesWeb ServiceWCF
HostingIt can be hosted in IISIt can be hosted in IIS, windows activation service, Self-hosting, Windows service
Programming[WebService] attribute has to be added to the class[ServiceContraact] attribute has to be added to the class
Model[WebMethod] attribute represents the method exposed to client[OperationContract] attribute represents the method exposed to client
OperationOne-way, Request- Response are the different operations supported in web serviceOne-Way, Request-Response, Duplex are different type of operations supported in WCF
XMLSystem.Xml.serialization name space is used for serializationSystem.Runtime.Serialization namespace is used for serialization
EncodingXML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, CustomXML 1.0, MTOM, Binary, Custom
TransportsCan be accessed through HTTP, TCP, CustomCan be accessed through HTTP, TCP, Named pipes, MSMQ,P2P, Custom
ProtocolsSecuritySecurity, Reliable messaging, Transactions

Source :www.wcftutorial.net

Hope this will help you!

Difference between BasicHttpBinding and WsHttpBinding

Posted by Lara Kannan 0 comments
Difference between BasicHttpBinding and WsHttpBinding

If we want to summarize in one sentence, the difference between WsHttpBinding and BasicHttpBinding is that WsHttpBinding supports WS-* specification. WS-* specifications are nothing but standards to extend web service capabilities.

Below is a detailed comparison table between both the entities from security, compatibility, reliability and SOAP version perspective.

Criteria BasicHttpBinding WsHttpBinding
Security support This supports the old ASMX style, i.e. WS-BasicProfile 1.1. This exposes web services using WS-* specifications.
Compatibility This is aimed for clients who do not have .NET 3.0 installed and it supports wider ranges of clients. Many of the clients like Windows 2000 still do not run .NET 3.0. So older version of .NET can consume this service. As its built using WS-* specifications, it does not support wider ranges of client and it cannot be consumed by older .NET version less than 3 version.
Soap version SOAP 1.1SOAP 1.2 and WS-Addressing specification.
Reliable messaging Not supported. In other words, if a client fires two or three calls you really do not know if they will return back in the same order. Supported as it supports WS-* specifications.
Default security options By default, there is no security provided for messages when the client calls happen. In other words, data is sent as plain text. As WsHttBinding supports WS-*, it has WS-Security enabled by default. So the data is not sent in plain text.
Security options

  • None

  • Windows – default authentication

  • Basic

  • Certificate

  • None

  • Transport

  • Message

  • Transport with message credentials

One of the biggest differences you must have noticed is the security aspect. By default, BasicHttpBinding sends data in plain text while WsHttpBinding sends it in encrypted and secured manner.

To demonstrate the same, lets make two services, one using BasicHttpBinding and the other using WsHttpBinding and then lets see the security aspect in a more detailed manner.

Source : www.codeproject.com

Hope this will help you!

WCF Data Services vs WCF RIA Services

Posted by Lara Kannan 0 comments
To sum up my findings as to the differences between WCF Data Services vs WCF RIA Services.

WCF (ADO.NET) Data ServicesWCF (.NET) RIA Services
Expose data model as RESTful web servicePrescriptive approach to n-tier app development
Cross platform interoperation as a goal
- “Unlock data silos”
- Out-of-box support from future MS products such as SQL2008 R2, Azure, Excel 2010, SharePoint 2010
Designed specifically for end-to-end Silverlight & ASP.NET solutions
- Some technology proprietary to Silverlight (no WPF support)
- Use ASP.NET Authentication/Roles across SL and ASP.NET
- ASP.NET/AJAX can also access service layer
Loosely coupled clients and serversClient & server are designed and deployed together
Service layer exposes “raw” data sourcesOpportunity to easily add business logic into service layer
- Encourage “domain” concepts
- Strong validation framework
- Offline / Sync enabled
Service can be consumed from .NET, Silverlight, AJAX, PHP and Java (libraries available)Service can be consumed easily from SL, AJAX, WebForms
Service’s data source must:
- Expose at least one IQueryable property
- Implement IUpdateable if you desire updates
Service exposes domain objects via convention:
- IQueryable GetX
- UpdateX/InsertX/DeleteX
No design time experience yet (??)Design time experience with data sources, drag drop etc
- OData for all clients
- Within OData, multiple formats supported (JSON, XML etc)
- SOAP (binary) for SL clients
- JSON for AJAX clients
- SOAP (XML) for other clients
Discoverable (?)Non-discoverable
Hosted as WCF Service (.svc)Old version hosted in custom web handler (.axd).
New version is WCF service.
Standardized on OData protocol Will “support” OData
More mature – public for at least 2 years, formerly “Project Astoria”Less mature – public for 6 months

Common features

  • Based on WCF
  • Use a RESTful architecture
  • Can be used to expose any data source (sql, xml, poco/objects etc.)
  • Client side libraries provide ability to query using LINQ


  • Currently they do not share much (any?) technology / code
  • RIA Services is not based on top of Data Services
  • RIA Services & Data Services will “align”
  • OData eventually pushed down into WCF stack
Source : www.mt-soft.com.ar

Hope this will help you!


"Publish failed" in Visual Studio 2008

Jul 15, 2010 Posted by Lara Kannan 0 comments

I was publishing a website today, and received an error message in the status bar indicating 'Publish failed. This was the only info I got, and couldn’t figure out what had happened as I had published successfully just minutes prior.

It turns out that there was an image that got included in my .csproj project file that had been deleted, and there was an error trying to locate it.

If you look in the output window (ctrl + alt + o) you will get a detailed list of any errors that occurred in the publishing process. I simply had to remove the image from the project file (as it didn’t exist any more anyway) and everything worked.


ASP.NET 3.5 vs ASP.NET 4.0

Jul 1, 2010 Posted by Lara Kannan 1 comments
Main Differences between ASP.NET 3.5 and ASP.NET 4.0.

ASP.NET 3.5 is having the following main features which are not availablle in the prior releases

  1. AJAX integration
  2. LINQ
  3. Automatic Properties
  4. Lambda expressions
I hope it would be useful for everyone to know about the differences about asp.net 3.5 and its next version asp.net 4.0 Because of space consumption I'll list only some of them here.

1. Client Data access:

ASP.NET 3.5: There is no direct method to access data from client side. We can go for any of these methods

  1. Pagemethods of script manager
  2. ICallbackEventHandler interface
  3. XMLHttphanlder component
ASP.NET 4.0: In this framework there is an inbuilt feature for this. Following are the methods to implement them.

  1. Client data controls
  2. Client templates
  3. Client data context
i.e we can access the data through client data view & data context objects from client side.

2) Setting Meta keyword and Meta description:

Meta keywords and description are really useful for getting listed in search engine.

ASP.NET 3.5: It has a feature to add meta as following tag
<meta name="keywords" content="These, are, my, keywords" /%>
<meta name="description" content="This is the description of my page" /%>

ASP.NET 4.0: Here we can add the keywords and description in Page directives itself as shown below.
< %@ Page Language="C#"  CodeFile="Default.aspx.cs" 
Description="description" %>

3) Enableviewstage property for each control

ASP.NET 3.5: this property has two values "True" or "false"

ASP.NET 4.0: ViewStateMode property takes an enumeration that has three values: Enabled, Disabled, and Inherit. Here inherit is the default value for child controls of a control.

4) Setting Client IDs

Some times ClientID property creates head ach for the programmers.

ASP.NET 3.5: We have to use ClientID property to find out the id which is dynamically generated

ASP.NET 4.0: The new ClientIDMode property is introduced to minimize the issues of earlier versions of ASP.NET.

It has following values.

AutoID - Same as ASP.NET 3.5
Static - There won't be any separate clientid generated at run time
Predictable-These are used particularly in datacontrols. Format is like clientIDrowsuffix with the clientid vlaue
Inherit- This value specifies that a control's ID generation is the same as its parent.