Tuesday, October 27, 2009

WF 4.0 calling WCF service 4.0 [ VS.NET 2010 Beta 2]

I downloaded VS.NET 2010 Beta 2 a week ago. But today only i got some free time to install, now i wanted to try new WF /WCF 4.0 .

In this blog i am going to explore WF 4.0 calling WCF 4.0 .

Step1 : Create a WCF service.

Here is my service contract definition and implementation

[ServiceContract(Name="SreeniService")]
  public interface IServiceContract
  {

      [OperationContract]
      DateTime GetServerTime();
      [OperationContract]
      string Greet(string Name);

  }

public class SreeniSvc : IServiceContract
  {

     #region IServiceContract Members

      public DateTime GetServerTime()
      {
          return DateTime.Now;
      }

      public string Greet(string Name)
      {
          return "Welcome Mr. "+ Name ;
      }

      #endregion
  }

Step 2: Add new WF project to the existing WCF service project.

Step 3:  Add WCF service Reference  to WF project.

After adding the Service Reference you must build or compile the project then only All methods or Operations in WCF service will appear as  WF activities in the Tool Box as shown below.

  image

Now we need to drag and drop the image  Sequence activity first to the WF designer surface. because we are going to build workflow using more then one activity . otherwise we will able to drop only one activity in the WF designer surface .

After that Drag and drop the  WCF operation Activity  GetServerTime on top of the Sequence activity from the Tool Box. This operation returns Datetime so we need to create a variable with this type and assign to this Activity. to crate variable just click Create Variable and choose variable type , Scope and even you can provide default Value .

   image

image 

Now we need to print the  GetServerTime Operations Result to the console. To do that we are going to use WriteLine activity from the Tool box and set the Expression as shown below.

image

Follow the same steps for the Second Operation Greet once you are finished  your workflow should look like this.

image 

Now execute the WF project Ctrl+F5 you should see the result as shown below.

image

 

Nandri(Thanks)

Sreenivasa Ragavan.

Friday, October 23, 2009

Tuesday, October 20, 2009

Visual Studio 2010 and .NET Framework 4 Beta 2 availability

 

Visual Studio

Visual Studio 2010 Beta 2 out today for MSDN Subscribers!

Visual Studio 2010 Beta 2 is now available for MSDN subscribers to download. General availability will be oct 21. 
Click here  for download Visual Studio 2010 page for Beta 2 general availability .,

Nandri (Thanks)

SeenivasaRagavan.

Thursday, October 8, 2009

My Windows 7 WEI Score [ Widows Experience Index]

Please let me know your WEI Score.

image 

Nandri(Thanks)

SreenivasaRagavan