title: Could not find default endpoint element that references contract - Hosting wcf
body: <p>I have one wcf service on this site <a href="http://wswob.somee.com/wobservice.svc" rel="noreferrer">http://wswob.somee.com/wobservice.svc</a></p>
  
  <p>I try to consume that service with my winform app. This is the error I receive when I create an instant of the service </p>
  
  <pre><code>com.somee.wobservice.IwobserviceClient myservice = new com.somee.wobservice.IwobserviceClient();
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>Could not find default endpoint element that references contract
  'com.somee.wobservice.Iwobservice' in the ServiceModel client configuration section. This 
  might be because no configuration file was found for your application, or because no 
  endpoint element matching this contract could be found in the client element.
  </code></pre>
  
  <p>I searched and modified my app.config file:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;behaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="wobservice"&gt;
        &lt;clientVia /&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  
  &lt;client&gt;
    &lt;endpoint
        name="wobservice"
        address="http://wswob.somee.com/wobservice.svc"
        binding="webHttpBinding"
        contract="com.somee.wobservice"
        behaviorConfiguration="wobservice" /&gt;
  &lt;/client&gt;
  
  &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And my web.config in wcf folder:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceMetadata httpGetEnabled="true"/&gt;
  
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
  
          &lt;endpointBehaviors&gt;
              &lt;behavior name="Web"&gt;
                  &lt;webHttp/&gt;
              &lt;/behavior&gt;
          &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
  
        &lt;serviceHostingEnvironment  multipleSiteBindingsEnabled="true"&gt;
            &lt;baseAddressPrefixFilters&gt;
                &lt;add prefix="http://wswob.somee.com/"/&gt;
            &lt;/baseAddressPrefixFilters&gt;
        &lt;/serviceHostingEnvironment&gt;
  
        &lt;bindings&gt;
            &lt;webHttpBinding&gt;
                &lt;binding&gt;
                    &lt;security mode="None" /&gt;
                &lt;/binding&gt;
            &lt;/webHttpBinding&gt;
        &lt;/bindings&gt;
  
        &lt;protocolMapping&gt;
             &lt;add binding="basicHttpsBinding" scheme="https"/&gt;
             &lt;add binding="basicHttpBinding" scheme="http"/&gt;
        &lt;/protocolMapping&gt;
  
        &lt;services&gt;
             &lt;service name="wobwcf.wobservice"&gt;
                &lt;endpoint address="" 
                          binding="webHttpBinding" 
                          behaviorConfiguration="Web" 
                          contract="wobwcf.Iwobservice" /&gt;
             &lt;/service&gt;
        &lt;/services&gt;
     &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I don't really sure which part I got wrong. My experience of wcf is just a week...</p>