if you added a service reference to the web service definition language file for the endpoint, visual studio will have generated a proxy with the name that you gave the reference, you can new that up in a using statement for instance.
so say you have your service hosted in a console app with one endpoint locally implementing IHWservice at http://localhost:3000
This way of providing a self host is the best way to work with and debug such and porting it to somewhere else is only a few steps
[ServiceContract(Namespace = "http:://company.url/area/concern/year/month/day")]
public interface IHWService {
[OperationContract]
string GetMessage();
}
public class HelloWorldService : IHWService{
public string GetMessage(){
return "Hello";
}
}
class Program{
static void Main(string[] args){
using(var host = new ServiceHost(typeof(HelloWorldService))){
host.Open();
Console.ReadLine();
}
}
}
To get that working, your config file of that host will specify something like
<system.serviceModel>
<services>
<service name="HWService" behviourConfiguration="yourservicebehaviour">
<endpoint address="" contrac="IHWService" binding="basicHttpVinding" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:3000/" />
Now newing up the proxy and using it is as simple as
using(var proxy = new HWService.WhatYouCalledYourReferenceClient()){
Console.WriteLine(proxy.GetMessage());
}
of cause your config of that place needs to have it's version of system.servicemodel thingies abc (Address, Binding, Configuration) to mirror the host.