Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Create Multipart Message programatically : Custome Pipeline
- This topic has 0 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
July 20, 2009 at 5:01 AM #22885
Hi,
I am trying to construct a multipart message from a txt file. I construct the message inside a custome pipeline component and then use the component inside a receive pipeline. Using xml disassembler to actually promote the properties for the newly const. mesage.
When I test it, it seems the newly constructed message is not present. All I can get is orignal message (Without XML disassembler) or error stating that disassembler component canot recognize the messageCode to create the message:
public{
IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg) string orignaldata = default(string);
IBaseMessage outMessage = null;
IBaseMessagePart msgPart=null;
try
{
//Get message data into string
orignaldata = GetOrignalMessage(pContext, pInMsg);
//Check for Return Data
if (orignaldata != default(string))
PipelineUtil.CloneMessageContext(pInMsg.Context);
//Create header part to the message
msgPart = CreateHeaderPart(pContext, orignaldata);
if (msgPart != null)
“Header”, msgPart, false);
//Create Body part to the message
msgPart =
null; if (msgPart != null)
“Body”, msgPart, true); return outMessage; catch (ApplicationException ex) throw new ApplicationException(“Source: IBaseMessage.Execute – “ + ex.Message);
}
}
}
{
}
}
————————
Debugging pileine component succesfully creates the message with 2 parts (header and Body) but when I look at suspended mesasge (Resumable) there is only one part i.e. body part of orignal message.Looking at non resumable mesage does not show any data or parts.
Pasted below is the orignal mesage data and parts data created inside pipeline component
Orignal Message Data:
MIME-Version: 1.0
Content-Type: multipart/related; type=”text/xml”;
boundary=”_968002A2-AAE4-43E0-90D3-83461FE91020_”
–_968002A2-AAE4-43E0-90D3-83461FE91020_
MIME-Version: 1.0
Content-Transfer-Encoding: binary
Content-Description: Header
<ns0:Header1 xmlns:ns0=”http://MultiPartMsg.Schema.Header1“>
<HeaderData>HeaderData_0</HeaderData>
</ns0:Header1>
–_968002A2-AAE4-43E0-90D3-83461FE91020_
MIME-Version: 1.0
Content-Transfer-Encoding: binary
Content-Description: POMsg
<ns0:BodyPart xmlns:ns0=”http://ProcessMultiPartMsg.BodySchema“>
<BodyPartData>BodyPartData_0</BodyPartData>
</ns0:BodyPart>
–_968002A2-AAE4-43E0-90D3-83461FE91020_–
Header Part:
<ns0:Header1 xmlns:ns0=”http://MultiPartMsg.Schema.Header1“>
<HeaderData>HeaderData_0</HeaderData>
</ns0:Header1>
Body Part:
<ns0:BodyPart xmlns:ns0=”http://ProcessMultiPartMsg.BodySchema“>
<BodyPartData>BodyPartData_0</BodyPartData>
</ns0:BodyPart>Please let me know what I am doing wrong or any direction to fix the error.
msgPart = CreateBodyPart(pContext, orignaldata);
{
outMessage.AddPart(
}
{
outMessage.AddPart(
{
outMessage = pContext.GetMessageFactory().CreateMessage();
outMessage.Context =
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.