Sunday, October 6, 2013

How to expose Webservice through AIF framwork in Ax2012 R2 version.

Hi Friends,
Today I am going to discuss on creation of web service in Ax2012 application and how to expose the service to 3rd party by using the AIF concept.

1.I have created  my own customize Table.


2.Create a query by using 'AXD' prefix and add that table.

3.Go to the Tools>AIF>create Document service.

5.Select the created query here and provide the document class name.




 
 
6.Select the operations which you want to expose.
7.Finish the wizard and it will create a private project which contains all the necessary objects which will be needed when exposing a service. 
    a. The Ax 
classes (sometimes referred to as AxBC classes) manage data, manage access to and from the tables, encapsulate the business logic that is available through the corresponding form, create default field values, and provide an object interface to the individual tables.



b.The Axd class is responsible for maintaining the internal data for the document and for creating XML from that data or populating itself with XML data.


 C.Service ,Document service class and Macro.
 
 
 
 
 
8.Go to the Service node and select the already created service and right click on that and register it.
 

9.It will open a form which will show you the operations which are registered already.


 If you want see the XML  click the Parameter schema.



10.Create a inbound port or you can use a existing port.
Based on your requirement you can select Basic/enhance port type.
Here I select Enhance Inbound port.
select the physical path of the website where you want to deploy.

11.Select the operations which you want to include in this inbound port.

12.Click on the Activate button and it will generate the artifact.

13.Now you can go to the VS and click on Add to reference and provide the WSDL path there.you can see all the operations there.


Common issue:
All the Aif related log records created in below location
Go to the System Adminstrator > Periodic>Services and Application Intregation Framework>Exceptions
 
 When you create a new query you might get below error.Go to the data source fields property change Dynamics parameter value from unselected to yes/no.


 When you finish the AIF document service wizard you might get below error.

 
Solution : If your business scenario require to implement cache concept then do it here or else remove the 2 methods.




 If you are unable to select the website in the Inbound port form please check the 
setup of website and try to validate it.
















































 


No comments:

Post a Comment