/// <summary> /// GetServiceAddress /// </summary> /// <param name="service"></param> /// <returns></returns> public static EndpointAddress GetServiceAddress(AvailableServicesEnum service) { string serviceAddress; int servicePort = // Port, HTTP should be the base port value and NET.TCP should be on ServiceBasePort + 1 ServiceBasePort + ((int)EndpointType); switch (EndpointType) { case EndpointTypeEnum.TCPEndpoint: serviceAddress = "net.tcp"; break; case EndpointTypeEnum.HTTPEndpoint: serviceAddress = "http"; break; default: serviceAddress = "https"; break; } serviceAddress += "://" + ServiceHost + ":" + servicePort + "/MobiusServices/Mobius" + service + "Service"; EndpointAddress serviceEndpointAddress = new EndpointAddress( new Uri(serviceAddress), ServiceEndpointIdentity, new AddressHeader[0]); return(serviceEndpointAddress); }
/// <summary> /// Get the name of the endpoint in the config file /// </summary> /// <param name="service"></param> /// <returns></returns> public static string GetServiceEndpointName(AvailableServicesEnum service) { string endpointNameInAppConfig = service.ToString() + "_" + EndpointType.ToString(); return(endpointNameInAppConfig); }