soap_envelope_1__1.Fault详细信息节点

时间:2015-05-01 07:19:43

标签: xml xslt biztalk

我遇到了soap_envelope_1__1.Fault类型的错误。

当我运行调试模式并获得返回的错误时,我收到以下代码

<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <faultcode>soapenv:Server</faultcode>
    <faultstring>Missing or Invalid Information</faultstring>
    <detail>
        <ns3:sendFault xmlns:ns3="http://thisservice.com/was/v1" xmlns:ns2="http://thisservice.com/pos/v1" xmlns:ns4="http://thisservice.com/lr/v1" xmlns:ns5="http://thisservice.com/dl/v1" xmlns:ns6="http://thisservice.com/ted/v1" xmlns:ns7="http://thisservice.com/header/v1">
            <code>Actual_Code_18</code>
            <info>Bad Information</info>
        </ns3:sendFault>
    </detail>
</soapenv:Fault>

对于我的发送端口,我使用Wcf-BasicHTTPPort,入站消息体设置为body,并传播故障消息。

在我的业务流程中

我为soap_envelope_1__1.Fault设置了错误。 我在范围形状中的捕获得到了错误。 在构造消息形状中,我将由fault生成的对象构造为我的错误消息:Message_myFault = myFault;

然后我使用xslt映射来映射我的错误消息中的代码和信息标记。我的问题是我似乎无法为INFO和CODE标签找到正确的xpath,它们在我的消息中显示为空白,但如果我使用faultcode或faultstring则填充。 继承人:<xsl:value-of select="InputMessagePart_0/s0:Fault/s0:detail/ns6:sendFault/code/text()" />

这是我的样式表标签:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s2 s0 s1 userCSharp" version="1.0" xmlns:array="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:s0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/ABCD" xmlns:ns3="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo" xmlns:s2="http://schemas.microsoft.com/BizTalk/2003/aggschema" xmlns:s1="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/ABC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp" xmlns:ns6="http://thisservice.com/was/v2" xmlns:ns2="http://thisservice.com/pos/v2" >

3 个答案:

答案 0 :(得分:1)

查看(仅)您的XML输入,以下说明:

<xsl:value-of select="/soapenv:Fault/detail/ns3:sendFault/code" />

将返回:

Actual_Code_18

如果以下命名空间声明在范围内:

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns3="http://thisservice.com/was/v1"

请注意,detail元素没有名称空间。

答案 1 :(得分:0)

我建议只使用Orchestration xpath()函数而不是创建一个完整的地图两个得到这个消息的两个小部分;像这样

strCode= xpath(myFault, "string(/*[local-name()='Fault' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='detail' and namespace-uri()='']/*[local-name()='sendFault' and namespace-uri()='http://thisservice.com/was/v1']/*[local-name()='code'])");

strInfo= xpath(myFault, "string(/*[local-name()='Fault' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='detail' and namespace-uri()='']/*[local-name()='sendFault' and namespace-uri()='http://thisservice.com/was/v1']/*[local-name()='info'])");

此博客有关于您的任务的一些很好的信息,可能会有所帮助:http://blogs.msdn.com/b/biztalknotes/archive/2013/02/12/how-to-handle-fault-message-in-biztalk-server.aspx

答案 2 :(得分:0)

正确的命名空间原来是: InputMessagePart_0 / S1:故障/细节/ NS6:sendFault /代码/文本()

问题是我在1_1错误的详细节点上添加了命名空间。

相关问题