Exception handling while using WCF-SQL Adapter

Hi all,

While doing transformations from Excel or Flat file to EDI, i had made use of "Microsoft.XLANGs.BaseTypes.DeliveryFailureException" in the exception block of Orchestration and used to save these to a dedicated "Faults" folder.

Now, while doing transformations from Excel or Flat file to SQL, using WCF-SQL adapter, I am not able to achieve the same.

I am referring the below links,

http://www.codeproject.com/Articles/13576/A-developers-guide-to-handling-exceptions-in-BizTa

http://kentweare.blogspot.co.uk/2007/11/biztalk-delivery-notification.html

https://social.msdn.microsoft.com/Forums/en-US/66abdc3a-82a0-419f-acf6-c5c0d506d4f4/catch-sql-server-send-port-one-way-wcfsql-exception-in-orchestration?forum=biztalkr2adapters

https://connectedcircuits.wordpress.com/2014/01/17/handling-sql-errors-in-try-catch-blocks-using-the-wcf-sql-adaptor/

But, still am not able to achieve success. Please let me know the best steps to achieve this.

Thanks in Advance,

January 30th, 2015 5:03pm

BizTalk delivery notifications (i.e. Microsoft.XLANGs.BaseTypes.DeliveryFailureException) do not work with request-response ports. They only work with one-way ports (where a negative acknowledgments triggers the DeliveryFailureException). And since WCF send adapters do not support one-way WCF operations, then WCF ports must be request-response and thus they do not support delivery failure notifications.

When you have WCF-SQL adapter with solicit-response (two-way) port, you dont need to worry much. When you send the request to execute the insert, if it works you will get response otherwise you will not get any response. So when you dont get the response, handle it in exception handler.

Refer Ashwin's suggestion here-> WCF-SQL exception handling In orchestration

Also BizTalk WCF Exception Handling Scenarios 

Rachit

Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 5:20pm

And since WCF send adapters do not support one-way WCF operations, then WCF ports must be request-response and thus they do not support delivery failure notifications.


Are you sure about this?  I use One-Way WCF Ports all the time.  Delivery Notifications is a feature of the Messaging Engine and is not Adapter specific.
January 30th, 2015 5:41pm

John correct me if I am wrong.

My understanding was the WCF Adapter cannot handle one-way contracts easily. You need to write a custom binding element which only supports one-way channels and for this we need to use the WCF-Custom adapter, since that is the only adapter which allows you to add behaviors or configure the customBinding binding with user-specified binding elements.

Rachit


Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 6:02pm

I have for sure used sqlBinding, oracleDBBinding, webHttpBinding with One-Way Send Ports, always with the WCF-Custom Adapter.

It works perfectly fine when you don't care about the response content.  For http, anything other then 2xx will still raise an error.

My assumption, never looked because it never mattered, is the bridge adapter (WCF-Custom) just ignores the binding's response.  The bindings themselves are still essentially Two-Way.

The Wizard will always make Two-Way Binding Files so you do have to modify them to create One-Way Ports.


January 30th, 2015 8:45pm

I have for sure used sqlBinding, oracleDBBinding, webHttpBinding with One-Way Send Ports, always with the WCF-Custom Adapter.

It works perfectly fine when you don't care about the response content.  For http, anything other then 2xx will still raise an error.

My assumption, never looked because it never mattered, is the bridge adapter (WCF-Custom) just ignores the binding's response.  The bindings themselves are still essentially Two-Way.

The Wizard will always make Two-Way Binding Files so you do have to modify them to create One-Way Ports.


Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 8:45pm

I have for sure used sqlBinding, oracleDBBinding, webHttpBinding with One-Way Send Ports, always with the WCF-Custom Adapter.

It works perfectly fine when you don't care about the response content.  For http, anything other then 2xx will still raise an error.

My assumption, never looked because it never mattered, is the bridge adapter (WCF-Custom) just ignores the binding's response.  The bindings themselves are still essentially Two-Way.

The Wizard will always make Two-Way Binding Files so you do have to modify them to create One-Way Ports.


January 30th, 2015 8:45pm

Hi All,

Thanks for your inputs. I was able to catch the Delivery Notification Exception and route it to some Faults folder.

Also, can you please help me with useful links on terminating/suspending the orchestration instance as soon as I get any error.

1 more thing is,  I am getting the custom message in the Faults Folder like the below:

<?xml version="1.0"?>
<string>An error occurred while processing the message, refer to the details section for more information 
Message ID: {1002C8A9-689D-4538-B8D8-CC98C8036E94}
Instance ID: {83A0A779-9467-4127-B212-03A6F9EE4AD4}
Error Description: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The input data for the field/parameter "Parameter1" is larger than that allowed on the SQL Server. Maximum length allowed is 50, length found was 263.

Is there any easy way so that along with the message above, showing the line number or the fault value. (As there will be thousands of records in the input excel file)

Thanks in Advance,

Free Windows Admin Tool Kit Click here and download it now
February 1st, 2015 7:16am

Hi,

Once you catch the exception and route the exception message to a folder you can then add Terminate Shape or Suspend shape so that control doesn't goes further after exception.

Refer the links below:

Delivery Notification demystified

http://johnnystechnicallife.blogspot.in/2012/08/must-receive-before-sending-fault.html

BizTalk - Biztalk Delivery Notification=True

How to Configure the Terminate Shape

Using the Suspend Shape

I think you have already set IncludeExceptionDetailInFaults = true option. This error is thrown back my database, as per my understand there is no way you can get the line number or the fault value where the exception has occurred. You are getting the field/parameter name and I think it should suffice, specify if otherwise. 

Rachit

February 1st, 2015 12:15pm

Also, can you please help me with useful links on terminating/suspending the orchestration instance as soon as I get any error.

Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2015 12:47am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics