title: How do i Consume WCF Data Service?
body: <p>i have created a wcf service but i have used 3 projects for it; <br />
  1) ServiceLibrary (WCF library) <br />
  2) Web <br />
  3) ConsoleTestClient <br />
  my <code>ServiceLibrary</code> app.config file looks like this;</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="MrDAStoreJobs.ServiceLibrary.AdvertisementService"&gt;
          &lt;clear /&gt;
          &lt;endpoint address="basic" 
                    binding="basicHttpBinding" bindingConfiguration="" 
                    contract="MrDAStoreJobs.ServiceLibrary.Interface.IAdvertisementService" /&gt;
          &lt;endpoint name="mexHttpBinding"
            contract="IMetadataExchange"
            binding="mexHttpBinding"
            address="mex" /&gt;
  
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:13758/" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"/&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, 
            set the value below to false before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="True" /&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, 
            set the value below to true.  Set to false before deployment 
            to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt; &lt;br /&gt;
  </code></pre>
  
  <p>Now, to host this library, i have done the following settings in my <code>Web.Config</code> file of the <code>Web</code> Project. <br />
  The svc file name is <code>WcfDataService1.svc</code></p>
  
  <pre><code>    public class WcfDataService1 : DataService&lt;AdvertisementService&gt;
      {
          // This method is called only once to initialize service-wide policies.
          public static void InitializeService(DataServiceConfiguration config)
          {
              config.UseVerboseErrors = true;
  ServiceOperationRights.All);
              config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
          }
      }
    &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="MrDAStoreJobs.ServiceLibrary.AdvertisementService"&gt;
          &lt;clear /&gt;
          &lt;endpoint address="basic" 
                    binding="basicHttpBinding" bindingConfiguration="" 
                    contract="MrDAStoreJobs.ServiceLibrary.Interface.IAdvertisementService" /&gt;
          &lt;endpoint name="mexHttpBinding"
            contract="IMetadataExchange"
            binding="mexHttpBinding"
            address="mex" /&gt;
  
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:13758/WcfDataService1.svc" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"/&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, 
            set the value below to false before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="True" /&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, 
            set the value below to true.  Set to false before deployment 
            to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Now, when i test this service using directly (ServiceLibrary project) using WCF test client, i see the following and works everything great;
  <img src="https://i.stack.imgur.com/o3B7R.png" alt="enter image description here"> <br />
  The issue is when i try to run my <code>Web</code> project(which i use as a host for wcf service). And then go to the console test client and want to add reference using add reference. I don't see my <code>Get</code> and <code>Set</code> methods (like test client)
  <img src="https://i.stack.imgur.com/ChxaH.png" alt="enter image description here">
  <strong>Why i don't see my IAdvertisementService interface and the methods</strong> <br />
  <strong>Do i have to deploy this to actuall IIS?</strong></p>