Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to call Web Service from X++

(0) ShareShare
ReportReport
Posted on by 75

I have already change the class property to â€œServer“,  but the mistake still exist. 

43711.png2388.png44660.png52611.png

  • LuckSong Profile Picture
    75 on at
    RE: How to call Web Service from X++

    public static str GeCompanyName()

    {

       str companyName;

      lucktest001.SvcSoapClient  lucktestsvc;

    ;

      new InteropPermission(InteropKind::ClrInterop).assert();

      lucktestsvc = new lucktest001.SvcSoapClient("SvcSoap");

      companyName =lucktestsvc.FetchCompanyInfo("rpsz");

       return companyName;

    }

  • LuckSong Profile Picture
    75 on at
    RE: How to call Web Service from X++

    hi DAniele, thank you for your answer,i change my code, now it's ok

  • LuckSong Profile Picture
    75 on at
    RE: How to call Web Service from X++

    thank you very  very very much, i change the InteropKind::ClrInterop, it's ok now.

  • Martin Dráb Profile Picture
    231,886 Most Valuable Professional on at
    RE: How to call Web Service from X++

    ... but note that the documentation page is for AX 2012 and several things are different in AX 2009. Not WCF as such, of course, but things inside AX.

  • Suggested answer
    DAnny3211 Profile Picture
    9,274 Moderator on at
    RE: How to call Web Service from X++

    hi

    look this

    learn.microsoft.com/.../walkthrough-calling-an-external-web-service-from-x

    DAniele

  • Verified answer
    Martin Dráb Profile Picture
    231,886 Most Valuable Professional on at
    RE: How to call Web Service from X++

    Please always full error messages - your screenshot shows just a part of the first message. Also, paste them to the forum as text - it allows others to work with them and it also means that other people with the same problem can find this thread by searching.

    You told us nothing about your implementation, but your code and the second error message suggest that it's actually a CLR class. But you have a wrong interop type in InteropPermission constructor - it should be ClrInterop, not ComInterop.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,110 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,886 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans