Esempio n. 1
0
        public void WitsmlStore_GetVersion_Version_Ordered_Oldest_First()
        {
            var request  = new WMLS_GetVersionRequest();
            var response = _devKit.Store.WMLS_GetVersion(request);

            Assert.IsNotNull(response);
            var ordered = true;

            if (!string.IsNullOrEmpty(response.Result))
            {
                var versions = response.Result.Split(',');
                Assert.IsNotNull(versions);
                Assert.IsTrue(versions.Length > 0);

                var version = versions[0];
                Assert.IsFalse(string.IsNullOrEmpty(version));

                for (var i = 1; i < versions.Length; i++)
                {
                    if (String.CompareOrdinal(version, versions[i]) >= 0)
                    {
                        ordered = false;
                        break;
                    }
                    version = versions[i];
                }
            }

            Assert.IsTrue(ordered);
        }
Esempio n. 2
0
        public void WitsmlStore_GetVersion_Can_Get_Version()
        {
            var request  = new WMLS_GetVersionRequest();
            var response = _devKit.Store.WMLS_GetVersion(request);

            Assert.IsNotNull(response);
            if (!string.IsNullOrEmpty(response.Result))
            {
                var versions = response.Result.Split(',');
                Assert.IsNotNull(versions);
                Assert.IsTrue(versions.Length > 0);

                foreach (var version in versions)
                {
                    Assert.IsFalse(string.IsNullOrEmpty(version));
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Returns a string containing the Data Schema Version(s) that a server supports.
        /// </summary>
        /// <param name="request">The request object encapsulating the method input parameters.</param>
        /// <returns>A comma-separated list of Data Schema Versions (without spaces) that the server supports.</returns>
        public WMLS_GetVersionResponse WMLS_GetVersion(WMLS_GetVersionRequest request)
        {
            try
            {
                WitsmlOperationContext.Current.Request = request.ToContext();
                EnsureCapServerProviders();

                _log.Debug(WebOperationContext.Current.ToLogMessage());
                _log.Debug(request.ToLogMessage());

                UserAuthorizationProvider.CheckSoapAccess();

                var response = new WMLS_GetVersionResponse(_supportedVersions);
                _log.Debug(response.ToLogMessage());
                return(response);
            }
            catch (WitsmlException ex)
            {
                var response = new WMLS_GetVersionResponse(ex.Message);
                _log.Error(response.ToLogMessage(_log.IsWarnEnabled));
                return(response);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Returns a string containing the Data Schema Version(s) that a server supports.
 /// </summary>
 /// <param name="request">The request object containing the method input parameters.</param>
 /// <returns>A comma-separated list of Data Schema Versions (without spaces) that the server supports.</returns>
 public WMLS_GetVersionResponse WMLS_GetVersion(WMLS_GetVersionRequest request)
 {
     return(_store.WMLS_GetVersion(request));
 }