Ejemplo n.º 1
0
        public WMLS_UpdateInStoreResponse UpdateInStore(string wmlTypeIn, string xmlIn, string capClient, string optionsIn)
        {
            var request = new WMLS_UpdateInStoreRequest {
                WMLtypeIn = wmlTypeIn, XMLin = xmlIn, CapabilitiesIn = capClient, OptionsIn = optionsIn
            };

            return(Store.WMLS_UpdateInStore(request));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the response for updating 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_UpdateInStoreResponse WMLS_UpdateInStore(WMLS_UpdateInStoreRequest 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.UpdateInStore(context);

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

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

                return(response);
            }
            catch (WitsmlException ex)
            {
                var errorCode = ex.ErrorCode.CorrectNonConformingErrorCodes(WitsmlOperationContext.Current.RequestCompressed);
                var response  = new WMLS_UpdateInStoreResponse((short)errorCode, ex.Message);
                _log.Error(response.ToLogMessage(_log.IsWarnEnabled));
                return(response);
            }
        }
Ejemplo n.º 3
0
 public WMLS_UpdateInStoreResponse WMLS_UpdateInStore(WMLS_UpdateInStoreRequest request)
 {
     return(_store.WMLS_UpdateInStore(request));
 }