Пример #1
0
        /// <summary>
        /// Sets the data schema version from WITSML version.
        /// </summary>
        /// <param name="version">The WITSML version.</param>
        private void SetDataSchemaVersion(WMLSVersion version)
        {
            var dataVersion = version == WMLSVersion.WITSML131
                ? OptionsIn.DataVersion.Version131.Value
                : OptionsIn.DataVersion.Version141.Value;

            DataSchemaVersion = dataVersion;
        }
Пример #2
0
 private void Connect(string url, double timeoutInMinutes, WMLSVersion version)
 {
     Connection = new WITSMLWebServiceConnection(url, version)
     {
         UseDefaultNetworkCredentials = true,
         Timeout = (int)(60000 * timeoutInMinutes)
     };
 }
Пример #3
0
        /// <summary>
        /// Gets the .NET type of the collection for the specified data object type and WITSML version.
        /// </summary>
        /// <param name="objectType">The data object type.</param>
        /// <param name="version">The WITSML version.</param>
        /// <returns>The .NET type for the data object collection.</returns>
        public static Type GetObjectGroupType(string objectType, WMLSVersion version)
        {
            if (WbGeometry.EqualsIgnoreCase(objectType))
            {
                objectType = WellboreGeometry;
            }

            return(GetObjectType(objectType + "List", version));
        }
        /// <summary>
        /// Creates a WITSML proxy for the specified version.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="version">The WITSML version.</param>
        public void CreateContext(Connection connection, WMLSVersion version)
        {
            if (Context != null)
            {
                Context.LogQuery    = null;
                Context.LogResponse = null;
            }

            Context = new WitsmlQueryContext(connection.CreateProxy(version), version);

            Items.Clear();
        }
Пример #5
0
        protected DevKitAspect(string url, WMLSVersion version, TestContext context)
        {
            ConnectionUrl = url;
            Container     = ContainerFactory.Create();
            Container.BuildUp(this);
            ContextProviders.ForEach(x => x.Configure(this, context));

            Store           = new WitsmlStore();
            Store.Container = Container;
            Container.BuildUp(Store);

            Proxy          = new WITSMLWebServiceConnection(ConnectionUrl, version);
            Proxy.Timeout *= 5;

            Template = new DataObjectTemplate();
        }
Пример #6
0
 /// <summary>
 /// Gets the .NET type for the specified object type and WITSML version.
 /// </summary>
 /// <param name="objectType">The data object type.</param>
 /// <param name="version">The WITSML version.</param>
 /// <returns>The .NET type for the data object.</returns>
 public static Type GetObjectType(string objectType, WMLSVersion version)
 {
     return(GetObjectType(objectType, version == WMLSVersion.WITSML131
         ? OptionsIn.DataVersion.Version131.Value
         : OptionsIn.DataVersion.Version141.Value));
 }
Пример #7
0
 /// <summary>
 /// Creates a WITSMLWebServiceConnection for the current connection uri and WITSML version.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="version">The WITSML version.</param>
 /// <returns>A <see cref="WITSMLWebServiceConnection"/> instance.</returns>
 public static WITSMLWebServiceConnection CreateProxy(this Connection connection, WMLSVersion version)
 {
     //_log.DebugFormat("A new Proxy is being created with URI: {0}; WitsmlVersion: {1};", connection.Uri, version);
     return(connection.UpdateProxy(new WITSMLWebServiceConnection(connection.Uri, version)));
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WitsmlQueryContext"/> class.
 /// </summary>
 /// <param name="connection">The witsml web service connection.</param>
 /// <param name="version">The version.</param>
 public WitsmlQueryContext(WITSMLWebServiceConnection connection, WMLSVersion version)
     : base(connection, version)
 {
 }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WitsmlQueryContext"/> class.
 /// </summary>
 /// <param name="url">The URL.</param>
 /// <param name="username">The username.</param>
 /// <param name="password">The password.</param>
 /// <param name="version">The version.</param>
 /// <param name="timeoutInMinutes">The timeout in minutes.</param>
 public WitsmlQueryContext(string url, string username, SecureString password, WMLSVersion version, double timeoutInMinutes = 1.5)
     : base(url, username, password, timeoutInMinutes, version)
 {
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WitsmlQueryContext"/> class.
 /// </summary>
 /// <param name="url">The URL.</param>
 /// <param name="version">The version.</param>
 /// <param name="timeoutInMinutes">The timeout in minutes.</param>
 public WitsmlQueryContext(string url, WMLSVersion version, double timeoutInMinutes = 1.5)
     : base(url, timeoutInMinutes, version)
 {
 }
Пример #11
0
 public WitsmlProxyViewModel(Connection connection, WMLSVersion version)
 {
     Connection = connection.CreateProxy(version);
     Version    = version;
 }
Пример #12
0
 /// <summary>
 /// Creates a new WITSMLWebServiceConnection
 /// </summary>
 /// <param name="url">The target URL of the WITSML web service</param>
 /// <param name="ver">The version of the WITSML server</param>
 public WITSMLWebServiceConnection(string url, WMLSVersion ver) : base(url)
 {
     this.ver = ver;
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WitsmlContext"/> class.
 /// </summary>
 /// <param name="url">The URL.</param>
 /// <param name="username">The username.</param>
 /// <param name="password">The password.</param>
 /// <param name="timeoutInMinutes">The timeout in minutes.</param>
 /// <param name="version">The version.</param>
 protected WitsmlContext(string url, string username, SecureString password, double timeoutInMinutes, WMLSVersion version) : this()
 {
     Connect(url, username, password, timeoutInMinutes, version);
     SetDataSchemaVersion(version);
 }
Пример #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WitsmlContext"/> class.
 /// </summary>
 /// <param name="url">The URL.</param>
 /// <param name="timeoutInMinutes">The timeout in minutes.</param>
 /// <param name="version">The version.</param>
 protected WitsmlContext(string url, double timeoutInMinutes, WMLSVersion version) : this()
 {
     Connect(url, timeoutInMinutes, version);
     SetDataSchemaVersion(version);
 }
Пример #15
0
        private void Connect(string url, string username, SecureString password, double timeoutInMinutes, WMLSVersion version)
        {
            Connect(url, timeoutInMinutes, version);

            if (string.IsNullOrWhiteSpace(username))
            {
                return;
            }

            Connection.UseDefaultNetworkCredentials = false;
            Connection.Username = username;
            Connection.SetSecurePassword(password);
        }
Пример #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WitsmlContext"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="version">The version.</param>
 protected WitsmlContext(WITSMLWebServiceConnection connection, WMLSVersion version) : this()
 {
     Connection = connection;
     SetDataSchemaVersion(version);
 }
Пример #17
0
        /// <summary>
        /// Creates a WITSMLWebServiceConnection for the current connection uri and WITSML version.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="version">The WITSML version.</param>
        /// <returns>A <see cref="WITSMLWebServiceConnection"/> instance.</returns>
        public static WITSMLWebServiceConnection CreateProxy(this Connection connection, WMLSVersion version)
        {
            //_log.DebugFormat("A new Proxy is being created with URI: {0}; WitsmlVersion: {1};", connection.Uri, version);
            var proxy = new WITSMLWebServiceConnection(connection.Uri, version);

            proxy.Timeout *= 5;

            if (!string.IsNullOrWhiteSpace(connection.Username))
            {
                proxy.Username = connection.Username;
                proxy.SetSecurePassword(connection.SecurePassword);
            }

            return(proxy);
        }