web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AIF AX 2009, batch job executed and not XML created

(0) ShareShare
ReportReport
Posted on by 475

I have some issues to create a XML file from Outbound service. I already set up all necessary needs to build this file. I already tested the query AxdInventSize from I have created a service. I already generate a service successfully. I am using the service operation read of that service. I have created the endpoint properly. I have checked that I have enough privileges to save this XML file in a specific folder in the AOS server. I have created a Batch job that it is running and ending without error, but I cannot see this job in queue manager. The tasks in the batch job are AifGatewayReceiveService, AifInboundProcessingService, AifOutboundProcessingService and AifGatewaySendService in this specific order. I don't have any entry in Document history and Exception form.

I really appreciate if anybody can give an idea to fix that.

Kind regards,

Josep

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    Have you send any documents to the outbound queue? If it's empty, the batch has nothing to process. See How to: Code the Outbound Exchange, for example.

  • Josep Canet Profile Picture
    475 on at

    Hi Martin, yes I am sending documents to outbound queue. I don't know if it's empty or not, and for that reason I want to debug AIF classes.

    I am sending this document by batch job, and the current batch job that I am using is working and ending without errors, but it's not creating any XML file.

    Is there any other solution to test AIF flow??

    Thanks,

    Josep

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    Disable the batch and look into the queue. A piece of cake.

    Regarding debugging, you surely can debug batch classes, but you'll simplify your life if you run the class directly, i.e. not in batch.

  • Josep Canet Profile Picture
    475 on at

    Dear Martin.

    I have tried with this code, and nothing happened.

    What does it mean to look into the queue??

       AifGatewayReceiveService gtwyReceive = new AifGatewayReceiveService();

       AifGatewaySendService gtwySend = new AifGatewaySendService();

       AifOutboundProcessingService outSvc = new AifOutboundProcessingService();

       ;

       print 'Running Gateway Receive Service...';

       gtwyReceive.run();

       print 'Running Outbound Processing Service...';

       outSvc.run();

       print 'Running Gateway Send Service...';

       gtwySend.run();

       print "AIF Services complete";

       pause;

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    When you add a document to the queue (before ever running the outbound processing service), a record gets inserted to AifOutboundProcessingQueue table. If nothing is there, nothing will be processed.

  • Josep Canet Profile Picture
    475 on at

    Thanks Martin,

    the issue is that, there is nothing saved in this table, and I want to know why.

    I am checking endpoint, action, endpointAction tables in AifSendService class now.

    I am debugging the process with this job:

    static void AIF_SendCustomer(Args _args)

    {

       AxdSendContext  axdSendContext = AxdSendContext::construct();

       AifEntityKey    aifEntityKey = AifEntityKey::construct();

       Map             keyData;

       AifConstraintList   aifConstraintList = new AifConstraintList();

       AifConstraint       aifConstraint = new AifConstraint();

       CustTable       custTable;

       ;

       custTable = CustTable::find("C00051");

       keyData = SysDictTable::getKeyData(custTable);

       aifEntityKey.parmTableId(custTable.TableId);

       aifEntityKey.parmRecId(custTable.RecId);

       aifEntityKey.parmKeyDataMap(keyData);

       axdSendContext.parmXMLDocPurpose(XMLDocPurpose::Original);

       axdSendContext.parmSecurity(false);

       aifConstraint.parmType(AifConstraintType::NoConstraint) ;

       aifConstraintList.addConstraint(aifConstraint) ;

       AifSendService::submitDefault(

           classnum(CustCustomerService),

           aifEntityKey,

           aifConstraintList,

           AifSendMode::Async,

           axdSendContext.pack());

    }

  • Community Member Profile Picture
    on at

    Hi,

    The job posted above is to process the the AifOutboundProcessingQueue and the AifGatewayQueue, but if nothing gets added to the queue there will be nothing to process as Martin mentioned. You can find this queue under Basic -> Setup -> Application Integration Framework.

    To actually add something to the queue i suggest that you have a look at \\Tables\CustInvoiceJour\methods\sendElectronically if you are going to use the read-method or one of the AxdSend-classes if you are going to use the find-method of the service.

    Use the read-method if you need to send individual records (or a list of records) or find if you want to be able to send from a query-selection.

    When this is sorted and you have records in the queue go back and run the job above or the batch-job.

  • Community Member Profile Picture
    on at

    Ok, this was already sorted :)

    Debug should tell you whats wrong or if something is setup wrong.

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    Josep, your code works in my system, therefore the problem is somewhere else. Ensure yourself once more that you have an active outbound endpoint for operCustCustomerService.read operation. If it's all right, look into the debugger - the code is relatively easy to understand.

  • Josep Canet Profile Picture
    475 on at

    Martin, thanks a lot for your help.

    Yesterday I raised to save entries in Queue Manager, and later running my batch job I got  a XML file in the shared folder.

    I need to test more because I don't want to use a job to get that.

    I want to run this process with my existing service, and my batch job created for that.

    Anyway thanks so much!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans