how to handle a wcf EndpointNotFoundException

Home Page Forums BizTalk 2004 – BizTalk 2010 how to handle a wcf EndpointNotFoundException

Viewing 1 reply thread
  • Author
    Posts
    • #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 to

       

      what for a exception object type should i choose, to handle the endpointnotfoundexception?

       

    • #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.

       

      • #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?

        • #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.

           

          • #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?

             

            • #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.

               

              • #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?

                 

                • #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.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.