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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

trying to use the axmetadataserviceclient but failing with error

(0) ShareShare
ReportReport
Posted on by

I'm trying to use the service in a .Net application but I get the following error  as soon as I'm trying to create a new client connection with

Dim client As AxMetadataServiceClient = New AxMetadataServiceClient()

An unhandled exception of type 'System.InvalidOperationException' occurred in System.ServiceModel.dll

Additional information: Could not find default endpoint element that references contract 'MetaDataServiceReference.IAxMetadataService' 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.

So I probably missed something but I have no idea what.

any help would be appriciated

PS.

I followed this example

https://msdn.microsoft.com/en-us/library/gg839793.aspx

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,920 Most Valuable Professional on at

    The message tells you what may be wrong: "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."

    If you didn't follow the advice, please do it now and check whether you have a configuration file with valid configuration. If you did it, please tell us what you've found.

  • Suggested answer
    Bashir Ahmad Profile Picture
    5,248 on at

    here is the solutions of this issue :

    community.dynamics.com/.../127652

    community.dynamics.com/.../127694

    community.dynamics.com/.../83437

  • Community Member Profile Picture
    on at

    with configuration file do you mean the app.config ?

    Sorry but I have very little knowledge about ax.

    I just need some metadata info from ax,

    I found this link msdn.microsoft.com/.../gg839793.aspx

    and just followed it's example, didn't mention anything about a configuration file :-)

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

       <system.diagnostics>

           <sources>

               <!-- This section defines the logging configuration for My.Application.Log -->

               <source name="DefaultSource" switchName="DefaultSwitch">

                   <listeners>

                       <add name="FileLog"/>

                       <!-- Uncomment the below section to write to the Application Event Log -->

                       <!--<add name="EventLog"/>-->

                   </listeners>

               </source>

           </sources>

           <switches>

               <add name="DefaultSwitch" value="Information" />

           </switches>

           <sharedListeners>

               <add name="FileLog"

                    type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"

                    initializeData="FileLogWriter"/>

               <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->

               <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->

           </sharedListeners>

       </system.diagnostics>

       <system.serviceModel>

           <bindings>

               <netTcpBinding>

                   <binding name="MetadataServiceEndpoint" />

               </netTcpBinding>

           </bindings>

           <client>

               <endpoint address="net.tcp://haraxr3aosvs01:8201/DynamicsAx/Services/MetadataService"

                   binding="netTcpBinding" bindingConfiguration="MetadataServiceEndpoint"

                   contract="MetaDataServiceReference.IAxMetadataService" name="MetadataServiceEndpoint">

                   <identity>

                       <userPrincipalName value="svcservicehar@geldof.be" />

                   </identity>

               </endpoint>

           </client>

       </system.serviceModel>

    </configuration>

  • Verified answer
    Martin Dráb Profile Picture
    237,920 Most Valuable Professional on at

    Yes, it would be app.config if you followed the walkthrough and created a console application (you obviously didn't use the same language as in the walkthrough).

    It has completely nothing to do with Dynamics AX at all - we're talking about a .NET application, .NET configuration file and WCF configuration.

    You really should learn basics of what you're trying to do. That you know nothing isn't an excuse - it's a problem you should fix. Fortunately you'll find plenty of resource regarding .NET architecture and development and WCF.

    Please try to follow the walkthrough exactly and check if it works. Or at least tell us what exactly you did.

  • Community Member Profile Picture
    on at

    Touché Martin :-),

    If do it in C# my program works .....

    still at a loss why the same doesn't work in a vb.net app

  • Martin Dráb Profile Picture
    237,920 Most Valuable Professional on at

    I don't know. To be honest, I don't use Visual Basic at all, so I have no idea whether it has some "feature" that may be responsible.

    Are you sure that the only difference is in the language? If you try to make one more app in VB.NET using the same steps as in C#, will it fail? (Maybe your original app got corrupted in some way.)

  • Community Member Profile Picture
    on at

    Yep, created new project now it works in vb aswell.

    Awesome feature this service I can access anything I want in the aot :-)

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans