title: How to read an XML file in Mule Anypoint Studio after invoking an HTTP endpoint?
body: <p>I am new to <strong>Anypoint Studio</strong> and I am trying to create a flow that will have an <strong>HTTP</strong> connector and an endpoint and when a user invokes the http endpoint then the application will load the contents of an <strong>XML</strong> file, will convert then to <strong>JSON</strong> and will return the <strong>JSON</strong> back in the <strong>HTTP</strong> Response. </p>
  
  <p>My flow configuration looks like this</p>
  
  <pre><code>&lt;flow name="test-flow"&gt;
          &lt;http:listener config-ref="HttpListenerConfiguration" path="/read" allowedMethods="POST" doc:name="HTTP"&gt;
              &lt;http:response-builder statusCode="200"&gt;
                  &lt;http:header headerName="Content-Type" value="application/json"/&gt;
              &lt;/http:response-builder&gt;
          &lt;/http:listener&gt;
          &lt;file:inbound-endpoint path="xml/test.xml" responseTimeout="10000" doc:name="File"/&gt;
          &lt;mulexml:xml-to-object-transformer returnClass="org.mule.examples.Catalog" doc:name="XML to Object"/&gt;
          &lt;json:object-to-json-transformer sourceClass="org.mule.examples.Catalog" doc:name="Object to JSON"/&gt;
      &lt;/flow&gt;
  </code></pre>
  
  <p>Of course it doesn't work. I get a </p>
  
  <p><code>SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'file:inbound-endpoint'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":response}' is expected.</code></p>
  
  <p>which I assume is coming from the fact that <code>&lt;file:inbound-endpoint...&gt;</code> needs to be as a source in the flow. </p>
  
  <p>Any suggestions on how can I read a file after an <strong>HTTP</strong> endpoint is invoked?</p>
  
  <p>Thanks</p>