/// <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; }
private void Connect(string url, double timeoutInMinutes, WMLSVersion version) { Connection = new WITSMLWebServiceConnection(url, version) { UseDefaultNetworkCredentials = true, Timeout = (int)(60000 * timeoutInMinutes) }; }
/// <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(); }
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(); }
/// <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)); }
/// <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))); }
/// <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) { }
/// <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) { }
/// <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) { }
public WitsmlProxyViewModel(Connection connection, WMLSVersion version) { Connection = connection.CreateProxy(version); Version = version; }
/// <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; }
/// <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); }
/// <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); }
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); }
/// <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); }
/// <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); }