public WitsmlClient(string hostname, string username, string password, bool logQueries = false) { if (string.IsNullOrEmpty(hostname)) { throw new ArgumentNullException(nameof(hostname), "Hostname is required"); } if (string.IsNullOrEmpty(username)) { throw new ArgumentNullException(nameof(username), "Username is required"); } if (string.IsNullOrEmpty(password)) { throw new ArgumentNullException(nameof(password), "Password is required"); } var serviceBinding = CreateBinding(); var endpointAddress = new EndpointAddress(hostname); client = new StoreSoapPortClient(serviceBinding, endpointAddress); client.ClientCredentials.UserName.UserName = username; client.ClientCredentials.UserName.Password = password; serverUrl = new Uri(hostname); client.Endpoint.EndpointBehaviors.Add(new EndpointBehavior()); SetupQueryLogging(logQueries); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(StoreSoapPortClient.GetEndpointAddress(EndpointConfiguration.StoreSoapPort)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(StoreSoapPortClient.GetBindingForEndpoint(EndpointConfiguration.StoreSoapPort)); }
public StoreSoapPortClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(StoreSoapPortClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public StoreSoapPortClient(EndpointConfiguration endpointConfiguration) : base(StoreSoapPortClient.GetBindingForEndpoint(endpointConfiguration), StoreSoapPortClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public StoreSoapPortClient() : base(StoreSoapPortClient.GetDefaultBinding(), StoreSoapPortClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.StoreSoapPort.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }