title: Why is my app claiming it can't find my WCF endpoint?
body: <p>I created the following endpoint in my WCF application, that is successfully working (for get calls at least) via GET calls:</p>
  
  <pre><code>    [OperationContract]
      [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
          UriTemplate = "Search/{platform}/{searchedContentTypeList}/?query={query}&amp;requestedFacetGroupCountList={requestedFacetGroupCountList}&amp;searchedFacetList={searchedFacetList}"
                          + "&amp;start={start}&amp;limit={limit}&amp;endpoint={endpoint}&amp;portalId={portalId}&amp;resultMetaIncludeList={resultMetaIncludeList}")]
      XosSearchResults Search(string query, string platform, string requestedFacetGroupCountList, string searchedFacetList, string searchedContentTypeList,
                                      int start, int limit, string endpoint, string portalId, string resultMetaIncludeList);
  </code></pre>
  
  <p>This is running locally on <code>http://localhost/DigitalREST/XosSearch.svc</code>, as well on our production service.  The GET query using the URI template works perfectly fine in a browser, and <code>http://localhost/DigitalREST/XosSearch.svc?wsdl</code> appears to give the correct meta data.</p>
  
  <p>I then went into my web application, added <code>http://localhost/DigitalREST/XosSearch.svc?wsdl</code> as a service reference.  I then wrote the following code to interact with the service:</p>
  
  <pre><code>        var binding = new BasicHttpBinding();
          var endpointAddr = new EndpointAddress("http://localhost/DigitalREST/XosSearch.svc?wsdl");
          var service = new XosSearchService.XosSearchClient(binding, endpointAddr);
          service.Open();
  
          // Run the search
          StartIndex = PageSize * SearchPageNum;
          SearchResults = service.Search(SearchQuery, Platform, null, FacetSearchString, Constants.VideoContentType, StartIndex, PageSize, Endpoint, PortalId, null);
  
          // Fill generic properties for outside reading
          StartIndex = (int)SearchResults.StartIndex;
          PageSize = SearchResults.PageSize;
          TotalResults = (int)SearchResults.TotalResults;
  
          service.Close();
  </code></pre>
  
  <p>When the <code>service.Search()</code> method gets called, the following exception occurs:</p>
  
  <blockquote>
    <p>There was no endpoint listening at <a href="http://localhost/DigitalREST/XosSearch.svc?wsdl" rel="nofollow">http://localhost/DigitalREST/XosSearch.svc?wsdl</a> that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.</p>
  </blockquote>
  
  <p>The inner exception is:</p>
  
  <blockquote>
    <p>The remote server returned an error: (404) Not Found.</p>
  </blockquote>
  
  <p>Even if I take out the <code>?wsdl</code> part, I'm still getting this error.  What am I doing wrong?</p>
  
  <p><hr>
  Here's the <code>IndexArticles</code> contract as requested:</p>
  
  <pre><code>    [OperationContract]
      [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "IndexArticles/{platform}/{portalId}")]
      void IndexArticles(string platform, string portalId);
  </code></pre>