title: WCF rest api - [WebGet] working, but endpoint not found for [WebInvoke(...GET...)]
body: <p>New to configuring anything server side ... thanks in advance for your help!</p>
  
  <p>I am trying to get a simple HelloWorld REST api working in VisualStudio2008 / .NET 3.5; eventually I'll be using it to CRUD test data/results back to the server from a variety of mobile devices running on a local wireless lan.</p>
  
  <p>I've found a number of other questions who's answers change related parts of my app.config, but none seem to apply to this specific issue (and trial and error hasn't yielded any results)</p>
  
  <ul>
  <li>My WebGet query returns my data successfully.</li>
  <li>The Get request with my WebInvoke api returns an error "Endpoint not found"</li>
  </ul>
  
  <p>Here is my ServiceContract:</p>
  
  <pre><code>[ServiceContract]
  public interface IRestService
  {
      [OperationContract]
      [WebInvoke(
          Method = "GET",
          ResponseFormat = WebMessageFormat.Xml,
          BodyStyle = WebMessageBodyStyle.Wrapped,
          UriTemplate = "xml/{id}")]
      string XMLData(string id);  //Implemented as 'return "you requested " + id;'
  
      [OperationContract]
      [WebGet]
      string Test();              //Implemented as 'return "foobar";'
  
      [OperationContract]
      [WebGet]
      string Test2(string foo);   //Implemented as 'return "foobar=" + foo;'
  }
  </code></pre>
  
  <p>And here is my app.config</p>
  
  <p>
    
      
    
    
    </p>
  
  <pre><code>&lt;services&gt;
    &lt;service name="MyRestService.IRestServiceImpl" behaviorConfiguration="MyServiceBehavior"&gt;
  
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress="http://localhost/foo/bar"/&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
  
      &lt;endpoint address ="" binding="webHttpBinding" contract="MyRestService.IRestService" behaviorConfiguration="myRestBehavior" /&gt;
  
    &lt;/service&gt;
  &lt;/services&gt;
  
  &lt;behaviors&gt;
  
    &lt;serviceBehaviors&gt;
      &lt;behavior name="MyServiceBehavior"&gt;
        &lt;serviceMetadata httpGetEnabled="true"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  
    &lt;endpointBehaviors&gt;
      &lt;behavior name="myRestBehavior"&gt;
        &lt;webHttp/&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  
  &lt;/behaviors&gt;
  </code></pre>
  
  <p>
    </p>
  
  <p>I'm running via f5 in visualstudio (which I think means I don't have any .svc/IIS stuff to worry about?), and attempting to connect via</p>
  
  <pre><code>http://localhost/foo/bar/Test
  http://localhost/foo/bar/Test2   (  /ParamIgnored if I add one  )
  http://localhost/foo/bar/XMLData/123
  </code></pre>
  
  <p>on my browser.</p>
  
  <ul>
  <li>'Test' returns 'foobar'</li>
  <li>'Test2' returns 'foobar=' (no matter what '?param' or '/param' I add to the tail of the URL</li>
  <li>'XMLData' gives an error 'Endpoint not found' (displayed as html in my browser)</li>
  </ul>
  
  <p>Thanks much</p>