https://drive.google.com/file/d/0Bz2gDlDZfIivV05hUFhWU0tsZ00/edit?usp=sharing -- > Document to create Webservice.
=========================================================================http://msdn.microsoft.com/en-us/library/aa877498(v=ax.10).aspx - > view about Integrating Other Applications with AX
How to know whether AIF is configured or not in your AX :
Go to System administrator>> setup >> Services and Application Integration Framework\Websites
If you have record, copy the url and paste , if it opens then AIF is configured els no.
11
To debug the X++ code that is running in AIF, follow these
steps:
1. Enable the X++ debugging
feature in Microsoft Dynamics AX 4.0. To do this, follow these steps:
a) On the Tools menu, click
Options.
b) In the Options dialog box, click
the Development tab.
c) In the Debug mode list, click
When Breakpoint.
d) Click Apply, and then close the
Options dialog box.
2. Start the Microsoft Dynamics
AX Configuration utility.
3. In the Configuration target
list, click Business Connector.
4. On the Developer tab, click
to select the Enable user breakpoints to debug code running in the Business
Connector check box.
5. Click OK, and then close the
Microsoft Dynamics AX Configuration utility.
6. Manually start the debugging
feature. To do this, point to Development tools on the Tools menu, and then
click Debugger.Note The .Net Business Connector component cannot automatically
start the debugging feature. Therefore, you must manually start the debugging
feature.
7. Click Application Object
Tree.
8. Expand Classes, expand
AifOutboundProcessingService, and then double-click processAsUser.
9. In the
\Classes\AifOutboundProcessingService - Editor dialog box, set the character of
the processAsUser method to public.
10. Double-click run.
11. In the \Classes\AifOutboundProcessingService -
Editor dialog box, change the code as follows.Existing code
12. ...
13. //Switches to the context of the user who submitted this
request
14. //Also switches to the company under which the request was
15. //submitted.
16. // BP deviation documented
17. runas(outboundProcessingQueue.SubmittingUserId,
18. classnum(AifOutboundProcessingService),
19. staticmethodstr(AifOutboundProcessingService,
processAsUser),
20. [outboundProcessingQueue],
outboundProcessingQueue.Company);
...
Replacement code
...
//Switches to the context of the user who submitted this
request
//Also switches to the company under which the request was
//submitted.
// BP deviation documented
// runas(outboundProcessingQueue.SubmittingUserId,
// classnum(AifOutboundProcessingService),
// staticmethodstr(AifOutboundProcessingService,
processAsUser),
// [outboundProcessingQueue],
outboundProcessingQueue.Company);
AifOutboundProcessingService::processAsUser([outboundProcessingQueue]);
...
21. Set a breakpoint in the
AxdBase.validateEntityKey method.Note You can set breakpoints in other methods
that you want to debug.
22. Run the AifOutboundProcessingService service as a
service or as a batch.Note After you complete this step, the validateEntityKey
method can be broken to debug.
comments are welcome at : dvsaiprasad@gmail.com
Pasted from <http://www.dynamicstips.com/dynamics-ax/how-to-debug-the-x-code-that-is-running-in-aif-in-microsoft-dynamics-ax/>
=============================================================================================================
Debugging the X++ code that is
running in AIF in AX
To debug the X++ code that is running in AIF, follow these steps:
1. Enable the X++ debugging
feature in Microsoft Dynamics AX 4.0. To do this, follow these steps:
a) On the Tools menu, click Options.
b) In the Options dialog box, click
the Development tab.
c) In the Debug mode list, click When
Breakpoint.
d) Click Apply, and then close the Options dialog box.
2. Start the Microsoft Dynamics AX
Configuration utility.
3. In the Configuration
target list,
click Business Connector.
4. On the Developer tab, click to select
the Enable user breakpoints to debug code running in the Business
Connector check
box.
5. Click OK, and then close the Microsoft
Dynamics AX Configuration utility.
6. Manually start the debugging
feature. To do this, point toDevelopment tools on the Tools menu, and then
click Debugger.
Note The
.Net Business Connector component cannot automatically start the debugging
feature. Therefore, you must manually start the debugging feature.
Happy Daxing...!
Posted: 26 Feb 2013 01:12 PM PST
To debug the X++ code that is running in AIF, follow these steps:
1. Enable the X++ debugging
feature in Microsoft Dynamics AX 4.0. To do this, follow these steps:
a) On the Tools menu, click Options.
b) In the Options dialog box, click
the Development tab.
c) In the Debug mode list, click When
Breakpoint.
d) Click Apply, and then close the Options dialog box.
2. Start the Microsoft Dynamics AX
Configuration utility.
3. In the Configuration
target list,
click Business Connector.
4. On the Developer tab, click to select
the Enable user breakpoints to debug code running in the Business
Connector check
box.
5. Click OK, and then close the Microsoft
Dynamics AX Configuration utility.
6. Manually start the debugging
feature. To do this, point to Development tools on the Tools menu, and then clickDebugger.
Note The
.Net Business Connector component cannot automatically start the debugging
feature. Therefore, you must manually start the debugging feature.
7. Click Application
Object Tree.
8. Expand Classes, expand AifOutboundProcessingService, and then double-click processAsUser.
9. In the \Classes\AifOutboundProcessingService
- Editor dialog
box, set the character of the processAsUsermethod to public.
10. Double-click run.
11. In the \Classes\AifOutboundProcessingService
- Editor dialog
box, change the code as follows.
Existing code
12. ...
13. //Switches to the context of the user who submitted this
request
14. //Also switches to the company under which the request was
15. //submitted.
16. // BP deviation documented
17. runas(outboundProcessingQueue.SubmittingUserId,
18. classnum(AifOutboundProcessingService),
19. staticmethodstr(AifOutboundProcessingService, processAsUser),
20. [outboundProcessingQueue], outboundProcessingQueue.Company);
...
Replacement code
...
//Switches to the context of the user who submitted
this request
//Also switches to the company under which the
request was
//submitted.
// BP deviation documented
// runas(outboundProcessingQueue.SubmittingUserId,
// classnum(AifOutboundProcessingService),
// staticmethodstr(AifOutboundProcessingService,
processAsUser),
// [outboundProcessingQueue],
outboundProcessingQueue.Company);
AifOutboundProcessingService::processAsUser([outboundProcessingQueue]);
...
21. Set a breakpoint in the AxdBase.validateEntityKey method.
Note You
can set breakpoints in other methods that you want to debug.
22. Run the
AifOutboundProcessingService service as a service or as a batch.
Note After
you complete this step, the validateEntityKey method
can be broken to debug.
comments are welcome at : dvsaiprasad@gmail.com
=======================================================================
Run AIF inbound and outbound manually
To have AIF import and export message, you have to have 4
batch tasks running (all about it
here on TechNet). However, when developing, it
is inefficient (and also tad tedious) to wait for those batches.
Here are two jobs to run inbound and outbound messages manually, so
you don’t have to wait for the batches to pick them up.
Inbound:
static void ForrunAIFInbound(Args _args)
{
;
// read the messages
new AifGateWayReceiveService().run();
// process the messages in queue
new AifInboundProcessingService().run();
info("done");
}
Outbound:
static void ForrunAIFOutbound(Args _args)
{
;
// process messages in queue
new AifOutboundProcessingService().run();
// send messages
new AifGateWaySendService().run();
info("done");
}
Ofcourse, you can put this code in classes, or combine them so they
are executed together. Because inbound messages can trigger outbound messages,
it’s better to process the inbound messages before the outbound messages.
Happy Daxing...!
No comments:
Post a Comment