I am building a BizTalk 2010 solution whereby we Receive an HL7v2 QRY message over an MLLP request/response receive port. An orchestration is directly bound to the receive port, makes a web service call and response with a custom ACK.
The orchestration is executing and making the web service call and constructing the ACK correctly. When the send shape returns the custom ACK to the receive port response, I see a suspended (not resumable) message with an error that says:
There was a failure executing the response(send) pipeline: "BTAHL72XPipelines.BTAHL72XSendPipeline, BTAHL72XPipelines, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "BTAHL7 2.X Assembler" Receive Port: "RP.MyPort" URI: "0.0.0.0:1235" Reason: Message does not contain a part with name MSHSegment
If I look a the messages tab on the service details dialog I see two messages, both of type ACK_24_GLO_DEF.
The first message contains 1 part called "part":
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP:Body><SOAP:Fault><faultcode>Microsoft BizTalk Server Negative Acknowledgment </faultcode><faultstring>An error occurred while processing the message, refer to the details section for more information </faultstring><faultactor>0.0.0.0:1235</faultactor><detail><ns0:NACK Type="NACK" xmlns:ns0="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd"><NAckID>{4C09DEDB-4317-4BD7-AB98-399D5C612626}</NAckID><ErrorCode>0xc0c016aa</ErrorCode><ErrorCategory>0</ErrorCategory><ErrorDescription>There was a failure executing the response(send) pipeline: "BTAHL72XPipelines.BTAHL72XSendPipeline, BTAHL72XPipelines, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "BTAHL7 2.X Assembler" Receive Port: "RP.Meditech.EMPI.GetDemo" URI: "0.0.0.0:1235" Reason: Serialization errors:
Error # 1
Segment Id: QRD_QueryDefinition
Sequence Number: 1
Field Number: 10
Error Number: 207
Error Description: Application internal error
Encoding System: HL7nnnn
Alternate Error Number: Z100
Alternate Error Description: Trailing delimiter found
Alternate Encoding System: HL7-BTA
Error # 2
Segment Id: QRF_QueryFilter
Sequence Number: 1
Field Number: 6
Error Number: 207
Error Description: Application internal error
Encoding System: HL7nnnn
Alternate Error Number: Z100
Alternate Error Description: Trailing delimiter found
Alternate Encoding System: HL7-BTA
</ErrorDescription></ns0:NACK></detail></SOAP:Fault></SOAP:Body></SOAP:Envelope>
The second message has 3 parts (MSHSegment, BodySegments, and ZSegments):
<ns0:MSH_25_GLO_DEF xmlns:ns0="http://microsoft.com/HealthCare/HL7/2X"><MSH><MSH.2_EncodingCharacters>^~\&</MSH.2_EncodingCharacters><MSH.3_SendingApplication><HD.0_NamespaceId>ADM</HD.0_NamespaceId></MSH.3_SendingApplication><MSH.4_SendingFacility><HD.0_NamespaceId>IHSLH</HD.0_NamespaceId></MSH.4_SendingFacility><MSH.5_ReceivingApplication><HD.0_NamespaceId></HD.0_NamespaceId></MSH.5_ReceivingApplication><MSH.6_ReceivingFacility><HD.0_NamespaceId></HD.0_NamespaceId></MSH.6_ReceivingFacility><MSH.7_DateTimeOfMessage><TS.1>20130521000513</TS.1></MSH.7_DateTimeOfMessage><MSH.8_Security></MSH.8_Security><MSH.9_MessageType><CM_MSG.0_MessageType>QRY</CM_MSG.0_MessageType></MSH.9_MessageType><MSH.10_MessageControlId>VJHREGC7.20135210513272</MSH.10_MessageControlId><MSH.11_ProcessingId><PT.0_ProcessingId>P</PT.0_ProcessingId></MSH.11_ProcessingId><MSH.12_VersionId><VID_0_VersionId>2.1</VID_0_VersionId></MSH.12_VersionId><MSH.13_SequenceNumber></MSH.13_SequenceNumber></MSH></ns0:MSH_25_GLO_DEF>
<ns0:ACK_24_GLO_DEF xmlns:ns1="http://mycompay.com/myapp/HL7/2X/2.1/interface/v1/Segments" xmlns:ns2="http://mycompay.com/myapp/HL7/2X/2.1/interface/v1/Tables" xmlns:ns3="http://mycompay.com/myapp/HL7/2X/2.1/interface/v1/DataTypes" xmlns:ns0="http://mycompay.com/myapp/HL7/2X/2.1/interface/v1"><MSA_MessageAcknowledgment><MSA.1_AcknowledgmentCode>AE</MSA.1_AcknowledgmentCode><MSA.2_MessageControlId>VJHREGC7.20135210513272</MSA.2_MessageControlId><MSA.3_TextMessage>Error calling EMPI web service</MSA.3_TextMessage></MSA_MessageAcknowledgment><QRD_QueryDefinition><QRD_1_QueryDateTime><TS_0_TimeOfAnEvent>20130521000513</TS_0_TimeOfAnEvent></QRD_1_QueryDateTime><QRD_2_QueryFormatCode>R</QRD_2_QueryFormatCode><QRD_3_QueryPriority>I</QRD_3_QueryPriority><QRD_4_QueryId>KORL3</QRD_4_QueryId><QRD_5_DeferredResponseType></QRD_5_DeferredResponseType><QRD_6_DeferredResponseDateTime><TS_0_TimeOfAnEvent></TS_0_TimeOfAnEvent></QRD_6_DeferredResponseDateTime><QRD_7_QuantityLimitedRequest><Quantity>99</Quantity><Code>RD</Code></QRD_7_QuantityLimitedRequest><QRD_8_WhoSubjectFilter><HCISInternalID>A1-.VJ10341</HCISInternalID><PHN>9089478173</PHN></QRD_8_WhoSubjectFilter><QRD_9_WhatSubjectFilter>MPI</QRD_9_WhatSubjectFilter><QRD_10_WhatDepartmentDataCode></QRD_10_WhatDepartmentDataCode></QRD_QueryDefinition><QRF_QueryFilter><QRF_1_WhereSubjectFilter>UPI</QRF_1_WhereSubjectFilter><QRF_2_WhenDataStartDateTime><TS_0_TimeOfAnEvent></TS_0_TimeOfAnEvent></QRF_2_WhenDataStartDateTime><QRF_3_WhenDataEndDateTime><TS_0_TimeOfAnEvent></TS_0_TimeOfAnEvent></QRF_3_WhenDataEndDateTime><QRF_4_WhatUserQualifier></QRF_4_WhatUserQualifier><QRF_5_OtherQrySubjectFilter><PHN>9089478173</PHN><LastName>Herd</LastName><FirstName>David</FirstName><MiddleName></MiddleName><Gender>M</Gender><DateOfBirth>19400419</DateOfBirth><AddressLine1>6A 1059 Shuswap Ave</AddressLine1><AddressLine2></AddressLine2><City>Sicamous</City><Province>BC</Province><Postal>V0E 2V1</Postal><HomePhone>250-804-8287</HomePhone><EMPI_OtherQrySubjectFilter_13></EMPI_OtherQrySubjectFilter_13><EMPI_OtherQrySubjectFilter_14></EMPI_OtherQrySubjectFilter_14><EMPI_OtherQrySubjectFilter_15>S</EMPI_OtherQrySubjectFilter_15></QRF_5_OtherQrySubjectFilter><QRF_6></QRF_6></QRF_QueryFilter></ns0:ACK_24_GLO_DEF>
<string />
Because I can see the 3 parts in the ACK, I am suspecting the error is actually a secondary error that has something to the "Trailing delimiter found" in the first message. I'm thinking the MLLP pipeline is trying consume the first message... If that is the case how do I allow trailing delimiters? Normally I would set that in a party and associated it to the send port, but I'm not dealing with a send port here. The party for my receive port does allow trailing delimiters.
Ok, so I finally figured out that the send pipeline of my request/response receive port has a property, and I needed to set the TrailingDelimiterAllowed property to true!