public static IServiceManagement Get(X509Certificate2 authCert, out ClientOutputMessageInspector messageInspector) { messageInspector = new ClientOutputMessageInspector(); WebChannelFactory<IServiceManagement> factory = new WebChannelFactory<IServiceManagement> ( ConfigurationConstants.WebHttpBinding(0), new Uri(Utils.ServiceManagementEndpoint) ); factory.Endpoint.Behaviors.Add(messageInspector); factory.Credentials.ClientCertificate.Certificate = authCert; return factory.CreateChannel(); }
public static IServiceManagement Get(X509Certificate2 authCert, out ClientOutputMessageInspector messageInspector) { messageInspector = new ClientOutputMessageInspector(); WebChannelFactory <IServiceManagement> factory = new WebChannelFactory <IServiceManagement> ( ConfigurationConstants.WebHttpBinding(0), new Uri(Utils.ServiceManagementEndpoint) ); factory.Endpoint.Behaviors.Add(messageInspector); factory.Credentials.ClientCertificate.Certificate = authCert; return(factory.CreateChannel()); }