예제 #1
0
        public WMLS_DeleteFromStoreResponse DeleteFromStore(string wmlTypeIn, string xmlIn, string capClient, string optionsIn)
        {
            var request = new WMLS_DeleteFromStoreRequest()
            {
                WMLtypeIn = wmlTypeIn, QueryIn = xmlIn, CapabilitiesIn = capClient, OptionsIn = optionsIn
            };

            return(Store.WMLS_DeleteFromStore(request));
        }
예제 #2
0
        /// <summary>
        /// Returns the response for deleting one WITSML data-object to the server.
        /// </summary>
        /// <param name="request">he request object encapsulating the method input parameters.</param>
        /// <returns>A positive value indicates a success; a negative value indicates an error.</returns>
        public WMLS_DeleteFromStoreResponse WMLS_DeleteFromStore(WMLS_DeleteFromStoreRequest request)
        {
            var context = WitsmlOperationContext.Current.Request = request.ToContext();
            var version = string.Empty;

            try
            {
                _log.Debug(WebOperationContext.Current.ToLogMessage());
                _log.Debug(context);

                UserAuthorizationProvider.CheckSoapAccess();
                WitsmlValidator.ValidateRequest(CapServerProviders);
                version = WitsmlOperationContext.Current.DataSchemaVersion;
                var family = ObjectTypes.GetFamily(WitsmlOperationContext.Current.Document.Root);

                var dataWriter = Container.Resolve <IWitsmlDataProvider>(new ObjectName(context.ObjectType, family, version));
                var result     = dataWriter.DeleteFromStore(context);

                var response = new WMLS_DeleteFromStoreResponse((short)result.Code, result.Message);
                _log.Debug(response.ToLogMessage());
                return(response);
            }
            catch (ContainerException)
            {
                var response = new WMLS_DeleteFromStoreResponse((short)ErrorCodes.DataObjectNotSupported,
                                                                "WITSML object type not supported: " + context.ObjectType + "; Version: " + version);

                _log.Error(response.ToLogMessage(_log.IsWarnEnabled));

                return(response);
            }
            catch (WitsmlException ex)
            {
                var response = new WMLS_DeleteFromStoreResponse((short)ex.ErrorCode, ex.Message);
                _log.Error(response.ToLogMessage(_log.IsWarnEnabled));
                return(response);
            }
        }
예제 #3
0
 public WMLS_DeleteFromStoreResponse WMLS_DeleteFromStore(WMLS_DeleteFromStoreRequest request)
 {
     return(_store.WMLS_DeleteFromStore(request));
 }