Hello,
I know there has been talked a lot about the WCF channelfactory, but I could not find a solution for my problem.
Previously I simply consumed this webservice using the method described here: https://community.dynamics.com/365/financeandoperations/b/daxmusings/archive/2011/10/19/consuming-external-webservices-in-ax-2012.
The goal of my current change is updating my existing external webservice so that the TLS1.2 security protocol is used when consuming it.
Now I wanted to implement TLS1.2, so I had the idea of creating my own wrapper class, that calls the generated webservice client and telling it to use TLS1.2 protocol.
This is the class I added:

An example of consuming one of the service operations:

I also set the app.config, to be always copied to Output directory.
I copied the dll's and the app.config file to the bin directories of AX2012 (client and server)
This code is working perfectly when I consume it from another .net application, but when testing it in an X++ job it constantly fails saying:
Could not find default endpoint element that references contract 'Messaging.Messaging' in the ServiceModel client configuration
What am I doing wrong here?
Help is greatly appreciated
Kind regards
Mathieu