” …I have published an orchestration as a web service and consumed it from an aspx page. now, how do I see if I triggered the orchestration and how and where do I get the output (transformed message of the orchestration)? …


It is a very common question, how to debugging the BizTalk applications.

Have you ever tried to use the BizTalk Orchestration Debugger? So painful experience. Never see the BizTalk developer who is using it in real work.

 

One simple decision is creating the direct test send ports.  (http://blogs.msdn.com/kevin_lam/archive/2006/07/07/659214.aspx, http://geekswithblogs.net/LeonidGaneline/archive/2006/12/18/101541.aspx)

Test port is a port with the filter expression (http://msdn2.microsoft.com/en-us/library/aa578042.aspx, http://msdn2.microsoft.com/en-us/library/aa547903.aspx). This expression creates the subscription to the message you interested in.

All sent and received messages go through the MessageBox. When they pass MessageBox you can create additional subscription to these messages and intercept copies of these messages.

The subscription can be to the message type or to the publisher parameters like Receive port name.

This technique has great benefits:



  • The direct test send ports do not disturb the original message flow (excluding the rare case when all main subscriptions to the debugged message have got unenlisted).


  • They can be easily switch on/off.

As a matter of fact I use two methods on the regular basis. (The second one is the old good Trace.WriteLine(..) with DebugView.exe as a receiver of the debug output.) That means I always create the orchestrations with the Expression shapes (for Trace.WriteLine)) after all message receives/transformations, in the begin/end all branches, plus I create the test send ports for almost ALL messages.

 

Yes, for ALL output messages.

It is easy and fast to create the test send ports in the binding file without using UI.

And I always deploy these test ports to the production. It saved me a lot of time in deployment and maintain.