База знаний ERP: Axapta/ Axapta Business Connector ...

Начало | Index | Changes | Comments | Users | Registration | Login  Password:  
 

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


документация находится в Developer Guide: Introduction


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


Contents

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

/JScript


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

// создаём экземпляр объектника
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.

X++


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 Пользователи»


из Microsoft Public Axapta:


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.

см. также


 
There are no files on this page.[Display files/form]
There is no comment on this page. [Display comments/form]