views:

215

answers:

1

I have a biztalk (2006 R2) map which uses an class to provide for some custom logic that we couldn't achieve neatly through the existing functoids.

When an exception is thrown from one of the methods of this class the exception detail is, unfortunately lost (at least as far as I can see), The transform shape simply throws an exception indicating 'Function 'ScriptNS-:DoFoo()' has failed'

I've since come to the conclusion that using the Scripting functoids in a map is a recipe for disaster, but thats another discussion. My question is is there a mechanism to allow the exception detail pass up the parent orchestration?

+1  A: 

Try to use the 'System.Diagnostics.Trace' class and output stuff inside the method related to its progress. Start with outputting the input parameters as they might differ from what your method expect.

Simplified example:

System.Diagnostics.Trace.WriteLine("HelperClass XX - Method YY - This was passed from the map : " + inputParamOne);

Using a clear naming standard makes it easier to filter inside free tool DebugView, especially when on a machine running more than your stuff. I often leave this tracing in as it often proves invaluable later on. The overhead, if no listener is connected, could normally be ignored.

If you have the map deployed and running on a BizTalk development machine you could debug by performing the following steps:

  • Put a breakpoint in the method
  • Select 'Debug - Attach To Process'
  • Attach to the HostInstance process (BTSNTSvc.exe if 32-bit) handling your corresponding port or orchestration running the map.
magnus