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)

Consuming a external webservice: cannot instantiate a class

(0) ShareShare
ReportReport
Posted on by 335

Hello,

I am consuming an external webservice in AX.

The problem is there are classes I cannot access from within AX.

For instance: the class "OpeningHour" is defined in the same namespace as the "ClientData", but I cannot reach it in AX. I can in .net though ...

Please have a look at the following:

https://i.imgur.com/7uOEglG.png

I can instantiate the clientData object in AX, but not the subclass:

https://i.imgur.com/QpOFs41.png, but both are public:

When I decompile the dll the classes seem to be evenly accessible: ("CLientdata" can be instantiated, but not the "OpeningHour" class)

dll.png

How can .net see the class but not AX? Is it because the class is situated too "deep" in the namespace?
 Am I mistaking somewhere?

On a sidenote: the class is created because of the following setting:
I set the service reference to create arrays for the collections (as AX doesn't seem to like generic lists too much :-) )

6428.serviceref.png

Hopefully someone can help me out here 

Help is greatly appreciated

Kind regards

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    235,999 Most Valuable Professional on at
    RE: Consuming a external webservice: cannot instantiate a class

    It seems like an inner class - it's not "too deep in the namespace"; it's actually embedded in the other class (ClientData).

    I think this isn't supported by .NET Interop. I suggest you expose it from ClientData through a method.

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
Community Member Profile Picture

Community Member 2

#2
Mea_ Profile Picture

Mea_ 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans