Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
BizTalk部件';第'部分;信息'&书信电报;MessageName>';包含零字节的数据_Biztalk_Biztalk 2010 - Fatal编程技术网

BizTalk部件';第'部分;信息'&书信电报;MessageName>';包含零字节的数据

BizTalk部件';第'部分;信息'&书信电报;MessageName>';包含零字节的数据,biztalk,biztalk-2010,Biztalk,Biztalk 2010,我在业务流程中的消息分配形状中收到此错误。在这个赋值形状中,我试图执行一个XPath查询,从WCF接收的消息中提取一个base64编码的字符串。然后,我尝试加载一个XmlDocument变量,其中包含一个由我编写的助手类生成的流。base64字符串将是PDF或Excel文件的内容(注意:这不是XML)。我听说这是可以做到的 以下是我的邮件分配中使用的表达式: messageCreator = new IAS.Integration.Services.Helpers.MessageCreator(

我在业务流程中的消息分配形状中收到此错误。在这个赋值形状中,我试图执行一个XPath查询,从WCF接收的消息中提取一个base64编码的字符串。然后,我尝试加载一个XmlDocument变量,其中包含一个由我编写的助手类生成的流。base64字符串将是PDF或Excel文件的内容(注意:这不是XML)。我听说这是可以做到的

以下是我的邮件分配中使用的表达式:

messageCreator = new IAS.Integration.Services.Helpers.MessageCreator();
System.Diagnostics.EventLog.WriteEntry("IAS.Integration.Services.Orchestration", "MessageCreator Object created");

base64 = xpath(PerformTransformationResponse, "string(/*[local-name()='PerformTransformationResponseWrapper' and namespace-uri()='http://www.iasreo.com/integration/servicetypes']/*[local-name()='TransformedPayload'])");
//System.Diagnostics.EventLog.WriteEntry("IAS.Integration.Services.Orchestration", System.String.Format("Base64 from xpath: {0}", base64));

Output = new System.Xml.XmlDocument();
System.Diagnostics.EventLog.WriteEntry("IAS.Integration.Services.Orchestration", "Output instantiated as XmlDocument");

messageCreator.CreateMyMessage(Output, base64);
System.Diagnostics.EventLog.WriteEntry("IAS.Integration.Services.Orchestration", "messageCreator.CreateMyMessage(Output, base64)");
以下是我为支持此表达式而编写的帮助器类:

[Serializable]
public class MessageCreator
{
    public void CreateMyMessage(XLANGMessage outMessage, string binaryStringMessage)
    {
        outMessage[0].LoadFrom(new StreamFactory(binaryStringMessage));
    }
}

[Serializable]
public class StreamFactory : IStreamFactory
{
    private string messageContent;

    public StreamFactory(string inMessageContent)
    {
        messageContent = inMessageContent;
    }

    public Stream CreateStream()
    {
        byte[] messageBytes = Convert.FromBase64String(messageContent);

        return new MemoryStream(messageBytes, 0, messageBytes.Length, true, true);
    }
}
最后,这是我在事件查看器中收到的错误:

xlang/s引擎事件日志条目:未捕获异常(请参阅下面的“内部异常”)已挂起服务“IAS.Integration.Services.Orchestrations.main Orchestration(fcad6d68-ce54-bfa2-d035-56608b99ef52)”的实例。 服务实例将保持挂起状态,直到以管理方式恢复或终止。 如果恢复,实例将从最后一个持久化状态继续,并可能重新引发相同的意外异常。 实例ID:c398fd2a-b654-4981-be13-94146d640375 形状名称:发送流文件 形状ID:bc7a463b-eed2-4222-b2f7-3fdb1e44a3c5 从以下位置引发异常:段1,进度25 内部异常:消息“Output”的“part”部分包含零字节的数据

异常类型:EmptyPartException 来源:Microsoft.XLANGs.Engine 目标站点:System.IO.Stream Persist(System.String ByRef,布尔值) 下面是一个堆栈跟踪,用于标识发生异常的位置 在Microsoft.XLANGs.Core.Part.Persist(字符串和编码,布尔wantEncoding) 位于Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.StagePartData(部分) 在Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.PrepareMessage(XLANGMessage msg、IList promoteProps、IList TopPromote) 位于Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.WriteMessageState(IBTPePinfookup pepLookup、Guid portId、XLANGMessage msg、段seg、字符串opname、字符串url、IList promoteProps、布尔跟踪、IList toPromote) 位于Microsoft.BizTalk.XLANGs.BTXEngine.BTXLLogicalPortBinding.SendMessage(XLANGMessage消息、XlangStore存储、段seg、操作信息操作、IList附加属性、IList toPromote、布尔忽略路由失败) 位于Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.SendMessage(Int32 IOOperation、XLANGMessage msg、Correlation[]initCorrelations、Correlation[]followCorrelations、Context cxt、seg段、ActivityFlags) 在IAS.Integration.Services.Orchestrations.MainOrchestration.segment1(停止条件停止) 在Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(段s、StopConditions、stopCond、Exception和exp)**


我可以看到,当您在发送消息之前将消息序列化为持久状态的一部分时,会发生这种情况。“形状名称:发送\u StreamedDocument”

您的输出消息定义为简单消息还是多部分消息

您是否尝试过将输出消息设置为字符串而不是XMLDocument

编辑:实际上XMLDocument本身不是可序列化的。我不知道这一点——我想我总是能够在发送消息之前将消息键入基于模式的内容。
请看这里: 在这里:

您可以将消息分配包装起来,并在原子事务中发送形状,这样就避免了试图持久化不可序列化的内容。或者您可以使用XML文档以外的其他内容