Dynamics AX 2009 - AIF - Adapter Based Exchange - File System - Inward Data Configuration Help Needed

This question is not answered

Dear Experts

I am working on Dynamics AX 2009 AIF - Adapter Based Exchange - File System based trying to push Item details through an XML file. I could sucessfully export the data from the AX 2009 through AIF, whereas I couldnt import them inside the system - the batchfiles are bringing the data from the folder into the Axapta Queue and from there it is not getting pushed into the tables - I have called the two services - AIFGatewayReceiveService and AIFInboundProcessingService through batch.

Here is the configuration which I made:

 1. Created Local Endpoint - default to company            Company - DAT            Local endpoint - Local1DAT2.Transport Adapters            Adapter Class - AifFileSystemAdapter            Name - File System Adapter            Active - Yes            Direction - Receive Or Send3.Channels            Channel ID - CHN003            Name - File System Channel            Active - Yes            Adapter - File System Adapter            Direction - Outbound            Parallel Processing - No            Address - F:\Test Folder\            Response Channel -             Channel ID - CHN004            Name - File System Channel            Active - Yes            Adapter - File System Adapter            Direction - Inbound            Parallel Processing - Yes            Address - F:\Test Folder 1\            Response Channel - CHN0034. Endpoints            Endpoint ID - Inbound-Item            Name - Item Inbound            Active - Yes            Propogate Errors - Yes            Intercompany Organization - No            Outbound channel ID - CHN003            Local endpointID - Local1Dat                        No Contraints            Users - User group - Admin - Administrators             Action Policies for this Endpoint            Action ID - InventItemService.create            Is default policy - No            Status - Enabled            External identifier override            Class Name - InventItemService            Logging mode - Log Original       {Datapolicy - required all enabled fields} 

<<<<<<<<<<<<XML FILE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

  <?xml version="1.0" encoding="UTF-8" ?>
- <Envelope xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
- <Header>
  <MessageId>{AA9EC7EB-CE57-4C07-AA2D-0F2FFBA3E79F}</MessageId>
  <SourceEndpoint>Inbound-Item</SourceEndpoint>
  <DestinationEndpoint>Local1DAT</DestinationEndpoint>
  <Action>http://schemas.microsoft.com/dynamics/2008/01/services/InventItemService/create</Action>
  </Header>
- <Body>
- <MessageParts xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
- <Item xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Item">
- <InventTable class="entity">
  <DimGroupId>C-W</DimGroupId>
  <ItemGroupId>GRP-0001</ItemGroupId>
  <ModelGroupId>AVG</ModelGroupId>
- <Sales class="entity">
  <ItemId>ITEM0002</ItemId>
  </Sales>
- <Purch class="entity">
  <ItemId>ITEM0002</ItemId>
  </Purch>
- <Invent class="entity">
  <ItemId>ITEM0002</ItemId>
  </Invent>
- <InventItemLocation class="entity">
  <ItemId>ITEM0002</ItemId>
  </InventItemLocation>
- <InventItemSalesSetup class="entity">
  <ItemId>ITEM0002</ItemId>
  </InventItemSalesSetup>
- <InventItemPurchSetup class="entity">
  <ItemId>ITEM0002</ItemId>
  </InventItemPurchSetup>
- <InventItemInventSetup class="entity">
  <ItemId>ITEM0002</ItemId>
  </InventItemInventSetup>
  </InventTable>
  </Item>
  </MessageParts>
  </Body>
  </Envelope>
 
Kindly correct if my above configuration setup is wrong. Thanks in advance.
 
