AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.10.2006, 16:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Fred Shen: Consuming a Web Service in Dynamics AX 4
Источник: http://fredshen.spaces.live.com/Blog...E4E3!188.entry
==============
This will tell you how to use Common Language Runtime Interoperability feature in Dynamics AX 4 to reference a web service.  There is a pretty good discussion about this on Microsoft MBS community by Dilip and Mike Frank.
To continue, at least you need to have Dot Net Framework SDK 2.0.  (Not Visual Studio .Net) We will use the language translation service on www.stanski.com as the referenced web service.
Procedure:
Download and Install .NET Framework Version 2.0 Software Development Kit.

Open a Microsoft .NET Framework command prompt. Click Start, point to All Programs, point to Microsoft .NET Framework SDK 2.0, and then click SDK Command Prompt.
At the command prompt, run the following command:
Wsdl /l:cs /protocol:soap
http://www.stanski.com/services/translate/translate.asmx
This will generate a C# source code file of proxy classe, which in this situation is TranslationService.cs
Then we need to edit TranslationService.cs file to add namespace for it.
Use NotePad to edit TranslationService.cs, the edited codes should look like
//------------------------------------------------------------------------------
//

namespace DemoAXWebService //Add namespace declaration
{
    using System;
    …
    …
}//End namespace declaration

Compile the cs file to dll file. Type this in the command prompt
csc /t:library TranslationService.cs

This will generate the TranslationService.dll.
Copy the TranslationService.dll to \Program Files\Microsoft Dynamics AX\client\Bin.

Start Microsoft Dynamics AX 4.0
Open Application Object Tree, and locate the Reference node. Right click, select Add Reference and register the TranslationService.dll in Dynamics AX.

Create a new job named TestWebService
static void TestWebService(Args _args)
{
    DemoAXWebService.TranslationService translateService
     = new DemoAXWebService.TranslationService();
    str strLanguage, strMessage;
    str translateResult;
    ;

    strLanguage = 'en_de';
    strMessage  = 'Test Web Service';
    translateResult = translateService.Translate(strLanguage, strMessage);
    Info(translateResult);
}

Run the job, you will get the result “Test-Netz-Service”.
 



==============
Источник: http://fredshen.spaces.live.com/Blog...E4E3!188.entry
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: WCF: The Enterprise Service Bus for Dynamics AX and the rest of the Microsoft Stack Blog bot DAX Blogs 0 10.03.2009 16:05
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Consuming External Web Services (Dynamics AX 4) Blog bot DAX Blogs 0 19.02.2008 06:41
Inside Dynamics AX 4.0: The Web Framework Blog bot DAX Blogs 0 25.10.2007 03:04
Pokluda: Outbound web service (AIF) Blog bot DAX Blogs 0 28.10.2006 17:43

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:06.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.