Example #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());
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SoapFormatMessage" /> class.
 /// </summary>
 /// <param name="soapOperation">The SOAP operation.</param>
 /// <param name="messageFaultSoapBuilder">The message fault SOAP builder.</param>
 /// <param name="ns">The WS namespace.</param>
 public SoapFormatMessage(SoapOperation soapOperation, IMessageFaultSoapBuilder messageFaultSoapBuilder, string ns)
 {
     this._exceptionHandler = exception => messageFaultSoapBuilder.BuildException(exception, soapOperation.ToString());
     var response = soapOperation.GetResponse();
     var responseElement = response.ToString();
     this._xmlQualifiedName = new XmlQualifiedName(responseElement, ns);
 }
Example #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>
 /// Initializes a new instance of the <see cref="DispatchBodyElementAttribute"/> class.
 /// </summary>
 /// <param name="operation">
 /// The operation.
 /// </param>
 /// <param name="ns">
 /// The namespace.
 /// </param>
 public DispatchBodyElementAttribute(SoapOperation operation, string ns)
 {
     this._qname = new XmlQualifiedName(operation.ToString(), ns);
 }
        /// <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());
            }
        }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DispatchBodyElementAttribute"/> class.
 /// </summary>
 /// <param name="operation">
 /// The operation.
 /// </param>
 /// <param name="ns">
 /// The namespace.
 /// </param>
 public DispatchBodyElementAttribute(SoapOperation operation, string ns)
 {
     this._qname = new XmlQualifiedName(operation.ToString(), ns);
 }