Wish you Happy New Year 2014

I wish you Happy New Year 2014. I hope you had significant 2013 and I wish that you will have even better 2014.

 

image

I had good 2013. I got opportunity to attend and present in many conferences all across globe. I hosted each month learning gathering for developers. Blogged on various technologies to educate developers.

I can summarize my work for 2013 as below.

image

 

I had awesome time hosting and organizing C-Sharpcorner Delhi Chapter. With great team, we educated many developers. Team was not only restricted to developers but extended their help to students from villages also.

clip_image002

I am committed to help you through my blog and speaking in 2014 and all coming years as well. Once again I wish you and your loved one Happy New Year.

Four Steps to create first WCF Service: Beginners Series

image

This post is for beginners who are starting in WCF. I will be focused and help you to create and consume first WCF Service in simplest steps. We will follow steps as following,

image

At the end of this post you should able to create first WCF Service and consume that in a Console Application. I will keep adding further posts in this series to make WCF easier for you.

Project setup

  1. Launch any edition of Visual Studio 2010 or 2012.
  2. Create a project by choosing WCF Service Application project template from WCF tab.
  3. Delete default created IService1.cs and Service1.svc file.

Step 1: Create Service Contract

To create a Service Contract,

  1. Right click on project and add New Item
  2. From Web tab choose WCF Service to add.
  3. Let us give Calculator.svc name of service.

image

Next you need to perform following tasks,

  1. Open ICalculator.cs and remove void DoWork() function.
  2. Make sure attribute of Interface is set as [ServiceContract]
  3. Define functions you want to create as part of Contract
  4. Set Attribute of functions as [OperationContract]

You will create ICalculator Service Contract with four basic calculator operations as following,

ICalculator.cs


using System.ServiceModel;

namespace fourstepblogdemo
{

 [ServiceContract]
 public interface ICalculator
 {
 [OperationContract]
 double AddNumbers(double number1, double number2);
 [OperationContract]
 double SubstractNumbers(double number1, double number2);
 [OperationContract]
 double MultiplyNumbers(double number1, double number2);
 [OperationContract]
 double DivisionNumbers(double number1, double number2);

}
}

Above you have created a Service Contract with four Operation Contracts. These contracts will be part of Service Contract and exposed to clients. By this step you have created ICalculator Service Contract.

Step 2: Expose Endpoints with Metadata

In this step you need to expose Endpoints and Metadata of service. To do this open Web.config file. We are going to create one Endpoint with basicHttpBinding. We are adding metadata Endpoint also to expose metadata of service. We need metadata at the client side to create proxy.


<services>
 <service name="fourstepblogdemo.Calculator">
 <endpoint address="" contract="fourstepblogdemo.ICalculator" binding="basicHttpBinding"/>
 <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding"/>
 </service>
 </services>


Step 3: Implement Service

In this step we need to implement service. To implement service open Calculator.svc and write codes to implement functions is defined in ServiceContract ICalculator.cs. Delete implementation of DoWork function from Calculator.svc and implement services as following

Calculator.svc.cs

namespace fourstepblogdemo
{
 // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Calculator" in code, svc and config file together.
 // NOTE: In order to launch WCF Test Client for testing this service, please select Calculator.svc or Calculator.svc.cs at the Solution Explorer and start debugging.
 public class Calculator : ICalculator
 {

public double AddNumbers(double number1, double number2)
 {
 double result = number1 + number2;
 return result;
 }

public double SubstractNumbers(double number1, double number2)
 {
 double result = number1 - number2;
 return result;
 }

public double MultiplyNumbers(double number1, double number2)
 {
 double result = number1 * number2;
 return result;
 }

public double DivisionNumbers(double number1, double number2)
 {
 double result = number1 / number2;
 return result;
 }
 }
}


As of now you have created Service and configured Endpoint. Now you need to host service. There are many processes in which a WCF Service can be hosted. Some processes are

  • Managed Application
  • IIS
  • ASP.Net Web Server
  • Windows Service
  • App Fabric

In this post we are not going into details of WCF Service hosting and we will consider simplest hosting option. Let us host service in ASP.Net Web Server. To host press F5 in visual studio.

In browser you can see Service as following.

image

To view metadata of Service click on URL of wsdl. You may notice that Service is hosted on localhost.

image

Step 4: Consume Service

There are various ways a WCF SOAP Service can be consumed in different kind of clients. In this post we will consume service in a Console Application. Launch Visual Studio and create Console Application project.

Now there are two ways you can create proxy at client side.

  1. Using svcuitl.exe at command prompt
  2. By adding Service Reference

