Geeks With Blogs
Koushal Deshpande kd
I have faced the issue of calling web service from BizTalk, where intermittently either service is not available or there is some problem in connecting the service. Service can return response error code which is other than HTTP 200 code ie. HTTP 400 or HTTP 500 code. BizTalk doesnt like it. Send port will treat as warning, write warning in event viewer and retries. But eventually if problem and error persists then error will be thrown from send port. This error will be received in Orchestration. 

You can set exception handler block to catch the exception i.e. System.Exception or System.EntryPointNotFoundException. You can handle the exception gracefully. But send port instance will get suspended. This will not go away unless manually terminated. Since the exception is thrown from send port and probably it is valid response, there is no point in resuming it too. If you try doing it, orchestration which had called the service has already handled exited since exception has been handled in exception handler block.
This scenario needs to be handled by a separate orchestration which we can call "SendPortExceptionHandler". This orchestration will have only one receive shape connected to receive port. It will receive message of type Raw Xml. A filter needs to be created like below:

ErrorReport.FailureCode Exists   And
ErrorReport.MessageType == schema_namespace#root_node


You can add multiple filters, so that all exceptions at send port will be handled by single orchestration.

-----------------------------------------------------------------------------------------------------------------------------

If we get exception say System.EntryPointNotFoundException and we want to handle this manually. We might get this error if end point is not available or network is down. Then we might want to suspend the orchestration and retry manually. For doing this, we need to add a loop. Add a scope in that loop. Catch the specific exception in that scope exception handler. Please see below:


In the first expression box we will initialize values for retry. 

// Set retry to true

ServiceRetry = true;
ServiceRetryCount = 0;


In the internal scope (Mule ESB Scope) I am catching System.EntryPointNotFoundException. You can add another exception handler block to throw other errors. In this block I am setting values as below:

// Set retry to true

ServiceRetry = true;
ServiceRetryCount = ServiceRetryCount + 1;

In decide shape I am checking if retry count ServiceRetryCount <= 3 then it suspends the flow else exception will thrown. It will create a finite number of retries and orchestration will exit gracefully.
In outer all other exceptions are caught and thrown back to the calling orchestration.

This way, we can handle service end point related and web exceptions in BizTalk.


Posted on Monday, March 6, 2017 3:36 PM BizTalk , Service End Point Exception , Web Exception , HTTP400 , HTTP500 , HTTP200 , There was no endpoint listening at , System.Net.WebException , This is often caused by an incorrect address or SOAP action. See InnerException , if present , for more details. Resource not found. , System.Net.WebException: The remote server returned an unexpected response: (400) BadRequest , System.Net.WebException: The remote server returned an unexpected response: (500) BadRequest | Back to top


