Exemplo n.º 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();
 }
Exemplo n.º 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());
        }