Инструменты пользователя

Инструменты сайта


axapta:axaptabusinessconnector

Раздел: Программирование>ВзаимодействиеСОкружением>ActiveX


документация находится в DeveloperGuide: http://msdn.microsoft.com/library/en-us/Axapta/COMbasic/COMbasic_Introduction.asp?

Перед использованием надо зарегистрировать: запустить Navision Axapta Configuration Utility закладка Business Connector, кнопка Register

toc

пример работы

[[:JScript | ]]

пример работы с ABC из JScript

  • создайте файл test.js:
// создаём экземпляр объектника
var ax=new ActiveXObject("AxaptaCOMConnector.Axapta2");
// подключаемся двухзвенно, указывая путь к конфигурации
ax.Logon2("имя пользователя","ваш пароль","","","","","путь к конфигурации");
// вызываем функцию str2con с параметром "test1, test2"
var ret=ax.CallStaticClassMethod("Global", "str2con", "test1, test2");
// выводим длину результирующего контейнера 
WScript.Echo(ret.Length());
  • запустите его

[[:Delphi | ]]

{ создайте проект ABC.dpr: }
program ABC;
 
{$APPTYPE CONSOLE}
 
uses
  SysUtils, ComObj, ActiveX;
var ax, ret: Variant;
begin
    CoInitialize(nil);
    ax:=CreateOleObject('AxaptaCOMConnector.Axapta2');
    ax.Logon2('имя пользователя','пароль','','','','','\\axserver\Axapta\Projects\test.xpo');
    ret:=ax.CallStaticClassMethod('Global', 'str2con_RU', 'test1, test2');
    WriteLn(ret.Length);
    ret:=varNull;
    ax:=varNull;
    CoUninitialize();
    ReadLn;
end.

[[XPlusPlus]]

static void TestCOM2Axapta(Args _args)
{
    COM axaptaAppl;
    COM axaptaCustTable;
 
    axaptaAppl      = new COM("AxaptaCOMConnector.Axapta");
 
    axaptaAppl.logon("gtwy");
 
    axaptaCustTable = axaptaAppl.CreateRecord("CustTable");
    axaptaCustTable.ExecuteStmt("select CustTable");
 
    while(axaptaCustTable.found())
    {
        print axaptaCustTable.Field("AccountNum");
    }
    pause;
}

PHP

<?
error_reporting(0xff);
ini_set('display_errors', 1);
$axp = com_load('AxaptaCOMConnector.Axapta');
$user = new VARIANT('Test');
$empty = new VARIANT();
echo $axp->Logon($user);
echo $axp->CallStaticClassMethod('AA_test22', 'test2');
com_release($axp);
$axp = null;
?>

лицензирование

Линцензии находятся на форме «Лицензионные условия» в Axapta'е. На первой же закладке есть лицензия COM Clients. Закупается на определенное кол-во подключений (в поле статус указывается кол-во закупленных лицензий)

В прайс-листе они называются «COM Пользователи»

из MicrosoftPublicAxapta:

Generally, you need to have one «COM Client» license for each concurrent Business Connector (Axapta) user. I need to check on whether multiple connections by the same Axapta user are treated distinctly or as one user as far as licensing is concerned.

Regarding your second question, it depends on the type of application being developed. If the app just needs sporadic access to Axapta, for example, to retrieve some data which is thereafter manipulated outside of Axapta, then a persistent connection probably isn't warranted. Re-logging on will likely incur some time penalty, but you'd have to assess if this was significantly detrimental. If the application is transactional in nature, then the session would need to be maintained until the transaction is completed.

«Buck» wrote:

> We have a lot of custom software that would need to be integrated with Axapta

and we are trying to determine how many com connector licenses will be needed
to support this software. How does licensing works with the COM connector?
Do we need a license for every concurrent user that would potentially use it?
From a development perspective when using the the COM connector, is the
approach generally an in and out strategy or is a persistent connection
maintained for the duration of the app session. Thanks for any feedback on
this question.

см. также

axapta/axaptabusinessconnector.txt · Последнее изменение: 2018/04/13 22:43 (внешнее изменение)