24 March 2014

Four Simple Steps to Create Web Services and Use Them in Microsoft InfoPath

Four Simple Steps to Create Web Services and Use Them in Microsoft InfoPath

In our latest release (1303) of Business Integration Solutions for Microsoft Dynamics AX we shipped To-Increase Web Service Studio. This solution gives you a very simple and flexible tool to create web services that interact with Microsoft Dynamics AX 2012, without worrying about all the technical details. In today’s scenario, I will show you how to create a web service that retrieves vendor groups from AX and implement it in an InfoPath form. If you work through the example, you can easily create and deploy a web service in AX and use it right away.

When you use Web Service Studio, you just need to take four steps to create and integrate web services with forms in Microsoft InfoPath Designer:

  1. Create a web service in Web Service Studio.
  2. Look up the WSDL file on the website.
  3. Create an InfoPath designer form.
  4. Set the query and data fields.

Create a Web Service in Web Service Studio

To create a new web service open Business integration solutions/Common/Web service/Web services

We create a new web service by using the New option, fill the project with demo and call our web service VendGroups. We add one line and select the table VendGroup. The other fields are set by default and can remain unchanged because this example is based on only one table.

Now, we need to select the fields that we would like to use in our web service. Here, for example, we select the Vendor Group ID, the name of the group, and the payment terms. When done, switch to the range tab, and add field VendGroupId with argument type Attribute.

4 Web Service - 1

This completes the setup of the web service. Switch to the Development tab and test the web service by using the Read option.

Look up the WSDL File on the Website

Open the following address in your browser: http://localhost:8080/Webservice and open the VendGroups WSDL document. Copy the address from the address bar to your clipboard.

Create an InfoPath Designer Form

Launch the InfoPath application and create a new form based on the Web Service template. Select to receive data and use the WSDL address from the previous step. Select the operation getVendGroups in the next screen. Finish the wizard.

4 Web Service 2

Set the Query and Data Fields

In InfoPath Designer, drag the fields from the right side of the screen into the design on the left side of the screen. Put the query fields in the query area and the data fields in the data area.

4 Web Service 3

This is all that you need to do! Now you can test the form. Use the Preview option and run the query by clicking on the Run Query option.

The following vendor group list appears on your screen:

4 Web Service 4

To learn more about Web Service Studio please visit Web Service Studio page or contact us.

Arend Post
Arend Post,
Arend Post,
Solution Architect for Dynamics AX Arend helps To-Increase customers and the partners supporting them gain the highest possible value from their investment in Microsoft Dynamics AX by means of continuous enhancements in To-Increase’s Business Integration Solutions. Before Arend began working at To-Increase, he spent many years as a principal software engineer, project manager, and principal technical consultant at such companies as Infor and SSA Global.

Also interesting