简体   繁体   中英

Dynamics AX 2012 - AIF Access Using C# Walkthrough

I'm probably missing something simple, but I'm tired of fighting with it. There seem to be quite a few examples for connecting to the stock AIF services, but I have yet to find a concise, working example for connecting to a custom service.

Assuming the following:

Service reference configured in the project with a namespace of MyService

That service has two methods exposed from Dynamics AX that we'll call:   
     helloWorld()    and   helloWorld2(str yourName)

Each method returns a simple string

What C# code would you use to call each method and write the result to a label?

Thanks for the help.

using [MyProjectName].MyService;

...

MyServiceClient client = new MyServiceClient();
CallContext context = new CallContext();
label1.Text = client.helloWorld(context);

MyServiceClient client = new MyServiceClient();
CallContext context = new CallContext();
label1.Text = client.helloWorld2(context, "test");

...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM