Monday, January 18, 2010

WCF Basics

Service Contract

  • A Service Contract describes what the service can do. It defines some properties about the service, and a set of actions called Operation Contracts. Operation Contracts are equivalent to web methods in ASMX, or to operation element in WSDL.
  • A service contract is an interface that the WCF tools and infrastructure can convert into a WSDL document, listing the operations for a service as a series of SOAP messages and message responses.
  • You provide an implementation of these methods in a class in the service. When a service executes, the WCF runtime creates a channel stack by using the bindings specified in the service configuration file and listens for client requests in the form of one of these messages. The WCF runtime then converts each SOAP message sent by a client application into a method call and invokes the corresponding method in an instance of the class implementing the service. Any data returned by the method is converted back into a SOAP response message and is sent back through the channel stack for transmission to the client application.
  • WCF assumes that nothing is exposed by default. So, if you do not specify your class with Data Contract attributes, WCF doesn’t allow serialization to the wire.

Data Contracts

  • Service Contracts by default, can handle simple service calls. Calls which can have simple type arguments (build-in types), and which return also simple types values. The problem comes when you want to return a custom type, or accept it as an argument for your service operation. In order to do that, the messaging world, has a concept called Data Contract. Data Contract is the normalization of your custom messaging structures. It defines the members of your operation arguments or return values. In WSDL, the Data Contract is equivalent to the type element.


WCF Basics - Service Contracts

WCF Basics - Data Contracts

Microsoft Windows Communication Foundation Step by Step

Thursday, January 7, 2010

Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

If you are using a stored procedures that use temporary tables, then be aware that temporary tables created within a stored procedure use the tempdb database’s collation instead of the current user database’s collation. Tempdb is created at installation and is assigned the default collation.

Use 'COLLATE DATABASE_DEFAULT' to resolve the collation conflict, e.g.


SQL SERVER – Cannot resolve collation conflict for equal to operation
Collation Conflict

Find the name of the server where the site is hosted on

How to find out which website is assigned to which server on your network?

1. Start a command prompt windows (start menu, click on run, type in CMD and press OK/run)

2. Type in the following command and press enter

It will return an ip –

3. Now – we type the same command – with the ip above


It will return the name of the server where the site is hosted on.

Give it a shot……… knock yourself out!