I have one WCF Service in Server1 that exposes a group of SOAP WS in several endpoints. Then i have a second server (Server2) hosting another WCF Service. Both are hosted as a Windows Service (no IIS). I need to call a WS in Server2 from Server 1 Host (not client).
On Service1 i added the service reference and then created a client instance:
//Create object of the Binding
Binding binding = new BasicHttpBinding();
//Create endpointAddress of the Service
EndpointAddress endpointAddress = new
EndpointAddress("http://xxxxxxxxxxxxx:7093/");
//Create Client of the Service
MeterManagementClient client = new MeterManagementClient(binding,endpointAddress);
//Call Service method using ServiceClient
try
{
client.Open();
Token = client.GetToken("00002665499", 303,seq);
client.Close();
}
catch (FaultException<ServiceOperationFault> ex)
{
client.Abort();
throw new ApplicationException("Ha ocurrido el siguiente error: " + ex.Detail.ErrorMessage);
}
I’m getting this error:
Could not find default endpoint element that references contract ‘ctsTokenService.IMeterManagement’ in the ServiceModel client configuration section.
Do i need to add something to the app.config of Server 1?
Thanks for your help.