Is there any way that C# application Convert BizTalk Server BizTalkMsgBoxDb Database Spool Table ImgContext Columns in Original format that we show in BizTalk.
Here, Is my ImgContext value Datatype is image.
Here is my simple application code.
Here I need to actually output look like same as BizTalk.
Use the below code for resolved your logs issue with the external services, use the spool table of BizTalkMsgBoxDb.
if (row["imgContext"].GetType() != typeof(DBNull))
{
SqlBinary contextData = new SqlBinary((byte[])row["imgContext"]) //Use memory stream and IBTMessageAgentFactory to get context
Console.WriteLine("Message Context:");
Console.WriteLine("");
MemoryStream contextstream = new MemoryStream(contextData.Value);
IBaseMessageContext context = ((IBTMessageAgentFactory)((IBTMessageAgent)new BTMessageAgent())).CreateMessageContext();
((IPersistStream) context).Load(contextstream); Console.WriteLine("NAME ,Value , TYPE , Namespace");
for (int i = 0; i<context.CountProperties; ++i)
{
string propName;
string propNamespace;
object propValue = context.ReadAt(i, out propName, out propNamespace);
string type = context.IsPromoted(propName, propNamespace) ? "Promoted" : "No Promoted";
Console.WriteLine(propName + " || " + propValue.ToString() + " || "+ type + " || "+ propNamespace );
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.