gpt4 book ai didi

c# - 在 biztalk 管道组件中获取架构信息

转载 作者:行者123 更新时间:2023-11-30 21:00:47 25 4
gpt4 key购买 nike

早上好我有兴趣编写一个知道它正在解码的文档模式的管道组件。我看到有一个函数可以获取组件中的架构信息:

IDocumentSpec spec = pContext.GetDocumentSpecByType("name-of-your-schema");

您能否访问在管道中分配的文档架构名称?

最佳答案

您可以像这样从消息的上下文中获取它:

private static readonly PropertyBase SchemaStrongNameProperty = new BTS.SchemaStrongName();
private static readonly PropertyBase MessageTypeProperty = new BTS.MessageType();

public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
{
// Get by schema strong name (.NET type)
string schemaStrongName = pInMsg.Context.Read(SchemaStrongNameProperty.Name.Name, SchemaStrongNameProperty.Name.Namespace) as string;
pContext.GetDocumentSpecByName(schemaStrongName);

// Get by message type (XML NS#Root Node)
string messageType = pInMsg.Context.Read(MessageTypeProperty.Name.Name, MessageTypeProperty.Name.Namespace) as string;
pContext.GetDocumentSpecByType(messageType);

// Rest of your pipeline component's code...
}

关于c# - 在 biztalk 管道组件中获取架构信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14735007/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com