예제 #1
0
        public WMLS_AddToStoreResponse AddToStore(string wmlTypeIn, string xmlIn, string capClient, string optionsIn)
        {
            var request = new WMLS_AddToStoreRequest {
                WMLtypeIn = wmlTypeIn, XMLin = xmlIn, CapabilitiesIn = capClient, OptionsIn = optionsIn
            };

            return(Store.WMLS_AddToStore(request));
        }
예제 #2
0
        /// <summary>
        /// Returns the response for adding one WITSML data-object to the server
        /// </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_AddToStoreResponse WMLS_AddToStore(WMLS_AddToStoreRequest 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.AddToStore(context);

                var response = new WMLS_AddToStoreResponse((short)result.Code, result.Message);
                _log.Debug(response.ToLogMessage());
                return(response);
            }
            catch (ContainerException)
            {
                var response = new WMLS_AddToStoreResponse((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_AddToStoreResponse((short)errorCode, ex.Message);
                _log.Error(response.ToLogMessage(_log.IsWarnEnabled));
                return(response);
            }
        }
예제 #3
0
 /// <summary>
 /// Adds a WITSML data-object to the server.
 /// </summary>
 /// <param name="request">The request object encapsulating the method input parameters.</param>
 /// <returns>
 /// A positive value indicating success along with one or more WITSML data-objects from the server, or a negative value indicating an error.
 /// If successful the Uid of the inserted object is returned in the Response's SuppMsgOut.
 /// </returns>
 public WMLS_AddToStoreResponse WMLS_AddToStore(WMLS_AddToStoreRequest request)
 {
     return(_store.WMLS_AddToStore(request));
 }