title: WCF service with webHttpBinding not working when configurations are added in web.config
body: <p>I have a very basic WCF service that I want to run on IIS as a RESTful service. Here is the service contract.</p>
  
  <pre><code>[ServiceContract]
  interface IRestCameraWs
  {
     [OperationContract]
     [WebGet(UriTemplate = "/cameras/{username}",ResponseFormat = WebMessageFormat.Xml,
              BodyStyle = WebMessageBodyStyle.Wrapped)]
     CameraInfo[] GetUserCameras(string username);
  
     [OperationContract]
     [WebGet(UriTemplate = "/liveimage/{cameraId}",ResponseFormat = WebMessageFormat.Xml,
              BodyStyle = WebMessageBodyStyle.Wrapped)]
     byte[] GetLiveImage(int cameraId);
  
     //void GetLatestImage(int cameraId, out DateTime timestamp, out byte[] image);
  
     [OperationContract]
     [WebGet(UriTemplate = "/latestimage/{cameraId}", ResponseFormat = WebMessageFormat.Xml,
              BodyStyle = WebMessageBodyStyle.Wrapped)]
     string GetLatestImageUrl(int cameraId);
  }
  </code></pre>
  
  <p>There is a class which implements this contract called <code>StopMotion.Business.WCFService.RestCameraWs</code>. Then I added an <code>.svc</code> file in my web project with following markup.</p>
  
  <pre><code>&lt;%@ ServiceHost Service="StopMotion.Business.WCFService.RestCameraWsBase"%&gt;
  </code></pre>
  
  <p>When I navigate to this service url, it shows me service home page and a link to wsdl definition. But when I add configuration in my <code>web.config</code> file to configure this service on <code>webHttpBinding</code> I get following error page from IIS express.  </p>
  
  <p><img src="https://i.stack.imgur.com/JJkoI.jpg" alt="enter image description here"></p>
  
  <p>First I thought I am doing something wrong with configuration. Later I deleted the configuration and just changed the factory in svc file like</p>
  
  <pre><code>&lt;%@ ServiceHost Factory="System.ServiceModel.Activation.WebServiceHostFactory" Service="StopMotion.Business.WCFService.RestCameraWsBase"%&gt;
  </code></pre>
  
  <p><code>WebServiceHostFactory</code> is said to use <code>webHttpBinding</code> by default and we don't need to add this in configuration unless we need something more out of it. But changing factory also resulted in the same error page on IIS Express. </p>
  
  <p>Any ideas what's going on here?</p>