title: c# - trying to build a web service client from WSDL but no config file is provided
body: <p>I'm just getting familiar with WCF and I have to add additional functionality to a working web service at work. As I feel the need to be able to test the functionality before  deploying it, I decided to build a test client. Here comes the problem. 
  I created a Console Application just for the purpose of a test client and tried to add a Service Reference through the provided WSDL but it didn't work. There was no config file created.. I tried first the "Add Service Reference" option in VS and when it didn't work, I tried creating the Proxy and Config files with svcutil.exe...
  Just the proxy class gets created... When I try to instantiate a "client object" from that class, the following Exception is thrown: <code>"Could not find default endpoint element that references contract 'eOrderingService.IeOrderingService' 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></p>
  
  <p>As this is a working service (a Czech company is using it), apparently there must be a way to create a web.config or app.config even manually but I have no idea where to start.. As I said I'm just getting familiar with WCF so I started looking online but most of the problems connected somehow to my issue were in different parts of the already created Config files.. I managed to bypass that exception adding the following to app.config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;services&gt;
    &lt;service name="eOrderingService" &gt;
      &lt;endpoint
          address="http://localhost:61472/eOrderingService.svc"
          binding="webHttpBinding"
          contract="eOrderingService.IeOrderingService" &gt;          
      &lt;/endpoint&gt;        
    &lt;/service&gt;      
  &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="web"&gt;
        &lt;webHttp helpEnabled="true" /&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;client&gt;
    &lt;endpoint
      address="http://localhost:61472/eOrderingService.svc"
      binding="webHttpBinding"
      bindingConfiguration=""
      contract="eOrderingService.IeOrderingService"
      behaviorConfiguration="web"
      name="DeliveryNote" &gt;        
    &lt;/endpoint&gt;      
  &lt;/client&gt;  
  </code></pre>
  
  <p></p>
  
  <p>The service has a lot of methods and the one I need to test is called <code>'DeliveryNote'</code>.
  So lets say the service is at this address: </p>
  
  <pre><code>http://localhost:61472/eOrderingService.svc
  </code></pre>
  
  <p>The POST method I need to call is:</p>
  
  <pre><code>http://localhost:61472/eOrderingService.svc/DeliveryNote
  </code></pre>
  
  <p>And respectively the GET method is:</p>
  
  <pre><code>http://localhost:61472/eOrderingService.svc/DeliveryNote?DocumentFilter={DOCUMENTFILTER}&amp;CustomerID={CUSTOMERID}&amp;FromDate={FROMDATE}
  </code></pre>
  
  <p>The links are working but I cannot figure out how to call them from the client. 
  When I tested calling the POST method I received another exception: </p>
  
  <pre><code>The remote server returned an unexpected response: (400) Bad Request.
  </code></pre>
  
  <p>That shouldn't be true because the request I'm sending is already tested and is a valid request in XML format. 
  So I tried to test with a different GET method that works and receives just two <code>DateTime</code> parameters and not a Xml. If I try the following link: </p>
  
  <pre><code> http://localhost:61472/eOrderingService.svc/PriceChanges?startDate=2018-08-29&amp;endDate=2018-08-30
  </code></pre>
  
  <p>the result is OK.. 
  But if I call the <code>automatically generated method "PriceChanges"</code> the result is <code>NULL</code>.
  I just don't get what I do wrong. It seems like a connection to the service is established but the methods are not called/build correctly. Probably because I cannot comprehend how to build the <code>&lt;system.serviceModel&gt;</code> in app.config.
  I definitely should read more about the web services but I don't know where to start.</p>