Could not load file or assembly ‘Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken = 31bf3856ad364e35’ or one of its dependencies.

When I was setting up to create a WCF oData service, I came across this error.

This error comes because the assembly Microsoft.Data.Services.dll is not part of GAC/.NET Framework basic installation, it’s part of a SDK. You would have to install the SDK on the server, before you can use it.

It can be downloaded from following URL-

http://www.microsoft.com/en-us/download/details.aspx?id=29306

Programming is Easy…

Advertisements

WCF Vs ASMX Web Services

First of all, it needs to understand that WCF Service provides all the capabilities of .NET web servies and further extends it.
Simple and basic difference is that ASMX web service is designed to send and receive messages using SOAP over HTTP only. While WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, NamedPipes etc).
ASMX is simple but limited in many ways as compared to WCF.

1.ASMX web services can be hosted only in IIS while WCF service has all the following hosting options:
a. IIS
b. WAS (Windows Process Activation Services)
c. Console Application
d. Windows NT Services
e. WCF provided Host

2.ASMX web services support is limited to HTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.

3.ASMX Security is limited. Normally authentication and authorization is done using IIS and ASP.NET security configuration and transport layer security.For message layer security, WSE can be used.
WCF provides a consistent security programming model for any protocol and it supports many of the same capabilities as IIS and WS-* security protocols, additionally, it provides support for claim-based authorization that provides finer-grained control over resources than role-based security.WCF security is consistent regardless of the host that is used to implement WCF service.

4.Another major difference is that ASMX web services uses XmlSerializer for serialization while WCF uses DataContractSerializer which is far better in performance than XmlSerializer.
Key Issues with XmlSerializer in serializing .NET types to xml are:
a. 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.
Hopefully, this WCF Tutorial will be helpful in understanding the difference between WCF and ASP.NET Web Services.

5. Web services provides simplex communication and there is no way to have half duplex or full duplex communication.

WCF Vs ASMX Web Services

First of all, it needs to understand that WCF Service provides all the capabilities of .NET web servies and further extends it.
Simple and basic difference is that ASMX web service is designed to send and receive messages using SOAP over HTTP only. While WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, NamedPipes etc).
ASMX is simple but limited in many ways as compared to WCF.

1.ASMX web services can be hosted only in IIS while WCF service has all the following hosting options:
a. IIS
b. WAS (Windows Process Activation Services)
c. Console Application
d. Windows NT Services
e. WCF provided Host

2.ASMX web services support is limited to HTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.

3.ASMX Security is limited. Normally authentication and authorization is done using IIS and ASP.NET security configuration and transport layer security.For message layer security, WSE can be used.
WCF provides a consistent security programming model for any protocol and it supports many of the same capabilities as IIS and WS-* security protocols, additionally, it provides support for claim-based authorization that provides finer-grained control over resources than role-based security.WCF security is consistent regardless of the host that is used to implement WCF service.

4.Another major difference is that ASMX web services uses XmlSerializer for serialization while WCF uses DataContractSerializer which is far better in performance than XmlSerializer.
Key Issues with XmlSerializer in serializing .NET types to xml are:
a. 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.
Hopefully, this WCF Tutorial will be helpful in understanding the difference between WCF and ASP.NET Web Services.