コード例 #1
0
ファイル: ServiceInitializer.cs プロジェクト: nazik/inst4wa
 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());
        }