public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc,
Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
{
// not supported
if (inmsg.PartCount != 1)
return;
Dictionary<Guid, Pair<Schema, Stream>> dvn = XmlValidableNodesFinder.Instance.Find(
inmsg.BodyPart.GetOriginalDataStream(), this.Schemas);
IBaseMessageFactory bmf = pc.GetMessageFactory();
Guid msgSetID = Guid.NewGuid();
foreach (KeyValuePair<Guid, Pair<Schema, Stream>> kvp in dvn)
string SchemaName = null == kvp.Value.Left ? string.Empty : kvp.Value.Left.DocSpecName;
IBaseMessage bm = BuildMessage(bmf, inmsg, msgSetID, dvn.Count, kvp.Key, SchemaName);
bm.AddPart(kvp.Key.ToString(), BuildMessagePart(bmf, kvp.Value, pc), true);
}
private IBaseMessage BuildMessage(IBaseMessageFactory bmf, IBaseMessage inputMsg,
Guid msgSetID, int msgCount, Guid partID, string schemaName)
IBaseMessage bm = bmf.CreateMessage();
bm.Context = PipelineUtil.CloneMessageContext(inputMsg.Context);
bm.Context.Promote(this.MsgSetID, this.PropertiesNamespace, msgSetID.ToString("B"));
bm.Context.Write(this.MsgCount, this.PropertiesNamespace, msgCount);
bm.Context.Write(this.PartID, this.PropertiesNamespace, partID.ToString("B"));
bm.Context.Promote(this.PartSchemaName, this.PropertiesNamespace, schemaName);
_msgs.Enqueue(bm);
return bm;