How to create an itinerary is well documented but what is the best way to test your itinerary? In a production environment you normally have an On-Ramp that gets the itinerary from the Itinerary Store database so you first have to create a Receive Port with a Receive Location and you also have to configure the Pipeline with the Itinerary name or Business Rule Policy. It’s no rocket science but if you just want to test the itinerary you don’t want to do all those steps. Luckily you don’t have to because the ESB Toolkit comes with four types of Web-Based Itinerary On-Ramps. These On-Ramps were created at the installation of the ESB Toolkit and are designed to receive any XML message. Note that these On-Ramps are ideal for testing but are less suited for a production environment because the message is described with an anyType Type in the WSDL and most of the clients require a typed message.
Web-Based Itinerary On-Ramps in ESB Toolkit:
• One-way ASMX • One-way WCF • Request/Response ASMX • Request/Response WCF
The ASMX on-ramps expect the ESB itinerary content in the SOAP header. You have two kind of WCF on-ramps. One that expects a reference to the ESB itinerary in the SOAP header and the Generic WCF on-ramp that expects only the request message. In a production environment you only want to sent the message but for testing it’s more convenient to also send the itinerary with the message because in that case you don’t have to configure the Pipeline in the Receive Location and you don’t have to deploy the itinerary to the Itinerary Store database.
The ESB Toolkit also comes with a Itinerary Test Client tool to test itineraries. It’s provided as a sample so to use it you first have to uncompress the ESBSource.zip file from the installation folder into the C:\Projects\Microsoft.Practices.ESB folder. In “..\Source\Samples\Itinerary\Source\ESB.Itinerary.Test” is the tool located.
Exporting the itinerary as XML enables you to test the itinerary using the Itinerary Test Client. In the Itinerary Model properties window:
To test an itinerary using the Itinerary Test Client:
Note that when you send a message to an On-Ramp, you get the following message box. This only means that the message is successfully sent and not that it’s successfully processed by BizTalk!
Have fun with testing!