Creating a .NET Web Application can be an easy process if it is done right. Our DEV IT engineers are here to guide you through the process of creating a web service in .NET and then Consuming it in D365 FO.
Firstly, you will need to import the exchange rate in AX using http://currencyconverter.kowabunga.NET/converter.asmx
Create Webservice in .NET
You must first create a webservice in your .NET project before consuming the external web service. Here are the steps you need to perform:
- Go to Visual Studio 2015 and create a New Project
- Select an ASP.NET Web Application
- Go to Solution Explorer, right click on your project and select add service reference.
Add web service URL http://currencyconverter.kowabunga.NET/converter.asmx and click on the “Advanced” button as shown in the screen below.
A new window will open as shown in the screen below:
Click on the “Add Web Reference” button and add the web service’s URL and update the web reference name as shown in the screen below. Click on “Add Reference” when done.
The web reference will be added in your project as shown below:
– Add a new item with the name “GetExchangeRate.asmx”
– Add a method to access the external web service method with the code shown below. This will allow you to access the methods of the Kowabunga web service:
/// Summary description for GetExchangeRate
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
public class GetExchangeRate : System.Web.Services.WebService
public string HelloWorld()
return "Hello World";
public string GetLastUpdateDate()
KowabungaWR.Converter cr = new KowabungaWR.Converter();
– Build and run the project and then add GetExchangeRate.asmx in the URL as shown below:
Click on the method GetLastUpdateDate to call the webservice method.
Consume the Webservice in Your Dynamics Project
– Create the Model and Project for Dynamics.
Right click on the solution explorer project and add the reference. Next, browse to the .dll file and add the .dll file of the .NET web service project in the Dynamics Project.
To verify the service, add a new Item with name Runbase Class (Job) and enter the code as shown below:
dev_KowabungaWS.GetExchangeRate KW = new dev_KowabungaWS.GetExchangeRate();
We hope that this review would have helped you understand the ins and outs of creating a .NET web service and consuming it in your D365 FO Suite. If you have any queries regarding the same, feel free to post a comment and our DEV IT experts will be happy to help you out.
Latest posts by Dipal Vyas (see all)
- Step by Step Guide to Create Restful API for Dynamics AX Data - December 14, 2021
- Steps to Create Web Service in .NET and Consume in D365 F&O Project - December 14, 2021
- Custom Service Integration with D365 F&O - November 11, 2021