web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Could not find endpoint using ConfigurationChannelFactory

(0) ShareShare
ReportReport
Posted on by 335

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:

7455.screenshot.png

An example of consuming one of the service operations:

8831.screenshot2.png

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

*This post is locked for comments

I have the same question (0)
  • rabbit1986 Profile Picture
    335 on at
    RE: Could not find endpoint using ConfigurationChannelFactory

    I somehow managed to solve it. I debugged where AX was looking for my .config file. Apparently this was in the system32 folder. I always thought it would first look in the bin folder, next to the dll, and then search the system32. Anyway, I put the config file there, with a meaningful name, and it worked!

  • Suggested answer
    Martin Dráb Profile Picture
    235,928 Most Valuable Professional on at
    RE: Could not find endpoint using ConfigurationChannelFactory

    Ah, sorry, I misread your question. I thought you wanted to call an AX service.

    I think you're wrong in thinking that the main problem is in your version of Visual Studio. You can develop a library for .NET 4.7, but you can't load it into AX, if it doesn't support it.

    You mentioned Visual Studio 2010, which suggests that you're using an old version of AX 2012, because it uses VS 2013 since R3 CU8. .NET 4.7 is supported from R2 CU9 and R3 CU12.

  • rabbit1986 Profile Picture
    335 on at
    RE: Could not find endpoint using ConfigurationChannelFactory

    Martin,

    I was and am calling an external webservice from AX 2012 using a class library with a service reference. This worked for 3 years. There is no service on the AOS.

    Previously:

     I created a class library as described by Joris Degrutyer to consume the external webservice.
    At that time the library could be built and deployed into AX using Visual Studio 2010.

    Now:

    Now I needed to implement some security protocol (TLS1.2) in that class library. 

    Now for TLS1.2 I needed to use .net Framework 4.7 and VS2010 does not support this.

    So, I ended up creating a new class library in VS 2017, and deploying it manually in the bin folders of our AX.

    So my solution was to add an extra class in this class library, that sets the security protocol before calling the service methods. All the rest is similar to the old class library.

    The main difference here is that previously I could deploy the DLL using VS2010 in the AOT. As AX 2017 is not compatible with AX2012 I have to deploy it myself and this way it does not know how to connect to the service

  • Suggested answer
    Martin Dráb Profile Picture
    235,928 Most Valuable Professional on at
    RE: Could not find endpoint using ConfigurationChannelFactory

    Are you sure that you can get AOS to host your own web service? I've never heard of it and I have my doubts. Also, it seems that you're calling AX service from your service, which would be in the same process... And it definitely can't work on client, because these things are handled by AOS.

    You can host your web service outside AX, let clients to connect to your service and your service to communicate with AX via AX web services.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans