Introduction

This sample demonstrates how to integrate web application running on-premises or in the cloud with two ways WCF Service, via Azure BizTalk Services.

Scenario

Contoso wants to integrate his own web application with vendor inventory service.

So contoso has create a solution in Azure BizTalk services , Which enables the following :

  • Receive XML Request from web application
  • Send Request to Vendor Inventory Service .
  • Receive Response from Inventory Service
  • Send Response Back to Web Application 

Architecture

The following diagram shows the architecture of the solution.

Prerequisites

  • Visual Studio 2012 Express for Windows 8
  • Microsoft Azure BizTalk Services SDK for Windows 8
  • and a Windows Azure account (get the Free Trial)

Step by Step 

Create WCF Service and Host it on cloud

  • Create a Windows Azure Cloud Service Project.

  • Add WCFServiceWebRole.

  • Change The Iservice class to IVendorInventoryService.

  • Change the code for VendorInventoryService.

  • Create the Package to deploy on Cloud.

  • Deploy package on Cloud.
  • Log on to cloud portal.
  • Click on New Cloud Service.

  • Enter the name of Service.

  • Click the “Deploy even if one or more roles contain a single instance”.

  • You can check in IE if the Service is hosted properly.

  • Test the WCF Service using SOAP UI.

Create The BizTalk Services

  • Create the BizTalk Service project.

  • Create Input Schema for receive request from web / HTML Application. 

  • Add another XML Schema Inventory Response.

  • Create XML Structure for InventoryResponse.

  • Generate Schema for Service using add Schemas from service Wizard.

  • Enter the end point of service.

  • Click on Get and Import , to include schema into solution.

  • Create Map for convert Inventory Request to Inventory Service Request. 

  • Create Map for Inventory Service Response to InventoryResponse.

  • Configure XML RequestReplyBridge.
  • Configure Message Type of Request and Response of Bridge.

  • Configure Map for Request Message.

  • Configure Map for Response Message.

  • Set the runtime address of Two Way External Service.

  • Set the filter condition of link.

  • Set Action.

  • Set the BizTalk Service URL of MessageFlowIternary.

  • Deploy the Solution.

  • You can check if the application is deployed properly by checking in the Portal resources.

Test the Solution

  • Send Message to Bridge using BizTalk Services Explorer.

  • Load the Sample Instance and Send the request.

Possible Error

The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

Solution: if you have not add proper Action in Soap action then this Error will come, you can check the action from wsdl of service

Source Code

The source code can be found in the TechNet Wiki Gallery here:

See Also

For documentation on BizTalk Services see Azure BizTalk Services documentation.

Another important place to find a huge amount of Azure BizTalk Services related articles is the TechNet Wiki itself. The best entry point is Azure BizTalk Services resources on the TechNet Wiki.

If you are also looking for BizTalk Server related articles, the best entry point is BizTalk Server Resources on the TechNet Wiki.