zoukankan      html  css  js  c++  java
  • [BizTalk]让BizTalk消息中携带附件.

    Use System.Xml.XmlDocument as the part type for the message, this is treated
    as a generic stream of data.  Then you can use a stream of data for this
    part.

    实现这样一个功能:
    1.访问SQL Reporting Service得到一个报表的数据
    2.将报表数(stream)赋给BizTalk中的一个消息中。

    使用System.Xml.XmlDocume数据类型.
    代码如下:

    public static void CreateReportPart(XLANGMessage msg, int partIndex, string 
    reportName)

    {

    System.IO.Stream reportStream 
    = ReportServicesProxy.GetReport(reportName);
    ReportStreamFactory factory 
    = new ReportStreamFactory(reportStream);
    msg[partIndex].LoadFrom(factory);

    }


    public class ReportStreamFactory : IStreamFactory
    {
    System.IO.Stream _stream;
    public ReportStreamFactory(System.IO.Stream stream)
    {_stream = stream;}
    public System.IO.Stream CreateStream()
    {return _stream;}

    public void Dispose()
    {_stream.Close();}

    }



    通过类似这样的方案,就可以将附件添加到消息中了
  • 相关阅读:
    day_10作业
    day_10
    day_09
    day_08
    猜年龄游戏
    day_07
    day_06作业
    day05课堂小结
    day05作业
    day04课堂小结
  • 原文地址:https://www.cnblogs.com/xuzhong/p/236283.html
Copyright © 2011-2022 走看看