Custom disassembler gives me empty message when it shouldn't.
-
Wednesday, September 05, 2012 10:05 AM
Hi
I'm developing a custom Biztalk disassembler. I fill in the body part with required data and pass it back to biztalk, but biztalk forwards an empty message to the send port. Here's the code:
public void Disassemble(IPipelineContext pContext, IBaseMessage pInMsg) { message = pContext.GetMessageFactory().CreateMessage(); message.AddPart("Body", pContext.GetMessageFactory().CreateMessagePart(), true); for (int i = 0; i < pInMsg.Context.CountProperties; i++) { string Name, Namespace; object PropertyValue = pInMsg.Context.ReadAt(i, out Name, out Namespace); // If the property has been promoted, respect the settings if (pInMsg.Context.IsPromoted(Name, Namespace)) message.Context.Promote(Name, Namespace, PropertyValue); else message.Context.Write(Name, Namespace, PropertyValue); } var parser = new CUSCAR_D95B(); var errors = new List<ApplicationException>(); var doc = parser.Parse(pInMsg.BodyPart.GetOriginalDataStream(), errors); var serializer = new XmlSerializer(typeof(EdiDocument)); message.BodyPart.Data = new MemoryStream(); serializer.Serialize(message.BodyPart.Data, doc); message.BodyPart.ContentType = "text/xml"; } public IBaseMessage GetNext(IPipelineContext pContext) { var result = message; message = null; return result; }
Send port is just a folder location. Biztalk writes an empty file to it. Any idea why?
Thanks