In this post we will create proxy at client side using Add Service Reference. In Console Project right click on Reference and select option of Add Service Reference. In Add Service Reference dialog copy paste address of Service or if WCF Service and Console Client project is in same solution then click on Discover. If there is no error in Service then you will find Service Reference added as given in following image. If you want you can change name of Reference. I am leaving here default name ServiceReferenc1.

image

You can consume service at client as following,

  1. Create instance of proxy class
  2. Call different operations from service

You can create instance of proxy class as following

image

And let us say you want to make a call to Add function. That can be done as following

image

So at client side you can call all four functions of Calculator Service as following


using System;
using ConsoleClient.ServiceReference1;

namespace ConsoleClient
{
 class Program
 {
 static void Main(string[] args)
 {

CalculatorClient proxy = new CalculatorClient();

double addResult = proxy.AddNumbers(9, 3);
 Console.WriteLine("Result of Add Operation");
 Console.WriteLine(addResult);
 double subResult = proxy.SubstractNumbers(9, 3);
 Console.WriteLine("Result of Substract Operation");
 Console.WriteLine(subResult);

double mulResult = proxy.MultiplyNumbers(9, 3);
 Console.WriteLine("Result of Multiply Operation");
 Console.WriteLine(mulResult);

double divResult = proxy.MultiplyNumbers(9, 3);
 Console.WriteLine("Result of Division Operation");
 Console.WriteLine(divResult);

Console.ReadKey(true);
 }
 }
}

Press F5 to run Console Client Application. You will get desired result.

image

Just now you have create a Calculator WCF Service and consumed that in a Console Application. In further posts I will simplify other concepts for WCF for beginners. I hope you find this post useful. Thanks for reading.

5 Basic Rules of Speaking

They say speaking is an Art, I say speaking is a science. A good speaking is combination of various basic rules. We can deliver a good speaking on applying basic rules collectively.

image

I have been attending many presentations on various topics from different speaker. I found some of them extremely entertaining and interactive and for some of presentation 1 hrs. was equivalent to 10 hrs. I learnt from various good speakers and in this post trying to consolidate my learning in 5 basic rules of speaking. Rules evolves by time so the rules of speaking. However let us see my five basic rules of an effective speaking.

Rule # 1: Complete in Time

I would have written a shorter letter, but I did not have the time: Blaise Pascal

If time is money then completing a task in given time is efficiency. It shows that you have successfully planned your work to execute them in time.

image

  • You have worked hard for this presentation.
  • You have spent sleepless nights to create 100 slides for 60 minutes presentation.
  • You are expert of this particular topic and you want to share all your expertise with audience.
  • All topic of yours presentation are very important

Although all of above data points are very important but not more than time assigned to you. Completing in time is most important attribute of any speaker. If you do not complete in time then

  • You negatively impact overall time table of the day
  • You are creating an enemy in next speaker after you.
  • Even though you are best speaker of the universe there are chances that few among audience did not like your session and they are waiting for your session to get over. By not completing in time you are not doing justice with them

Last but not least not able to complete in time shows your inability to plan and execute. It also suggests that you do not respect time of others. So make sure that you plan such that you can execute your speaking in assigned time to you. I count completing in time most important factor of good speaking and very vital attitude of a good speaker.

Rule # 2: Know your Audience

Every products have their target buyer, every movies have their target viewers, and every books have their target readers hence your session also has a target audience. If there is expectation disparity between buyers and product then very likely product would fail in the market. For a successful book, author’s imagination should be in line with the reader’s imagination. So success of your session depends on how much you know your audience while presenting.

image

This rule is very simple,

  • Your audience should be able to understand what you are saying.
  • Depth of your talk should be in par with level of your audience.
  • You should able to increase or decrease difficulty level of your topic on the fly.

There are various ways you can know your audience,

  • Conduct a poll on whether audience is interested to listen level 100 or level 400.
  • In beginning of session ask some basic questions on the topic you are presenting. See how many hands are being raised to answer those questions and then get a sense of the audience.
  • Last but not least best method to see mood of audience by reading their faces. If you find blank faces while presenting then you may decrease the difficulty level of presentation.

I find knowing audience is another vital aspect of good speaking. You need to be agile and you should able to change perception about your audience on basis of responses you see while presenting. You should able to change pace of presentation on audience response. To be on the same page with audience as speaker is another basic and important attribute of a good speaker.

Rule # 3: Know the Subject

Knowledge is power: Francis Bacon

Prepare, prepare and prepare is the key of successful and meaningful presentation. Without knowledge on subject in front of audience you will be epitome of an army without arms in front of enemy force.

image