Comments on this post: Handling Exception in calling Web Service, In BizTalk

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Hi! Thank you for the cool tips! I`m going to use them for my web service "college homework help online".
Left by Andrew Lowe on Mar 06, 2017 5:44 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Good post..Zellmeonline
Left by Anu on Mar 14, 2017 10:13 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Your post helped me to learn how to handle exceptions in calling web service. Since it is explained with a pictorial representation, the concept is very clear to me. If you provide its source code, then it will be very useful. modular home manufacturers
Left by Oshin on Mar 14, 2017 5:28 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Hi Oshin,
I dont have a prototype which is working for implementation. I have used this in project. You try to implement this and let me know if you get stuck anywhere.
Left by koushal on Mar 14, 2017 7:17 PM

# BizTalk
Requesting Gravatar...
I didn't realize that people were actually still using BizTalk !
How do you like that XSLT message mapper ?
have you tried using VB to integrate CORBA or MFC ?
Left by Josh on Mar 17, 2017 8:24 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Kotlin 1.1.2 version launched with some new features and resolves some bugs. I decided to research the upcoming changes released in past four EAP milestones and go through those that might impact Android Development.
http://www.tellmehow.co/whats-new-features-kotlin-1-1-2-version/
Left by Sawan Kumar on Jun 16, 2017 1:07 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
thank a lot for your kind information.
root explorer apk free download
Left by naeem on Jul 09, 2017 12:37 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
great post!! very informative and helpful
annotation annotated bibliography example
Left by sambhav on Jul 14, 2017 8:40 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
, I'll walk through hell with you.
geometry dash
happy wheels
Left by happywheels on Jul 17, 2017 11:39 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Handling Exception in calling Web Service, In BizTalk is a serious issue that I have been confronting for few months. So I wanted to fix the issue as soon as possible. The instructions seem to be simple and I have decided to follow those instructions strictly. face mask peel off
Left by Sam on Jul 21, 2017 9:19 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
very great stuff. here is information about the usps certified mail return receipt cost
Left by aashi on Aug 09, 2017 11:25 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
keep on sharing useful information, please have a look at USPS Tracking and USPS Hold Mail as well.
Left by evan on Aug 18, 2017 1:58 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Thanks for amazing post, this is gem :)

I like it, check my post too
Left by Kevin on Aug 31, 2017 3:29 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
This is well detailed and it helped me alot especially with my infinix hot 5 lite and infinix zero 5 which are good android phones from infinix.
Left by Maati on Sep 01, 2017 12:58 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
check the article about How to Root Samsung J7 Prime
Left by samsungroot on Oct 04, 2017 12:46 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Thanks for the very useful tips. I will use it on my call web services documented here.
Left by Rammat on Oct 21, 2017 2:00 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Thanks you very much. This is very useful to me. If you've got time check out the best latest phones from Samsung Samsung Galaxy S8 and Samsung Galaxy Note 8
Left by Matiks on Oct 21, 2017 2:08 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
thanks for the amazing stuff. here is complete detail of good night love poems and sweet good night poems
Left by naveen sharma on Oct 22, 2017 11:35 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...

thanks for the amazing stuff.
skype for iphone
https://appsforiphoneipads.com/install-skype-on-iphone-ipad-free/
Left by skype for iphone on Nov 07, 2017 1:30 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Much obliged such a great amount for sharing this marvelous data! I am anticipating see more postsby you! brian holm lawyer san diego
Left by jk on Dec 07, 2017 3:37 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
this is amazing post hope you don't forget yo check my post workbench and worktable review
Left by Vikash on Dec 14, 2017 9:56 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Don't forget to check my post : Workbenches Reviews Here
Left by Vikash on Dec 18, 2017 9:31 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
this Article is about Kingroot Apk and its uses and we discuss step by step process how to install the Kingroot for PC. If you are looking the guidance, this content will help you all the way. The rooting application is one of the essential things among the people that who all are using Android devices.
Kingroot APK
Left by kingroot apk on Jan 03, 2018 1:11 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Using the exception handler block to catch the exception seems to be the easiest way of dealing with the issue. Many users are reporting the same issue recently and need to be fixed. Thanks for sharing the information regarding the same here. hotel metropole beach house
Left by lionel on Jan 12, 2018 4:20 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Attracting and retaining top talent remains a significant recruiting challenge for many organizations. Rekrutteringsfirma
Left by Steve on Feb 05, 2018 11:54 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
This was interesting to read. Perhaps, if you have time on your hands, you should check out this interesting phone.
Left by Felix on Feb 13, 2018 9:21 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Most of them are facing this same issue during calling web service from BizTalk. Thanks for sharing this tips this is really helpful to me to handle this issue. You have presented this article in easily understandable ways and like the style of presentation. Keep sharing more articles.local print spooler service is not running
Left by ann on Feb 16, 2018 4:16 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
But what makes Instagram so successful and prosperous for marketers?Things like visual aesthetics and ease of use make Instagram marketing strategies essential for businesses. Instagram Follower Kaufen
Left by Hulk on Feb 18, 2018 3:24 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
This is the kind of manual that needs to be given and not the random misinformation that's at the other blogs.
gmail login
Left by Anna Shetty on Feb 19, 2018 12:47 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...

All the students who are appeared in Kerala SSLC exams, those students are very panic about the results; The Board is expected to declare the SSLC Result 2018 Kerala in the second week of May 2018.
Left by SSLC Result 2018 Kerala on Mar 02, 2018 4:38 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
All the students who are appeared in Kerala SSLC exams, those students are very panic about the results; The Board is expected to declare the SSLC Result 2018 Kerala in the second week of May 2018.
SSLC Result 2018 Kerala
Left by SSLC Result on Mar 02, 2018 4:40 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
I am not sure, but it seems my comments are not getting approved. Oh well, if you want, you could take the time out to utilize being able to <a href="https://www.techsng.com/how-to-send-large-attachment-files-with-gmail-and-yahoo-mail/'>attach large files in mails or alternatively, spend some time downloading and watching movies online.
Left by Felix on Mar 06, 2018 6:44 AM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
very nice, awesome....

funny birthday meme
Left by soujanyareddy on Mar 27, 2018 3:39 PM

# re: Handling Exception in calling Web Service, In BizTalk
Requesting Gravatar...
Building a smartphone app is not that much. I'm also looking for a way to build the app for watching movies. I need the site like these mentioned on this page
Left by ritwik on Jun 04, 2018 2:20 PM

Your comment:
 (will show your gravatar)


Copyright © Koushal Deshpande | Powered by: GeeksWithBlogs.net