WCF endpoints are driving me insane
Here's what I do:
PortClient client = new PortClient(); // from the service reference
EndpointAddress endpointAddress;
if (local)
endpointAddress = new EndpointAddress("http://local/Service.svc");
else
endpointAddress = new EndpointAddress("http://remote/Service.svc");
client.ChannelFactory.CreateChannel(endpointAddress);
client.RemoteMethod();
etc.