/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="host"></param>
 /// <param name="port"></param>
 /// <param name="useSsl"></param>
 /// <param name="options"></param>
 public TcpTransport(string host, int port, bool useSsl, OcipClientOptions options)
 {
     _host    = host;
     _port    = port;
     _useSsl  = useSsl;
     _options = options;
 }
Beispiel #2
0
 public BWProvisioningServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress, OcipClientOptions ocipOptions) :
     base(BWProvisioningServiceClient.GetBindingForEndpoint(endpointConfiguration, new Uri(remoteAddress), ocipOptions), new System.ServiceModel.EndpointAddress(remoteAddress))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Beispiel #3
0
        private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration, Uri endpointUri = null, OcipClientOptions ocipOptions = null)
        {
            if ((endpointConfiguration == EndpointConfiguration.ProvisioningService))
            {
                System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
                result.MaxBufferSize          = int.MaxValue;
                result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
                result.MaxReceivedMessageSize = int.MaxValue;
                result.AllowCookies           = true;

                if (endpointUri?.Scheme == "https")
                {
                    result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
                }

                if (ocipOptions != null)
                {
                    result.OpenTimeout  = TimeSpan.FromMilliseconds(ocipOptions.SoapOpenTimeout);
                    result.CloseTimeout = TimeSpan.FromMilliseconds(ocipOptions.SoapCloseTimeout);
                    result.SendTimeout  = TimeSpan.FromMilliseconds(ocipOptions.SoapSendTimeout);
                }

                return(result);
            }
            throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
        }
Beispiel #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="uri"></param>
 /// <param name="ocipOptions"></param>
 public SoapTransport(Uri uri, OcipClientOptions ocipOptions)
 {
     _client = new BWProvisioningServiceClient(BWProvisioningServiceClient.EndpointConfiguration.ProvisioningService, uri.ToString(), ocipOptions);
 }