Beispiel #1
0
        public void WitsmlStore_GetCap_Error_424_Missing_Data_Version()
        {
            var request  = new WMLS_GetCapRequest();
            var response = _devKit.Store.WMLS_GetCap(request);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.MissingDataVersion, response.Result);
        }
Beispiel #2
0
        public void WitsmlStore_GetCap_Can_Get_Cap_Server()
        {
            var request = new WMLS_GetCapRequest {
                OptionsIn = "dataVersion=1.4.1.1"
            };
            var response = _devKit.Store.WMLS_GetCap(request);

            Assert.IsNotNull(response);
            Assert.IsFalse(string.IsNullOrEmpty(response.CapabilitiesOut));
        }
Beispiel #3
0
        public void WitsmlStore_GetCap_Error_423_Unsupported_Data_Version()
        {
            var request = new WMLS_GetCapRequest {
                OptionsIn = "dataVersion=1.6.1.1"
            };
            var response = _devKit.Store.WMLS_GetCap(request);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.DataVersionNotSupported, response.Result);
        }
Beispiel #4
0
        /// <summary>
        /// Returns the capServer object that describes the capabilities of the server for one Data Schema Version.
        /// </summary>
        /// <param name="request">The request object encapsulating the method input parameters.</param>
        /// <returns>A positive value indicates a success; a negative value indicates an error.</returns>
        public WMLS_GetCapResponse WMLS_GetCap(WMLS_GetCapRequest request)
        {
            try
            {
                WitsmlOperationContext.Current.Request = request.ToContext();
                EnsureCapServerProviders();

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

                UserAuthorizationProvider.CheckSoapAccess();

                var options = OptionsIn.Parse(request.OptionsIn);
                var version = OptionsIn.GetValue(options, new OptionsIn.DataVersion(_defaultDataSchemaVersion));

                // return error if WITSML 1.3.1 not supported AND dataVersion not specified (required in WITSML 1.4.1)
                if (!_capServerMap.ContainsKey(OptionsIn.DataVersion.Version131.Value) && !options.ContainsKey(OptionsIn.DataVersion.Keyword))
                {
                    throw new WitsmlException(ErrorCodes.MissingDataVersion);
                }

                if (_capServerMap.ContainsKey(version))
                {
                    var response = new WMLS_GetCapResponse((short)ErrorCodes.Success, _capServerMap[version].ToXml(), string.Empty);
                    _log.Debug(response.ToLogMessage());
                    return(response);
                }

                throw new WitsmlException(ErrorCodes.DataVersionNotSupported, "Data schema version not supported: " + version);
            }
            catch (WitsmlException ex)
            {
                var response = new WMLS_GetCapResponse((short)ex.ErrorCode, string.Empty, ex.Message);
                _log.Error(response.ToLogMessage(_log.IsWarnEnabled));
                return(response);
            }
        }
 /// <summary>
 /// Returns the capServer object that describes the capabilities of the server for one Data Schema Version.
 /// </summary>
 /// <param name="request">The request object containing the method input parameters.</param>
 /// <returns>A positive value indicates a success; a negative value indicates an error.</returns>
 public WMLS_GetCapResponse WMLS_GetCap(WMLS_GetCapRequest request)
 {
     return(_store.WMLS_GetCap(request));
 }