custom pipeline process definition
i have code, want know , how process going on exataly, debatching xml message.
please put yours explanation of below per how process
ibasemessage msg = null;
msg = pcxt.getmessagefactory().createmessage();
//system.diagnostics.eventlog.writeentry("getnext:after msg", "");
msg.context = ibmparam.context;
ibasemessagepart msgpart = pcxt.getmessagefactory().createmessagepart();
system.io.memorystream memstrm = new memorystream();
docorder.save(memstrm);
memstrm.position = 0;
memstrm.seek(0, system.io.seekorigin.begin);
msgpart.data = memstrm;
msg.addpart(ibmparam.bodypartname, msgpart, true);
msg.context.promote("messagetype", systempropertiesnamespace, namespaceuri + "#" + rootelement.replace("ns0:", ""));
messageinterchange.add(msg);
pcxt.resourcetracker.addresource(memstrm);
when debug pipeline break ponits never hit below method,
private void createoutgoingmessage(ipipelinecontext pcontext,ibasemessage pinmsg, string messagestring, string namespaceuri, string rootelement)
{
ibasemessage outmsg;
try
{
//create outgoing message
outmsg = pcontext.getmessagefactory().createmessage();
outmsg.context = pinmsg.context;
outmsg.addpart("body", pcontext.getmessagefactory().createmessagepart(), true);
outmsg.context.promote("messagetype", systempropertiesnamespace, namespaceuri + "#" + rootelement.replace("ns0:", ""));
byte[] bufferooutgoingmessage = system.text.asciiencoding.ascii.getbytes(messagestring);
outmsg.bodypart.data = new memorystream(bufferooutgoingmessage);
qoutputmsgs.enqueue(outmsg);
}
catch (exception ex)
{
throw new applicationexception("error in queueing outgoing messages: " + ex.message);
}
}
thanks
assuming docorder full xml instance,
docorder.save(memstrm);
writes xml content memstrm memory stream.
these lines perform same function,
memstrm.position = 0;
memstrm.seek(0, system.io.seekorigin.begin);
so 1 needed. doesn't matter which.
as m.r.ashwinprabhu suggested, can describe you're trying accomplish? impression inherited code.
BizTalk Server > BizTalk Server General
Comments
Post a Comment