Thanks,
Deva
All Replies
  • Hi,

    The encoding format is generally decided based on the Global setting in Application Integration Framework

    (Basic > AIF > Global Settings)

    One more issue you had regarding the following error

    Warning: Field 'Item number' must be filled in. in subsystem  Subsystem: Line=1, Pos=77, Xpath=/Item/InventTable[1]

    Error: Error found when validating record. in subsystem Subsystem: Line=1, Pos=77, Xpath=/Item/InventTable[1]

    This is b'coz the xML doesn't have these information filled in. So make sure you update the xML with the following entity or disable the parameter from the data policy form which can be done through (Basic > AIF > Endpoints > Action policies > Data policies)

    Regards,

    Santosh.R

    Please don't print this email unless you really need to. This will preserve trees on our planet.

  • Hi all,

     

    I am getting error while importing XML from Inbound folder to AX 2009. I want to see XML data in Form , but I am not able to see it in COA form. Batch job is running after every 1 min , and XML is getting consumed by AX. Below exceptions we are getting SubSystemName : AifGatewayQueueCannot create a record in Gateway Queue (AifGatewayQueue). Message ID: {1652FD2C-C3D4-4B90-9815-369BAF917D98}, In Transport Process.The record already exists. SubSystemName : AifRequestProcessor-processServiceRequest. User is not authorized for this Endpoint. 

    Business connector proxy having admin credentials

     

    XML as follow

     

    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>

    - <Envelope xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
    - <Header>
      <MessageId>{B376A929-B2CE-4383-B170-85FA8198CD68}</MessageId>
      <SourceEndpoint />
      <DestinationEndpoint />
      <Action>http://schemas.microsoft.com/dynamics/2008/01/services/ledgerChartOfAccountsService/Create</Action>
      </Header>
    - <Body>
    - <MessageParts>
    - <ChartOfAccounts xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/ChartOfAccounts">
      <DocPurpose>Original</DocPurpose>
      <SenderId>dat</SenderId>
    - <LedgerTable class="entity">
      <_DocumentHash>eff5cbf1be832de20fd36217878ee18e</_DocumentHash>
      <AccountName>R2</AccountName>
      <AccountNameAlias>R2</AccountNameAlias>
      <AccountNum>R1</AccountNum>
      <AccountPlType />
      <AutoAllocate />
      <BlockedInJournal />
      <BoldTypeface />
      <Closed />
      <ConversionPrinciple />
      <DebCredBalanceDemand />
      <DebCredCheck />
      <DebCredProposal />
    - <Dimension>
      <element />
      <element />
      <element />
      <element />
      <element />
      <element />
      <element />
      </Dimension>
      <ExchAdjusted />
      <Italic />
      <LedgerClosing />
      <LineExceed />
      <LineSub />
      <MandatoryCurrency />
      <MandatoryPaymReference />
      <MandatoryPosting />
      <MandatoryTaxCode />
      <MandatoryUser />
      <Monetary />
      <Posting />
      <RecId />
      <RecVersion />
      <ReverseSign />
      <TaxDirection />
      <TaxFree />
      <TotalByPeriod_FR />
      <UnderlineNumerals />
      <UnderLineTxt />
      </LedgerTable>
      </ChartOfAccounts>
      </MessageParts>
      </Body>
      </Envelope>
  • Hi Richa,

     The error which you observe is because of the following reason.

    1) Message ID: {1652FD2C-C3D4-4B90-9815-369BAF917D98}, In Transport Process.The record already exists.
    Because the same Message Id exists in the xML due to which it throws error stating "Cannot create a record in Gateway Queue (AifGatewayQueue)." So the solution is when xML is placed in the xML folder please update the MessageId. Change any two character in the message Id and this error will not be populated again.

    2) SubSystemName : AifRequestProcessor-processServiceRequest. User is not authorized for this Endpoint. 
    In the xML THERE is an entity tag missing
    <SourceEndpointUser>Domain\UserName</SourceEndpointUser>
    You need to pass the user credentials for the Xml to process AIF xml when consuming.

    Hope this solution was useful to you. Please revert back in case of any issue.

     

    Regards,

    Santosh.R

    Please don't print this email unless you really need to. This will preserve trees on our planet.

  • Thanks Satosh for reply.

    I am able to import XML in to AX 2009.

    i have query for importing 1 XML which contain data nodes for 2 tables that should be get imported into  VENDTABLE and VENDBANKACCOUNT . Is there any configuration we need to do for  parent and child relation table.

     

    Thanks & Regards,

    RM

     

  • Richa,

     Well if you have a AxD query then you should be able to import the xML. As such we dont need any configuration to be setup.

     The think your query will be like this

    VendTable -------> VendBankAccount

    Relation being between both these tables are "VendAccount" and Fetch Mode is 1:n, Join Mode: Inner Join

    Accordingly you will have a AxD class where you need to handle the scenario.

    1) If vendAccount, VendBankAccount exist insert into relating table else throw error

     

     

     

    Regards,

    Santosh.R

    Please don't print this email unless you really need to. This will preserve trees on our planet.

  • Hi Santosh,  

    How we can create AXD classes which will states relationship between Vendtable and VendBankAccount (VendAccount) ?

    then do we need to create service class for this?

     

    Thanks & Regards,

    RM 

     

  • Richa,

    The basic prerequisite is to create a AxD query under AOT\Queries node. You need to define your relationship(JoinMode, FetchMode) in the Query based on the Business needs. Then you need to run the Application Integration Framework (Tools> Development Tools > Application Integration Framework > Create Document service).

    It will create AxD(Ax Document class) and AxBC (Ax business class) along with the services(which can be viewed under AOT\Services)

    To write create functionality you need to write the business logic under Ax<Table name> Class(AxD) in PrepareForSave method.

    There is no need for you to create service class and this gets generated through the AIF wizard.

     

    Regards,

    Santosh.R

    Please don't print this email unless you really need to. This will preserve trees on our planet.

  • Hi Deva,

    I still facing such issues even though i'm applying your method, but it still not working... Do you have any idea? Mine one is using MSMQ. Kindly advise. Thanks 

     

  • Hello Santosh,

    I am trying to do an AIF inbound transfer using file system adapters. I have an XML file in a windows folder that is given complete share and access permissions and is assigned as the Inbound channel.

    I created batch jobs having tasks that run AifGatewayReceiveService and AifInboundProcessingService.

    In case of endpoints, instead of using default endpoints, I have created another endpoint and gave the corresponding local endpoint (the local endpoint pertains to the current company)

    All other configurations(channels, actions, services are set). Also, i know that the service is running successfully, as I am able to create production orders in AX by using the same AIF document service as a web service in .NET.

    But here, with the file system adapters, the bacth job is not doing anything. i do not even see errors or exceptions in the AIF section. nothing in the queue manager either.

    Is the problem with my XML message or with the way the endpoints are configured?  Would there usually be any issues if we do not use the default endpoint and create one of your own?

    Thanks in advance

    Regards,

    Ray.

  • Hey Ray,

    I'm not sure why this is happening to you. But lets first try to do basic troubleshooting steps.

    1) I hope the XML file is available in windows folder with complete share and access permissions and is assigned as the Inbound channel. If so then write the following code in the Jobs path and run it and check if the xML is picked?

    void AIFInboundJob()
    {
        ;

        new AifGatewayReceiveService().run();
        new AifInboundProcessingService().run();
    }

    Even after executing the job if the xML is still available in the folder. Check for AifResourceLock table and see if this record has some lock. In case if its then pls delete it and try executing the Inbound job.

    I hope this should solve your issue. In case if your still facing the issue please revert back to me to all the details. Alternatively you can allow refer few articles on AIF in my blog.

    http://sangi1983.spaces.live.com  (The above site will be redirected to my Word press blog)

  • hi deva, one things i want to know. why did you not use the Default Endpoint provided by Dynamics AX, and created your own.