Indigo really isn't .NET 2.0 related because it won't be released until Longhorn comes out (which makes it probably 2.1 or 3.0). I am going to start talking about it more though, so that you have an idea of what it brings to the table. Indigo combines all of Microsoft's previous distributed computing technologies (i.e.: Web Services, .NET Remoting, Enterprise Services (DCOM), Web Services Enhancements, and MSMQ). Although fundamentally Indigo is not web services, it is based upon SOAP and objects are created in some what of a similar manner. Indigo gives support for a Service Oriented Architecture (SOA). Service Oriented is a new buzz word that you will start to hear more and more as Indigo gets closer. Indigo is transport independant. This means that it doesn't have to be exposed via SOAP/HTTP through IIS. It can be exposed using a Windows Service via TCP and a variety of other options.
To use Indigo, a new namespace System.ServiceModel will be available. The new attributes ([ServiceContract], [OperationContract], and [DataContract]) are used in lieu of a web service's [WebMethod] attribute. An Indigo service is simply a class marked with the ServiceContract attribute. To make a method accessible via Indigo, a method must have an OperationContract attribute. This attribute overrides any accessors (i.e.: public, private, protected), that you may have specified on a particular method. If the OperationContract attribute is not on the method even if it is public, the method will not be exposed. Conversely if a method is marked private, but the OperationContract attribute is present, the method will be exposed.
Here is an example of a simple Indigo service:
using System.ServiceModel;
[ServiceContract]
class MyClass
{
// Method will be exposed because it has the attribute
[OperationContract]
private bool IsBobbyLame()
{
return true;
}
// method will also be exposed
[OperationContract]
public bool IsCoreyLame()
{
return false;
}
// method will not be exposed
public bool IsMarcusLame()
{
return true;
}
}
So in this example the IsBobbyLame() and IsCoreyLame() methods will be exposed via Indigo. The IsMarcusLame() method will not be exposed, so the world will never know if Marcus is lame or not. Who am I kidding? We all know the answer to that.
This is a simple Indigo service. In the following tips, I will discuss how to make an Indigo client. If you want to know more now, again you can go read the article at:
Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=173