private WebFeatureServiceReplicationPortClient buildClient(SubscriberDataset dataset) { var client = new WebFeatureServiceReplicationPortClient(); client.ClientCredentials.UserName.UserName = dataset.UserName; client.ClientCredentials.UserName.Password = dataset.Password; client.Endpoint.Address = new System.ServiceModel.EndpointAddress(dataset.SynchronizationUrl); return(client); }
public static WebFeatureServiceReplicationPortClient buildClient(Dataset dataset) { Console.WriteLine("SecurityProtocol:" + System.Net.ServicePointManager.SecurityProtocol.ToString()); //ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // Use TLS 1.2 as default //Console.WriteLine("SecurityProtocol after setting TLS 1.2:" + System.Net.ServicePointManager.SecurityProtocol.ToString()); var client = new WebFeatureServiceReplicationPortClient(); client.ClientCredentials.UserName.UserName = dataset.UserName; client.ClientCredentials.UserName.Password = dataset.Password; client.Endpoint.Address = new System.ServiceModel.EndpointAddress(dataset.SyncronizationUrl); return(client); }
public CapabilitiesDataBuilder(string ProviderURL, string UserName, string Password) { geosyncDBEntities db = new geosyncDBEntities(); WebFeatureServiceReplicationPortClient client = new WebFeatureServiceReplicationPortClient(); client.ClientCredentials.UserName.UserName = UserName; client.ClientCredentials.UserName.Password = Password; client.Endpoint.Address = new System.ServiceModel.EndpointAddress(ProviderURL); GetCapabilitiesType1 req = new GetCapabilitiesType1(); REP_CapabilitiesType rootCapabilities = client.GetCapabilities(req); ReadGetCapabilities(db, rootCapabilities); }
public CapabilitiesDataBuilder(string providerUrl, string userName, string password) { Console.WriteLine("SecurityProtocol:" + System.Net.ServicePointManager.SecurityProtocol.ToString()); //ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // Use TLS 1.2 as default //Console.WriteLine("SecurityProtocol after setting TLS 1.2:" + System.Net.ServicePointManager.SecurityProtocol.ToString()); var client = new WebFeatureServiceReplicationPortClient(); if (client.ClientCredentials != null) { client.ClientCredentials.UserName.UserName = userName; client.ClientCredentials.UserName.Password = password; } client.Endpoint.Address = new EndpointAddress(providerUrl); ProviderDatasets = new BindingList <Dataset>(); foreach (var dataset in ReadGetCapabilities(client)) { ProviderDatasets.Add(dataset); } }