Home Page › Forums › BizTalk 2004 – BizTalk 2010 › how to handle a wcf EndpointNotFoundException
- This topic has 7 replies, 1 voice, and was last updated 9 years, 5 months ago by
community-content.
-
AuthorPosts
-
-
November 11, 2009 at 6:44 AM #23728
I would like to handle an EndpointNotFoundException in my orchestration.
I add a new exception handler
scope synchronized = true
exception object type = System.ServiceModel.EndpointNotFoundException (this object type doesn’t work)for the testing i stop the windows service. A wcf-custom over net.tcp adapter calls the windows service.
Fautlt:
A message sent to adapter “WCF-Custom” on send port “WcfSendPort_XXX” with URI “net.tcp://XXXXXX” is suspended.
Error details: System.ServiceModel.EndpointNotFoundException: Could not connect towhat for a exception object type should i choose, to handle the endpointnotfoundexception?
-
November 11, 2009 at 8:12 AM #23731
Hi,
You would need to reference the System.ServiceModel assembly in your orchestration project (which is a .NET Framework 3.0 assembly), then use a Scope shape with an exception handler for that type of exception.
Daniel.
-
November 11, 2009 at 8:21 AM #23733
I referenced the System.ServiceModel but the problem is that in the exception handler scope the endpointnotfault can’t be catch. I think the type is wrong?
-
November 11, 2009 at 8:36 AM #23734
Try using CommunicationException instead, as EndpointNotFoundException inherits from that class. If that doesn’t work, you can always use System.SystemException to handle the error.
-
November 11, 2009 at 9:31 AM #23735
ok thanks
CommunicationException and endpointnotfoundexception doesn’t work and the system.systemexception isn’t in the System reference list.
Do you have an other idea?-
November 11, 2009 at 10:23 AM #23737
You can find System.SystemException under the mscorlib reference when choosing the .NET Exception option in the Exception Object Type property for the Catch Exception block.
-
November 12, 2009 at 1:31 AM #23744
thank you
the System.SystemException works. Do you know what is the difference between System.SystemException and the default “General Exception” which I can choose in the “Exception Object Type” field?
-
November 12, 2009 at 7:30 AM #23752
Here’s an explanation of the General Exception that I found in a blog:
“When catching exceptions, choosing ‘General Exception’ as the Exception Object allows Catch Exception blocks to handle exceptions which are not derived from System.Exception. The .NET framework allows any class to be raised as an exception, but some .NET languages such as C# impose a tighter restriction that exceptions must be System.Exception classes. ‘General Exception’ allows BizTalk to deal with any exception it may catch (and rethrow) from an external .NET component, regardless of the language that component was written in.“
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.