First of all, make sure that your service you want to refer to is up and running.
Then, in the Visual Studio Solution Explorer, run the ping "Add Service Link" ping command:

In the dialog that appears, enter the address of your service and click "Go":

This should connect to your service, find metadata, and if everything goes well, you will see your service (service contract and its methods) in the middle of the screen:

Before you click "OK" too quickly - pay attention to the "Namespace" text box in the lower left corner - you can enter the namespace in which your link to the service (the classes generated by it) will live. Usually I use something like (project).(servicename).Adapter - choose what makes sense to you.
Now, in the Solution Explorer, you will see a new icon for the service you just referred to - when you click the "Show All Files" button on the Solution Explorer toolbar, you will see all the files created. The place where your classes live is always called Reference.cs .

When you dare to open this file :-), you will see that you will have a class with the name (yourservicename)Client that you need to create in your client code - it will contain all the specific service methods that you can now call from your code:

Hope this helps!
source share