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:
- Create a web service in Web Service Studio.
- Look up the WSDL file on the website.
- Create an InfoPath designer form.
- 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.
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.
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.
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:
To learn more about Web Service Studio please visit Web Service Studio page or contact us.