catching 404 errors with the WCF-WebHttp adapter

Hi

I am consume a Rest Service (GET verb). This service can return a 404 if what I am searching for is not found (standard pattern in REST). This raises a System.Web.Services.Protocols.SoapException in BizTalk which I can catch in my Orchestration, problem is its not exactly obvious that is a 404 

This the error I get back is "There was no endpoint listening at xxx that could accept the message."

Is there a way to capture the code coming back, do I need to implement a custom behavior to inspect HTTP header status property or do I have to deal with string searches etc in the exception text looking for no endpoint listening or similar?

thanks

August 28th, 2015 4:25am

Hi Jody,

For catching protocol exception consider the below links. You have to create a custom binding element which in turn will create the corresponding WCF channel to handle the interaction with the service, so once the ProtocolException comes you can handle it.

http://social.technet.microsoft.com/wiki/contents/articles/16625.biztalk-server-rest-services-error-handling.aspx

http://blogs.msdn.com/b/endpoint/archive/2010/01/21/error-handling-in-wcf-webhttp-services-with-webfaultexception.aspx

Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 5:07am

I am using 2013R2 I have seen these posts but was hoping its easier with 213R2
August 28th, 2015 5:10am

I am using 2013R2 I have seen these posts but was hoping its easier
Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 5:18am

Hi,

404 is a protocol exception and to capture protocol exception in web http adapter you can follow the same link

https://social.technet.microsoft.com/Forums/en-US/9ba38212-0837-4f54-9bac-6670ef2e13a0/wcfwebhttp-biztalk-2013-how-to-catch-http-400-response?forum=biztalkr2adapters

We have discussed this on the forum and you can take referece from there as well

https://social.technet.microsoft.com/Forums/en-US/9ba38212-0837-4f54-9bac-6670ef2e13a0/wcfwebhttp-biztalk-2013-how-to-catch-http-400-response?forum=biztalkr2adapters

Thanks

Abhishek

August 28th, 2015 5:46am

ok sounds like to implement this I would need to use the blogicalREST starter kit instead of the new adapter in BT2013??
Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 6:17am

ok sounds like to implement this I would need to use the blogicalREST starter kit instead of the new adapter i
August 28th, 2015 6:25am

forgive my ignorance, but if I use a custombinding how do I set the query string to set up my GET operation. Will I need to also implement that somehow?

Thats why I asked if I needed the start kit. I want to stiil use ws-webhttp

Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 11:06am

Hi Jody ,

You need to configure HTTP Method and URL Mapping in web http adapter configuration .you need to add  GET method and the URL.

Something like below

Please refer:https://shadabanwer.wordpress.com/2013/07/24/using-wcf-webhttp-receive-adapter-for-http-getpost-url-rewrite/

https://seroter.wordpress.com/2013/03/19/yes-richard-you-can-use-ampersands-on-the-biztalk-rest-adapter-and-some-asp-net-web-api-tips/

Thanks

Abhishek


August 28th, 2015 11:13am

Again, with a custom binding and webhttp binding you do not have this screen.

J

Free Windows Admin Tool Kit Click here and download it now
August 29th, 2015 2:44am

Hi,

Please Refer :http://snefs.blogspot.in/2013/08/biztalk-2013-replace-http-adapter-by.html

This is the step by step guide to configure webhttp adapter.

Also below links can be helpful to you

https://shadabanwer.wordpress.com/2013/07/24/using-wcf-webhttp-receive-adapter-for-http-getpost-url-rewrite/

http://soa-thoughts.blogspot.in/2013/03/biztalk-server-2013-new-adapters-series.html

Thanks'

Abhishek



August 29th, 2015 2:57am

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

Other recent topics Other recent topics