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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.06.2007, 17:00   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
axaptapedia: .NET Integration
Источник: http://www.axaptapedia.com/.NET_Integration
==============

Summary: /* Introduction */
==Introduction==
There are 2 different types of .NET Integration. First you may use .NET Assemblies inside Dynamics AX via CLR Interop. Second you can use X++ Code from outside by the .NET Business Connector. By Default you can use the System Namespace in your Application.


System.Collection.SortedList list = new System.Collection.SortedList();
;


==CLR Interop==
If you're using Visual Studio create a new Class Library Project. Implement whatever you need. In the Project Properties you have to sign your Assembly. Only signed Assemblies can be used in Dynamics AX. Change the Build Type to Release and build your Project. You find your DLL in your Projects bin/Release folder. Copy the DLL to the Dynamics AX Client/Bin Directory or register the Assembly in the Global Assembly Cache. Use the gacutil tool to register your Assembly in the GAC.


gacutil /i yourlibrary.dll


Open the AOT in your Dynamics AX Client. Add your Assembly to the References Node. If you have registered the Assembly in the GAC you can choose it from the grid. Otherwise you have to provide the path. If you don't get any errors it should work. It is a good idea to use Code Access Permissions with CLR Interop. Otherwise you will get a Best Practice Warning


CodeAccessPermission permission;
MyLibrary.MyClass foo;
;

permission = new InteropPermission(InteropKind::CLRInterop);
permission.assert();

foo = new MyLibrary.MyClass();


==.NET Business Connector==
The Business Connector is inverse to CRL Interop. It allows you to use Dynamcis AX Objects outside Dynamics AX. Typically scenarios are Load Testing using the Load Test Tool and Webservices. First you need to configure the Business Connector with the Client Configuration Tool. Next you have to provide a Proxy User. Create a new User Account in Active Directory. The Proxy User should be in the Administrator Group. In Dynamics AX you have to configure the Proxy User under Configuration > Security > BC Proxy User. Provide Username and Domain.

Time to test the Business Connector; Start Visual Studio and create a new Console Application. Add the Reference to the Microsoft Business Connector .NET DLL . You find the DLL in the Client/Bin Directory. Try to connect with Dynamcis:


try
{
Axapta axapta = new Axapta();
axapta.Login("","","","");
Console.WriteLine("It works");
axapta.Logout();
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadKey();


If you are using the Business Connector in a Web Application you have to use the LogonAs Method

try
{

System.Net.NetworkCredential credential = new System.Net.NetworkCredential("BCProxyUser","pass123","mydomain");
Axapta axapta = new Axapta()
axapta.LogonAs("BCProxyUser","mydomain",credential,"","","","");
..
axapta.Logoff();
}


[[Category:General development]]


Источник: http://www.axaptapedia.com/.NET_Integration
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Arijit Basu: DAX 4.01 .NET Business Connector: Microsoft.Dynamics.BusinessConnectorNet Blog bot DAX Blogs 3 30.09.2008 01:17
.NET коннектор + MSSQL Server Integration Delfins DAX: Программирование 3 28.08.2008 13:41
Inside Dynamics AX 4.0: Working with the .NET Business Connector Blog bot DAX Blogs 0 04.10.2007 05:15
Inside Dynamics AX 4.0: Integration Technologies Blog bot DAX Blogs 0 02.10.2007 04:49
ALEG: Проект "Фишка недели" и первый пост - Microsoft Dynamics™ AX .NET Business Connector Blog bot DAX Blogs 1 22.11.2006 09:43

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:58.