示例#1
0
 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();
 }
示例#2
0
        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());
        }