title: Could not find default endpoint element that references contract using ConfigurationChannelFactory
body: <p>I want to consume an external webservice using MS Dynamics AX.
  The normal way to do this is to create a C# class library, with a service reference in it. Then, back in the days, you could simply press a button "Deploy to AX" and your dll was installed And could be consumed.</p>
  
  <p>Now:</p>
  
  <p>Now I needed to implement some security protocol (TLS1.2) in that class library. </p>
  
  <p>Now for TLS1.2 I needed to use .net Framework 4.7 and VS2010 does not support this.</p>
  
  <p>So, I ended up creating a new class library in VS 2017, and deploying it manually in the bin folders of our AX.</p>
  
  <p>So my solution was to add an extra class in this class library, that sets the security protocol before calling the service methods from the service reference. All the rest is similar to the old class library.</p>
  
  <p>The problem is that I can consume my custom client in AX, but I keep getting the error System.InvalidOperationException: Could not find default endpoint element that references contract 'Messaging.Messaging'.</p>
  
  <p>Here's what I have created:
  My .net project using the service reference and one simple class, that I call from AX:
  <img src="https://i.imgur.com/5ZeDneh.png" alt="Project"></p>
  
  <p>Then here is how I want to consume that service in the class. 
  I used the ConfigurationChannelFactory, but still getting the enpoint error in AX. When using a console application in .net it works perfectly fine.
  <img src="https://i.imgur.com/IorO4T7.png" alt="Code"></p>