There was a failure executing the response(receive) pipeline Reason: The body part is NULL.

I came across an issue in Biztalk when receiving a Null response from a webservice.  The response raised an error in the receive pipeline:

Microsoft.XLANGs.Core.XlangSoapException: An error occurred while processing the message, refer to the details section for more information
 Message ID: {A2A8FF43-3050-42BB-9084-92DF51B6A58D}
 Instance ID: {23A411CA-9BF3-4318-9C02-814416860E1A}
 Error Description: There was a failure executing the response(receive) pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Send Port: "SendPortX" URI: "http://zzz:8080/Calendar" Reason: The body part is NULL.

at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx) .....etc

When you enable AllowUnrecognizedMessage,
xmldissor use a pass-trough  pipeline you will get:

 Microsoft.XLANGs.Core.MissingPartException: The XLANG/s message has no part at index '0'. The total number of parts found in the message is '0'. If you expect a multipart message, check that the pipeline supports multipart messages such as MIME.

If I query the webservice a filled response would be:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
 <getCustomer xmlns="http://client.com">
 <getCustomerReturn>
 <aaDate>2013-05-03T00:00:00.000Z</aaDate>
 <aaId>102312</aaId>
 <aaLength>15</aaLength>
 <aaTime>1970-01-01T12:00:00.000Z</aaTime>
 <productLinkId>A0017</productLinkId>
 </getCustomerReturn>
 </getCustomer>
 </soapenv:Body>
</soapenv:Envelope>

The Null repsonse:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
<getCustomer xmlns="http://client.com"/>
 </soapenv:Body>
</soapenv:Envelope>

The message failes because it has no bodyparts. I’ve tried using a WCF service call, tried all settings. Biztalk just cannot handle the empty repsone.

Fortunately Nick Heppleston created a pipeline component that fixes this problem. You can find the component here: http://www.modhul.com/2009/03/11/handling-a-web-service-null-response-the-createbodypart-pipeline-component/

With just 2 settings, bodypartname and what to fill it with. Make sure to fill these or you will receive a routing failure!

Cheers,
Paul

3 thoughts on “There was a failure executing the response(receive) pipeline Reason: The body part is NULL.

  1. rahamed

    Dear,
    Thanks for the link and post. I am struck in the same problem.
    Have tried to use the pipeline component, but getting error “same message part can not be added”.
    Biztalk is already creating an empty message. So just changed pipeline to assign value to body part in case of empty. Its of type string. But still error “The XLANG/s message has no part at index ‘1’”.

    Tried to remove part and add part but error “Reason: 0x80070057 “.

    Also actually there are two message parts expected in response
    one of type string and other of type xml document.
    Empty message is created for message of type string

    How to handle multipart messages for this senario

    Reply

Leave a Reply