Wednesday, October 27, 2010

WCF vs WebServices

What is really the difference between ASP.NET web service and WCF service?
Before we jump in too detail, few important things to remember about the service architecture

Web Service (.asmx) relies on XMLSeralizer object to transform data back and forth.
Only Public types and properties can be transformed using Web Service
it supports classes that implements IEnumerable interface and do not support classes that implements IDictionary object Such as HashTable.

WCF on the other hand uses DataContractSerializer, it uses DataContractAttribute and DataMemberAttribute to translate .Net Types to XML. DataContractSerializer can transform IDictionary obejct.

The main contracts that makes WCF powerful are
DataContract : Defines the structure of data included in the payloads of the messages flowing in and out of the service
Service Contract : Defines which operations the service makes available to be invoked as request messages are sent to the service from the client
Message Contract: Enables you to control the headers that appear in the messages and how the messages are structured
Fault Contract : Service methods communicate processing using SOAP fault messages. SOAP faults are message types that are included in the metadata for a service operation and these exceptions can be handled via Fault contract.

Creating Proxy Object for Client Consumption of the service:
WSDL.EXE tool is used by consuming application to create Web services proxy object or class..
SVCUTIL.EXE is used by consuming application to create WCF proxy object or class.

Tuesday, October 26, 2010

Data Replication Architecture

I'm currently working on an infrastructure challenge on data replication and thought of updating my learning in my blog:


There are several things to consider while working on server farms, where servers are located in multiple sites across the globe.

Peer to peer replication and Transaction Replications are few options that are available and are commonly used. This require not only configuration changes on the server but also require development consideration.

Peer to peer replication are available only in SQL server 2008

The servers on the farm should have identical O/S version, SQL server version, including the patches that are applied.

Database Schema should be identical

Identity column do not work in replication (atleast from SQL 2005)


Primary key with alpha-numeric or composite key will help resolve idenity column