0

我可能错过了一些简单的东西,但我厌倦了与之抗争。似乎有很多连接到库存 AIF 服务的示例,但我还没有找到连接到自定义服务的简洁、有效的示例。

假设如下:

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

您将使用什么 C# 代码来调用每个方法并将结果写入标签?

谢谢您的帮助。

4

1 回答 1

2
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");

...

于 2012-02-01T16:27:30.800 回答