How to Integrate Web Services with Microsoft BizTalk in Five Actions
Table of contents
As we mentioned before, in our latest release (1303) of Business Integration Solutions for Dynamics AX we shipped STAEDEAN Web Service Studio. This solution gives customers 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 show you how to integrate web services created in Web Service Studio easily with an application such as Microsoft BizTalk. We take five steps to integrate the SalesOrder web service with a BizTalk application that can read sales order information from AX and can use the same web service to post sales orders to AX.
It takes a short sequence of five simple steps to integrate web services with Microsoft BizTalk 2013:
- Select a tutorial web service in Web Service Studio.
- Look up the WSDL file on the website.
- Create a BizTalk project in Visual Studio.
- Deploy and configure the application.
- Test the application.
Select a Tutorial Web Service in Web Service Studio
To select a web service open Business integration solutions/Common/Web service/Web services
For this scenario we will use the SalesOrder web service which is part of the prebuilt project Tutorial Web Service Studio.
This web service supports both the get and post operations, which means that it can be used to retrieve sales orders from AX and to insert new sales orders into AX. The web service consists of the order header, the order lines, and the item details on a line.
Use the Read option on the development tab page to verify the XML output for one order or multiple orders of a customer.
Look up the WSDL File on the Website
Open the following address in your browser: http://localhost:8080/Webservice and open the SalesOrder WSDL document. Copy the address from the address bar to your clipboard.
Create a BizTalk Project in Visual Studio
Launch Visual Studio 2012 and create a new project called SalesOrder for a BizTalk Server application. A sample project is located in folder VisualStudioBizTalk in the STAEDEAN installation folder.
Right-click on the SalesOrder project and click on the Add > Add Generated Items context menu.
Click on Consume WCF Service and on the Add button in the screen below.
Paste the SalesOrder WSDL from your clipboard URL field and click on the Get button.
This will generate the BizTalk schemas to consume the web service. Along with schemas, the wizard will create an empty orchestration, port types, and binding files to create the BizTalk send ports.
Deploy and Configure the Application
Right-click on the project properties and click on the tab Deployment. Specify the Application Name as SalesOrder and Build and Deploy the solution.
Now, switch to the BizTalk Server Administration Console. Here you need to configure the send ports and receive ports.
Import the sample bindings that are available on the demo vpc in the folder BizTalk. You can import these on the application SalesOrder. Right-click on the SalesOrder node, and select Import > Bindings… to load them. The msi file is available in the same folder, for when you want to import the full application.
When you choose to configure the ports of the application yourself, please read the Web Service Studio Installation Instruction document and follow the detailed instructions in chapter 3.
When done, enable the send ports and the receive port and start the application.
Test the Application
Because the settings of the application are changed, the host instance needs to be restarted. Otherwise the changes will not be effective at runtime. In the Web Service Studio Installation Instruction document two XML files are mentioned. Create these files and drop them in the In folder. BizTalk will construct the SOAP message for the web methods and sends to web service, get web response messages, and route them to OUT or Error folders as per the subscription filters.
To learn more about Web Service Studio please contact us.