title: WSO2 ESB 4.7.0 API url-mapping
body: <p>I am trying to make an API at WSO2 ESB 4.7.0 to process requests for a RESTful service. It seems that the URL-Mapping feature is not working or is working just like a filter, choosing what to send to the endpoint and what to drop. I have followed this tutorial: <a href="http://wso2.com/library/articles/2012/09/get-cup-coffee-wso2-way/" rel="nofollow">http://wso2.com/library/articles/2012/09/get-cup-coffee-wso2-way/</a>. Here is my API configuration:</p>
  
  <pre><code>&lt;api xmlns="http://ws.apache.org/ns/synapse" name="rest" context="/rest"&gt;
     &lt;resource methods="GET" url-mapping="/"&gt;
        &lt;inSequence&gt;
           &lt;send&gt;
              &lt;endpoint&gt;
                 &lt;http method="get" uri-template="http://myserver/REST"/&gt;
              &lt;/endpoint&gt;
           &lt;/send&gt;
        &lt;/inSequence&gt;
     &lt;/resource&gt;
     &lt;resource methods="GET" url-mapping="/numbers"&gt;
        &lt;inSequence&gt;
           &lt;send&gt;
              &lt;endpoint&gt;
                 &lt;http method="get" uri-template="http://myserver/REST/allnumbers"/&gt;
              &lt;/endpoint&gt;
           &lt;/send&gt;
        &lt;/inSequence&gt;
     &lt;/resource&gt;
  &lt;/api&gt;
  </code></pre>
  
  <p>There are three situations:</p>
  
  <ol>
  <li>This URL works: <code>http://esb/rest</code></li>
  <li>This URL doesn't work: <code>http://esb/rest/numbers</code></li>
  <li>This URL works: <code>http://myserver/REST/allnumbers</code></li>
  </ol>
  
  <p>In situation 2, I got an Apache Tomcat error: </p>
  
  <pre><code>HTTP Status 404 - Not Found
  
  type Status report
  
  message Not Found
  
  description The requested resource (Not Found) is not available.
  Apache Tomcat/6.0.32
  </code></pre>
  
  <p>But if I try the endpoint address, it works. I thought that the URL-Mapping would route requests for "/numbers" to "/allnumbers". What am I doing wrong?</p>