Recently we received a comment from one of the students in our XSLT Training.
As shown in one of the examples he tried to throw a custom exception from an XSLT mapping and expected to find his error message in the application event log.
What he saw however was the following generic exception message:
The Messaging Engine failed while executing the inbound map for the message coming from source * with the Message * Details:”Exception has been thrown by the target of an invocation.” |
Upon inquiring about the BizTalk version used (BizTalk 2013 R2), we had an inkling what might be the issue and tried to reproduce it, using the following XSLT:
After executing this map from a Send or Receive port we found the same generic exception in the event log:
The Messaging Engine failed while executing the inbound map for the message coming from source * with the Message * Details:”Exception has been thrown by the target of an invocation.” |
When debugging the application and catching the exception, we did find the custom user exception message in the inner-exception.
To validate this behavior was new in 2013 we reverted to the old mapping engine as described in this blogpost.
Sure enough, after failing another message, we got the following entry in the event log:
The Messaging Engine failed while executing the inbound map for the message coming from source URL: * with the Message Type *. Details:”Transform terminated: ‘Error: Mapping Terminated from XSL“ |
Until recently we had to choose either to throw custom exception or use the compiled transform library, which is a shame. To receive readable exceptions from the mapping can greatly simplify the flow.
Luckily, starting from BizTalk 2013R2 CU2, you can select the mapping engine on a per transformation basis (https://support.microsoft.com/en-us/kb/3123752).
Subscribe to our RSS feed