Rule is not prepare hard rather prepare in smart way. Your preparation should be evident in your talk. You need to make sure of the following points

  • Make sure you have tested all demo in dry run
  • Make sure you have rehearsed your story for each slides
  • Make sure you know how to use various zoom in tools
  • Make sure there is a story line in your presentation
  • Make sure not to use big jargon while presenting

How easily you are presenting topic reflects amount of preparation you have done. Better preparation will help you to complete in time as well. Preparation will give you optimum confidence to be in front of audience. Hence I consider it one of the most vital factor of good speaking.

Rule # 4: Mind your Body Language and Dress code

Sometime your body language speaks louder than the words. What you are depicting from your body language is as important as what you are speaking from mouth. People hear what you say but they see what you show.

image

While presenting wearing a pleasant dress is always a benefit. Make sure

  • You are not wearing party dress while presenting
  • You are not wearing belt with bizarre buckles. For example once I was attending a presentation and speaker was wearing Playboy belt. He was subject of fun on that event day.
  • Do not try hard to look different while presenting.
  • Make sure you have control on your hand movement. Avoid putting them in your trouser pockets or moving them too fast.
  • Avoid showing your back to audience
  • Do not show that you are from some different planet since you are speaker.
  • Carry a light smile and if possible wear normal colors dress

Unless you are not known to audience, dress and body language does matter. I consider a positive body language with descent dressing an essential rule of effective speaking.

Rule # 5: Add some Fun

“If you don’t like me, why do you waste your time making fun of me? “

I am sure you like yourself and you want people to like you too. Usually people like funny people. In normal scenario people like to laugh. People laughing together are emotionally closer to each other and there are less chances that they would judge each other. To avoid harsh judgment of yourself and your presentation make sure that you and your audience are laughing with each other.

image

There are many ways you can make your audience laugh,

  • Start with a joke on yourself
  • Start with a funny story
  • Keep smiling while presenting
  • Praise few among audience with some flavor of light fun. For example you can say hey you are wearing a nice shirt etc.
  • Start with discussion of some funny scene of a popular story or book

I have seen many speakers start their presentation with negative statements like following,

  • I have not prepared for this session so my demo may fail
  • I have not got sufficient time to prepare
  • I have only 30 minutes and I afraid to complete in time
  • This topic is very hard so give full attention
  • I do not like this city etc.

You should avoid using negative statements. By saying that you have not got time to prepare for that particular session you are disregarding audience and conveying a message that session being presented by you was not that important to you.

Idea is very simple entertain your audience with sweetness of knowledge transfer. Leave everyone with filled mind and smiling face.

Conclusion

As I said in beginning of this post that rules evolves. So the rules of speaking. There are many other small factors we need to take care while presenting. In other post I will discuss other important factors. I hope you find this post useful. Hope to see you soon presenting an effective session.

Completed 5 years as professional

On 24th March 2013 I have completed 5 years as professional in Software industry. It has been an exciting journey for me. I moved from one city to another, worked on different kind of projects, with different kinds of teams. I learnt and explored lot in these 5 years.

So far my 5 years of journey is like below,

image

Even though I was placed from college campus due to late joining date I was jobless for almost 9 months. However I had fun searching jobs on streets of Bangalore. Running behind buses, standing in long queues, and giving resume to security personals at company’s gates. These 9 months gave me different experience and I learnt to survive.

On 24th March 2008 I joined UST Global in beautiful city Trivandrum. UST Global turned best company for me as fresher and I learnt everything there. After UST Global I joined Infosys in Pune. Both UST Global and Infosys added great values to my professionalism and helped me to attain my career best. My managers at both companies were very supportive and great motivator.

On 2nd July 2012 I joined Telerik as Customer Advocate in Gurgaon. This is the job I always wanted to do. In this job I develop, teach, interact and write. I love my job here.

Blogging

I love to share my learning. In order to share my learning I started blogging. I wrote my first blog posts on 20th November 2008. So far I have authored 750 + blog posts on various technologies.

My journey in blogging has been like below,

image

I am aspired to take my blogging to next level in coming years and author some book

Speaking

I love to speak and share my knowledge in community and various platform. In these 5 years I got many chances to present on various topic in different cities of India.

My speaking journey has been as follows,

image

I am excited that I would be speaking in various bigger events in coming years.

Awards and Recognitions

In this journey I got many recognition also. I got awarded as Microsoft MVP, C-SharpCorner MVP and Telerik MVP.

My Awards and Recognitions journey has been as follows

image

Time has been changing so the aspirations and me. Find below How I was in 2008 and now in 2013.

image

I am committed and aspired to work harder and take myself to next level of professionalism. Thanks everyone for all the help and support.