Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to call Web Service from X++

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
    LuckSong 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
    LuckSong 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
    LuckSong 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
    Martin Dráb 230,214 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
    DAnny3211 9,272 Super User 2024 Season 1 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
    Martin Dráb 230,214 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans