Esempio n. 1
0
        /// <summary>
        /// The method that handle the processing of the sdmx query and orchestrate the
        ///     calls to different building blocks.
        /// </summary>
        /// <param name="input">
        /// The xml containing the SDMX Query
        /// </param>
        /// <param name="controller">
        /// The Controller of the request
        /// </param>
        /// <param name="xmlQualifiedName">
        /// Name of the XML qualified.
        /// </param>
        /// <param name="operation">
        /// The operation.
        /// </param>
        /// <returns>
        /// The queried data in specified format
        /// </returns>
        /// <exception cref="System.ServiceModel.Web.WebFaultException">
        /// Internal server error.
        /// </exception>
        private static Message HandleRequest(Message input, IController <Message, XmlWriter> controller, XmlQualifiedName xmlQualifiedName, SoapOperation operation)
        {
            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat(CultureInfo.InvariantCulture, "Request: {0}\n", input);
            }

            try
            {
                IStreamController <XmlWriter> streamController = controller.ParseRequest(input);
                WebOperationContext           ctx = WebOperationContext.Current;
                if (ctx == null)
                {
                    _log.Error("Current WebOperationContext is null. Please check service configuration.");
                    throw new WebFaultException(HttpStatusCode.InternalServerError);
                }

                Message message = new SdmxMessageSoap(
                    streamController,
                    xmlQualifiedName: xmlQualifiedName,
                    exceptionHandler: exception => _messageFaultBuilder.BuildException(exception, operation.ToString()));

                return(message);
            }
            catch (Exception e)
            {
                _log.Error(operation.ToString(), e);
                throw _messageFaultBuilder.BuildException(e, operation.ToString());
            }
        }
Esempio n. 2
0
        /// <summary>
        /// The method that handle the processing of the sdmx query and orchestrate the
        ///     calls to different building blocks.
        /// </summary>
        /// <param name="input">
        /// The xml containing the SDMX Query
        /// </param>
        /// <param name="controller">
        /// The Controller of the request
        /// </param>
        /// <param name="xmlQualifiedName">
        /// Name of the XML qualified.
        /// </param>
        /// <param name="getSoapOperation">
        /// The get SOAP operation.
        /// </param>
        /// <returns>
        /// The queried data in specified format
        /// </returns>
        /// <exception cref="Org.Sdmxsource.Sdmx.Api.Exception.SdmxInternalServerException">
        /// Not initialized correctly
        /// </exception>
        private static Message HandleRequest(Message input, IController <Message, XmlWriter> controller, XmlQualifiedName xmlQualifiedName, SoapOperation getSoapOperation)
        {
            try
            {
                IStreamController <XmlWriter> streamController = controller.ParseRequest(input);
                WebOperationContext           ctx = WebOperationContext.Current;
                if (ctx == null)
                {
                    _log.Error("Current WebOperationContext is null. Please check service configuration.");
                    throw new SdmxInternalServerException("Not initialized correctly");
                }

                Message message = new SdmxMessageSoap(streamController, exception => _messageFaultBuilder.BuildException(exception, getSoapOperation.ToString()), xmlQualifiedName);

                return(message);
            }
            catch (Exception e)
            {
                _log.Error(xmlQualifiedName, e);

                ////return Message.CreateMessage(MessageVersion.Soap11, _messageFaultBuilder.Build(e, xmlQualifiedName.Name), string.Empty);
                throw _messageFaultBuilder.BuildException(e, getSoapOperation.ToString());
            }
        }
Esempio n. 3
0
        /// <summary>
        /// The method that handle the processing of the sdmx query and orchestrate the
        ///     calls to different building blocks.
        /// </summary>
        /// <param name="input">
        /// The xml containing the SDMX Query
        /// </param>
        /// <param name="controller">
        /// The Controller of the request
        /// </param>
        /// <param name="xmlQualifiedName">
        /// Name of the XML qualified.
        /// </param>
        /// <param name="getSoapOperation">
        /// The get SOAP operation.
        /// </param>
        /// <returns>
        /// The queried data in specified format
        /// </returns>
        /// <exception cref="Org.Sdmxsource.Sdmx.Api.Exception.SdmxInternalServerException">
        /// Not initialized correctly
        /// </exception>
        private static Message HandleRequest(Message input, IController<Message, XmlWriter> controller, XmlQualifiedName xmlQualifiedName, SoapOperation getSoapOperation)
        {
            try
            {
                IStreamController<XmlWriter> streamController = controller.ParseRequest(input);
                WebOperationContext ctx = WebOperationContext.Current;
                if (ctx == null)
                {
                    _log.Error("Current WebOperationContext is null. Please check service configuration.");
                    throw new SdmxInternalServerException("Not initialized correctly");
                }

                Message message = new SdmxMessageSoap(streamController, exception => _messageFaultBuilder.BuildException(exception, getSoapOperation.ToString()), xmlQualifiedName);

                return message;
            }
            catch (Exception e)
            {
                _log.Error(xmlQualifiedName, e);

                ////return Message.CreateMessage(MessageVersion.Soap11, _messageFaultBuilder.Build(e, xmlQualifiedName.Name), string.Empty);
                throw _messageFaultBuilder.BuildException(e, getSoapOperation.ToString());
            }
        }
        /// <summary>
        /// The method that handle the processing of the sdmx query and orchestrate the
        ///     calls to different building blocks.
        /// </summary>
        /// <param name="input">
        /// The xml containing the SDMX Query
        /// </param>
        /// <param name="controller">
        /// The Controller of the request
        /// </param>
        /// <param name="xmlQualifiedName">
        /// Name of the XML qualified.
        /// </param>
        /// <param name="operation">
        /// The operation.
        /// </param>
        /// <returns>
        /// The queried data in specified format
        /// </returns>
        /// <exception cref="System.ServiceModel.Web.WebFaultException">
        /// Internal server error.
        /// </exception>
        private static Message HandleRequest(Message input, IController<Message, XmlWriter> controller, XmlQualifiedName xmlQualifiedName, SoapOperation operation)
        {
            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat(CultureInfo.InvariantCulture, "Request: {0}\n", input);
            }

            try
            {
                IStreamController<XmlWriter> streamController = controller.ParseRequest(input);
                WebOperationContext ctx = WebOperationContext.Current;
                if (ctx == null)
                {
                    _log.Error("Current WebOperationContext is null. Please check service configuration.");
                    throw new WebFaultException(HttpStatusCode.InternalServerError);
                }

                Message message = new SdmxMessageSoap(
                    streamController,
                    xmlQualifiedName: xmlQualifiedName,
                    exceptionHandler: exception => _messageFaultBuilder.BuildException(exception, operation.ToString()));

                return message;
            }
            catch (Exception e)
            {
                _log.Error(operation.ToString(), e);
                throw _messageFaultBuilder.BuildException(e, operation.ToString());
            }
        }