2012-02-01 3 views
0

나는 간단한 것을 놓치고 있을지 모르지만 나는 그걸로 싸워야한다. 주식 AIF 서비스에 연결하기위한 몇 가지 예가 있지만 사용자 지정 서비스에 연결하기위한 간결하고 실제적인 예제를 아직 찾지 못했습니다.C#을 사용하여 Dynamics AX 2012 - 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# 코드를 각 메서드를 호출하고 라벨에 결과를 작성하는 데 사용할 것

?

도움 주셔서 감사합니다.

답변

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

...