Steps to Create Web Service in .NET and Consume in D365 F&O Project

Steps to Create Web Service in .NET and Consume in D365 F&O Project

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 F&O.

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.

Add web service URL

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.

click on Add Reference

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:

– Build and run the project and then add GetExchangeRate.asmx in the URL as shown below:

Click on the method GetLastUpdateDate to call the web service 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:

Wrapping Up

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.

The following two tabs change content below.
Avatar photo

Dipal Vyas

Team Lead (Dynamics) at Dev Information Technology Ltd.
I am Working as a Microsoft Dynamics AX Team Lead at Dev Information Technology Limited. I have worked for public as well as private sector and on overseas projects, having knowledge of Functional as well as Technical knowledge in AX.

Leave a Reply

Your email address will not be published. Required fields are marked *