Biztalk Exception Handling - webHTTP request response send port RRS feed

  • Question

  • I am trying to handle an exception where the response is wrapped in inner message. A lot of articles, blogs seem to be pointing me in a direction i need to go but am missing a  key component for my use case. What I have is a failed message with http status code 400 with a valid response that the request cant be processed with error text returned as to the constraint. The issue is I am unable to trigger status code returned with the error response because the  message is wrapped and unable to be evaluated directly. 

    I have added scope and catch exception handler but the issue I have now is that I am not able to determine the documentId ( an element from the original message ) From what I gather so that I can set the constructed message with the documentId and fault message from the trapped error. And send that back to the original requester the originating LOB application. I am hoping that I have access to the context containing the elements of the message that I could assign the message maybe through xpath. I am new to biztalk and xpath queries so not sure what  I am trying to do is even possible.

    Some solutions found in blogs reference creating a map of the soapfault but havent found how to do that. If that is what I need to do what I would like is the element/attributes of the soap fault with the documentId of the failed message if I could do this from the exception block in the orchestration would be helpful. 

    Sorry if this brain dead simple I have been fighting this for a few days now. Just looking if anyone is able to help me out and point me in the direction of being able to get a solution

    Tuesday, June 25, 2019 10:26 PM

All replies

  • To map from a SOAP error you need to use one of the schemas in BizTalk.System, either BTS.soap_envelope_1_1 or BTS.soap_envelope_1_2 (depending on the SOAP version of the endpoint) with Root Name Fault.
    You select that in the BizTalk Type Picker, Microsoft.BizTalk.GlobalPropertySchema and select BTs.soap_envelope_1_1 or 1_2 and then select Fault as the Root node.
    Note.  There is a bug in the WCF-WebHttp adapter in that when it creates a fault message it does not set the MessageType correctly, so it will not execute the map in the port, and I can't recall if I ever got it to work in an Orchestration either.

    You might be better off writing a XPath expression to try and get the documentId from the error payload.

    Thursday, June 27, 2019 12:39 AM