<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:spring="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:http="http://www.mulesource.org/schema/mule/http/2.0"
       xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
       xmlns:xm="http://www.mulesource.org/schema/mule/xml/2.0"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
       http://www.mulesource.org/schema/mule/http/2.0 http://www.mulesource.org/schema/mule/http/2.0/mule-http.xsd
       http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
       http://www.mulesource.org/schema/mule/xml/2.0 http://www.mulesource.org/schema/mule/xml/2.0/mule-xml.xsd">

    <description>
        The StockQuote REST example uses the Mule RestServiceWrapper to invoke a remote .Net service
        Using REST style invocation and displays the result.
        The example invokes a StockQuote Web Service on www.webservicesx.com, the result is an Xml string that
        Mule converts to a StockQuote object by first running the result through an Xslt transformer and then
        using the XmlToObject transformer.
    </description>

    <context:property-placeholder location="proxy.properties"/>

    <http:connector name="HttpConnector"
                    proxyHostname="${proxyHostname}"
                    proxyPassword="${proxyPassword}"
                    proxyPort="${proxyPort}"
                    proxyUsername="${proxyUsername}"/>

    <xm:xml-to-object-transformer name="XmlToObject"/>
    <xml-entity-decoder-transformer name="XmlDecoder"/>
    <xm:xslt-transformer name="Xslt" xsl-file="xsl/rest-stock.xsl"/>
    <object-to-string-transformer name="ToString"/>

    <model name="Sample-Rest">
        <service name="HTTPPostSample">
            <inbound>
                <vm:inbound-endpoint path="stockquote"
                                     responseTransformer-refs="ToString XmlDecoder Xslt XmlToObject"/>
            </inbound>
            <http:rest-service-component
                    serviceUrl="http://www.webservicex.net/stockquote.asmx/GetQuote"
                    httpMethod="POST">
                <http:payloadParameterName value="symbol"/>
            </http:rest-service-component>
        </service>
    </model>
</mule>
