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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.02.2008, 06:41   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Consuming External Web Services (Dynamics AX 4)
Источник: http://blogs.msdn.com/aif/archive/20...-from-ax4.aspx
==============

Version: Dynamics AX 4.

1 Motivation
In today's world of complex business processes, it is not always desirable or possible for companies to implement or customize all aspects of their business applications in-house. At the same time, service providers offer a wide variery of solutions for specific business problems, such as tax services (sales tax, etc), regulatory services (OFAC, etc), unified messaging (instant messaging, phone notifications, etc), eCommerce (e.g. Amazon, EBay, and many others), etc.
Businesses benefit from outsourcing areas which are not their core competencies to such external service providers. They can rely on the service providers' expertise in the respective area. and don't have to worry about currency of the data, reliability of the service, etc. Various service providers implement different business models and SLAs around the services they offer.
Nowadays, one of the most popular, low-cost ways of integrating external applications with an enterprise application (such as Dynamics AX) is through web services. This blog walks through the steps necessary for consuming external web services from within the Dynamics AX 4 application.
2 Disclaimer
All code used below is meant for illustration purposes only and not intended for use in production. The following disclaimer applies to all code used in this blog:
Copyright (c) Microsoft Corporation. All rights reserved. THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER. USE AND REDISTRIBUTION OF THIS CODE, WITH OR WITHOUT MODIFICATION, IS HEREBY PERMITTED.

3 Process
3.0 Prerequisites
Visual Studio (in this example, we use version 2005)
3.1Create proxy classes from the WSDL
a. Open Visual Studio
b. Create a new project of type "Class Library" with the name "ClassLibrary1" (default name)
c. Right-click on the project and select "Add Web Reference"

i. For the URL enter: http://soap.search.msn.com/webservices.asmx?wsdl
ii. For the reference name enter: LiveSearch
iii. Click "Add Reference"
d. In the project's properties, under "Signing", check "Sign the assembly" (assembly must be strong-named)
e. Build the solution and verify that a file named "ClassLibrary1.dll" appears in Visual Studio's output folder
f. Add the DLL proxy to the GAC
i. Open a Visual Studio command prompt
ii. Navigate to the folder that contains ClassLibrary1.dll
iii. In the command prompt, type "gacutil /i ClassLibrary1.dll"
Note: Adding this assembly to the GAC is not necessarily recommended and is intended for testing;
an alternative approach for trusted assemblies would be to move the assembly into the .NET Assembly directory for Microsoft Dynamics AX (refer to the product documentation to locate that directory)
3.2 Add the proxy as an AX reference
a. Open the Dynamics AX client
b. Open an AOT instance
c. In AOT, right-click on the AOT node “References”
d. Select “Add Reference”
e. Navigate to the folder that contains "ClassLibrary1.dll" and add the DLL as a reference
f. Verify that the proxy DLL now appears as a child under the AOT node “References”
3.3 Use the proxy from X++ (through CLR Interop)
a. Refer to CLR documentation for details on how to access .NET assemblies from X++
b. Create a new job "LiveSearchTest" and discover the .NET generated proxy class classes with IntelliSense
c. Instantiate the (.NET) proxy just as with any other class:
e.g. “ClassLibrary1.LiveSearch.MSNSearchService service = new ClassLibrary1.LiveSearch.MSNSearchService();”
d. See attachment for a sample job for consuming the LiveSearch web service from X++. Note that you will need an application ID that you can obtain at http://dev.live.com/search.


Источник: http://blogs.msdn.com/aif/archive/20...-from-ax4.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Dynamics AX: DAXGuy: Infopath, Web Services & AX Integration Blog bot DAX Blogs 0 08.05.2008 03:18
Inside Dynamics AX 4.0: The Web Framework Blog bot DAX Blogs 0 25.10.2007 03:04
Dynamics AX: Make us of Outbound web services using AIF Blog bot DAX Blogs 0 28.10.2006 16:40
Fred Shen: Consuming a Web Service in Dynamics AX 4 Blog bot DAX Blogs 0 28.10.2006 16:40

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

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

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