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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

[AX 2012] Consume web service - sucess anyone?

(0) ShareShare
ReportReport
Posted on by 75

Hi.

I tried creating a web service client according to this document:

Consuming_Web_Services_AX2012.pdf

I made a class library project, added the service reference and compiled. To verify, I made another (console) project, referenced the assembly with the web service client I just created and called the service which returned the results as expected.

Next I went back to the class library project containing the web service reference and clicked "Add to AOT", then set the deploy properties to client and server.

The AX 2012 development environment also shows the project in the "Visual Studio Projects" node, however I can't use the generated classes in the namespace. When I start typing the namespace it also doesn't give me autocomplete.

Copy&paste of the full class name including namespace from the abovementioned Visual Studio test project just gives me compile errors.

Has anyone managed to add a service client to AX 2012?

*This post is locked for comments

I have the same question (0)
  • Ava Farraday Profile Picture
    50 on at

    If memory serves, it must strongly named.  Is this the case for your service?

  • 640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    Have you generated incremental IL ?

  • Dong Shen Profile Picture
    380 on at

    Can you show us what compile errors are?

  • Falk Starke Profile Picture
    75 on at

    I6153.compileerror.jpg"http://www.webservicex.com/globalweather.asmx?WSDL">http://www.webservicex.com/globalweather.asmx?WSDL )
    (Note #2: I verified that the service works and the reference has been generated correctly by testing that with a small console app)

  • Add the project to the AOT - OK
  • Specify the deployment properties - OK

  • Verify the service reference - OK (see first screenshot)
  • Using the web service - does not work
    I try to write the variable declaration for the service client, but autocomplete doesn't give me the namespace.

    And if I cut and paste the namespace and class name from the (working) Visual Studio console application the AX compiler produces an error saying that a variable hasn't been declared, which however is a namespace and not a variable.
  • Seems to me that somehow though the project has been added to the AOT it still can't reference it.

     

  • Falk Starke Profile Picture
    75 on at

    @Huzaifa Gain:

    According to MSDN, if I build a project in debug (which I did) that implies incremental linking, so the answer would be yes.

  • Amir Nazim Profile Picture
    5,994 on at

    Hi Falk,

    i have not get chance to see this but i have a feeling that the reference of the project needs to be added to the References node in AOT then you can use it very similar to any .net dll addition to Reference node. i will test and will confirm you soon.

  • Falk Starke Profile Picture
    75 on at

    Hey Amir.

    Thanks for your suggestion. I tried that already, proceeding as follows:

    I right clicked on the references node in AX and added the generated dll (there is a dialog where you can add dlls from the GAC, some random disk location and other sources). When I chose the dll containing the service reference, no matter from where I imported it AX always complained about the dll not being in the applications bin directory. Anyway, importing seemed to work and I had that dll in the references node, but that didn't solve the problem.

    When I write code, autocomplete now gives me the first namespace in the path ("weatherservice" in my case) but that's as far as I can get, the next one is missing again. As before, copy&pasting the namespace and class name from the Visual Studio project doesn't work either.

  • Falk Starke Profile Picture
    75 on at

    I decieded to try a non web reference assembly. Just a simple class that adds two ints.

    Put that into a class library project, compiled, added to AOT. Visual Studio projects node shows the new project but still same problem as above.

    I built the assembly in release configuration and digitally signed, but the problem persists. So I assume that either AX 2012 has a general problem with DLLs or I am doing something wrong.

    I'll soon have a more recent build to test, hope it will work then.

  • 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

    Introducing the 2026 Season 1 community Super Users

    Congratulations to our 2026 Super Stars!

    Meet the Microsoft Dynamics 365 Contact Center Champions

    We are thrilled to have these Champions in our Community!

    Congratulations to the April Top 10 Community Leaders

    These are the community rock stars!

    Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

    #1
    CP04-islander Profile Picture

    CP04-islander 28

    #2
    Michel ROY Profile Picture

    Michel ROY 14

    #3
    imran ul haq Profile Picture

    imran ul haq 8

    Last 30 days Overall leaderboard

    Featured topics

    Product updates

    Dynamics 365 release plans