自定义发送管道组件:无法读取管道生成的流...缺少根元素。 [英] Custom Send Pipeline Component: Unable to read the stream produced by the pipeline... Root element is missing.

查看:82
本文介绍了自定义发送管道组件:无法读取管道生成的流...缺少根元素。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个前辈的管道,在编码阶段工作正常。 它的目的是从属性包中获取XPath,并查找它以帮助构建文件名,以便我可以在文件SendPort中使用宏%Sourcefilename%。

I have a pipeline from my predecessors that works fine in the Encoding phase.  It's purpose is to take an XPath from the property bag, and look it up to help build the filename, so that I can use the macro %Sourcefilename% in the file SendPort.




        public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
        {
            inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", GetNewFileName(inmsg.BodyPart.Data));
            if (inmsg.BodyPart.Data.CanSeek)
                inmsg.BodyPart.Data.Seek(0, SeekOrigin.Begin);
            else
            {
                ReadOnlySeekableStream seekableStream = new ReadOnlySeekableStream(inmsg.BodyPart.Data);
                seekableStream.Position = 0;
                inmsg.BodyPart.Data = seekableStream;
            }
            return inmsg;
        }

现在,我需要生成一个CSV文件而不是XML文件,所以当我进入编码阶段时,XPath不再有效 我相信反汇编程序已经将流转换为平面文件,所以当然XPath无法工作。


$
我更改了以下内容:

Now, I need to produce a CSV file instead of an XML file, so by the time I get to the encoding phase, the XPath no longer works.  I believe the disassembler has already converted the stream to the flat file, so of course the XPath cannot work.

I changed the following:

    // [ComponentCategory(CategoryTypes.CATID_Encoder)]
$
    [ComponentCategory(CategoryTypes.CATID_Any)]

    //[ComponentCategory(CategoryTypes.CATID_Encoder)]
    [ComponentCategory(CategoryTypes.CATID_Any)]

并尝试在预装配阶段使用相同的管道组件,但现在出现此错误:

and tried to use the same pipeline component in the Pre-Assemble phase, but now get this error:

适配器无法传输发送端口"Send_ForHistory_Delta_FMA_Daily"的消息。使用URL"D:\Work\Delta_FMA \FMA%SourceFileName%_%MessageID%.csv"。它将在为此发送端口指定的重试间隔后重新传输。详细信息:"Unable
读取管道生成的流。


 详细信息:缺少根元素。 "。

有关如何在"一次通过"中执行此操作的任何想法? 我的另一种方法是跳过另一个接收/发送,但这似乎还有很长的路要走。

Any ideas how to do this in "one pass"?  My alternative is to jump it through another Receive/Send, but that seems a long way around.

谢谢,

Neal Walters

http://NealWalters.com

Thanks,
Neal Walters
http://NealWalters.com

























推荐答案

" root element is missing" ...看起来像  XML汇编程序组件。尼尔,你有管道吗?
"root element is missing"... looks like the XML Assembler component. Neal, do you have it in pipe?


这篇关于自定义发送管道组件:无法读取管道生成的流...缺少根元素。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