排解 XMLThreatProtection 政策執行階段錯誤

查看 Apigee Edge 說明文件。
前往 Apigee X 說明文件
info

ExecutionFailed

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition policy_name:
        Execution failed. Reason: error_description at line line_num
        (possibly around char char_num)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: Premature end of document while parsing at line 5(possibly  around char 0)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤類型和可能的原因

XMLThreatProtection 政策可能會擲回多種不同類型的 ExecutionFailed 錯誤。下表列出各種錯誤類型及可能的原因:

發生錯誤 原因
ElementNameExceeded XML 標記的字串長度超過上限。
ChildCountExceeded XML 酬載中子元素的數量超過上限。
NodeDepthExceeded 超過 XML 酬載中允許的 XML 元素最大深度。
AttributeCountExceeded 超過單一元素的屬性數量上限。
AttributeNameExceeded 屬性名稱的長度超過上限。
AttributeValueExceeded 超過屬性值允許的長度上限。
TextExceeded 文字長度超過上限。
CommentExceeded 超過留言長度上限。
PIDataExceeded 超過允許處理的操作說明資料長度。
PITargetExceeded 程序指示名稱長度超出限制。
NSURIExceeded 命名空間網址長度超出上限。
NSPrefixExceeded 超過命名空間前置字串的長度。
NSCountExceeded 單一元素中使用的命名空間數量超出上限。
無效的 XML 酬載 輸入的 XML 酬載無效。

ElementNameExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

執行階段流量會傳回 500 回應碼,並顯示以下錯誤:

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition policy_name:
        Execution failed. reason: XMLThreatProtection stepDefinition policy_name:
        Element name length exceeded num at line line_num(possibly
        around char char_num)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Element name length exceeded 5 at line 1(possibly around char 9)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果政策的 <Source> 元素指定的輸入酬載含有 XML 元素,且該元素的長度超過 <NameLimits> 元素下方 <Element> 元素中指定的最大長度,就會發生這項錯誤。

舉例來說,如果 XMLThreatProtection 政策中將 <Element> 元素指定為 5,但輸入酬載含有超過 5 個字元的元素,就會擲回此錯誤。

診斷

  1. 檢查錯誤訊息,找出在超過元素長度的輸入酬載中,是否有 XMLThreatProtection 政策名稱、行號,以及可能的字元數。

    例如,在下列錯誤訊息中,酬載中的政策名稱是 XML-Threat-Protection-1, 行數為 1,可能的字元數為 9.

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Element name
    length exceeded 5 at line 1(possibly around char 9)
    
  2. 檢查失敗的政策 (在步驟 1 中指出),並記下 <Element> 元素中指定的值。

    舉例來說,在下列 XMLThreatProtection 政策中,<Element> 會設為 5

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>5</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>5</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認該行元素的長度是否大於 <Element> 元素 (在步驟 2 中指出) 指定的值。如果元素長度超過這個值,就會導致錯誤。

    以下是輸入酬載的範例:

    <company>
      <name>Google</name>
      <country>USA</country>
    </company>
    

    上方顯示的 XML 酬載在第 1 行含有名為 company 的根元素,該元素共有 7 個字元。由於元素長度超過 5 (為 <Element> 元素指定的值),因此會產生下列錯誤:

    XML-Threat-Protection-1: Execution failed. reason: XMLThreatProtection stepDefinition
    XML-Threat-Protection-1: Element name length exceeded 5 at line 1(possibly around char 9)
    

解析度

如果 XMLThreadProtection 政策旨在防範元素名稱超過定義值的酬載,則會收到錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果您判斷在酬載中指定較長的元素不會造成任何影響,請根據需求將 <Element> 修改為適當的值。

舉例來說,如果您認為可允許的元素長度上限為 10 個字元,請依下列方式修改 XMLThreatProtection 政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>5</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>5</NodeDepth>
        <AttributeCountPerElement>2</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

ChildCountExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition policy_name:
        Execution failed. reason: XMLThreatProtection stepDefinition policy_name:
        Children count exceeded num at line  num(possibly
        around char num)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Children count exceeded 3 at line 5(possibly around char 89)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 <Source> 元素指定的輸入訊息酬載內容包含 XML 元素,且該 XML 元素包含的子元素多於政策 <ChildCount> 元素中指定的值,就會發生此錯誤。

舉例來說,如果 <ChildCount> 元素為 3,但輸入的 XML 酬載含有超過 3 個子元素的元素,就會擲回此錯誤。

診斷

  1. 檢查錯誤訊息,找出 XMLThreatProtection 政策名稱和超出項目計數的行號。例如,在下列錯誤訊息中,政策名稱為 XML-Threat-Protection-1,酬載中的行號為 5

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Children
    count exceeded 3 at line 5(possibly around char 89)"
    
  2. 檢查失敗的政策 (如步驟 1 所示),並記下 <ChildCount> 元素中指定的值。

    在下列政策範例中,<ChildCount> 會設為 3 (請注意,註解、包含元素和其他項目都會計入此限制):

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>5</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認酬載中的子項數量 (包括所有註解等) 是否大於為 <ChildCount> 元素指定的值 (在步驟 2 中指出)。如果子元素的數量超過子項數量,就會造成錯誤。

    以下是輸入酬載的範例:

    <movie>
      <title>Jurassic Park</title>
      <language>English</language>
      <country>USA</country>
      <director>Steven Spielberg</director>
    </movie>
    

    在上方顯示的 XML 酬載中,第 5 行包含根元素 <movie> 的第四個子元素 <director>。由於輸入 XML 酬載中的子元素數量大於 3 (為 <ChildCount> 元素指定的值),因此您會收到以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Children
    count exceeded 3 at line 5(possibly around char 89)
    

解析度

如果 XMLThreatProtection 政策旨在防止子元素計數超過特定閾值的酬載,則預期會出現錯誤訊息。在此情況下,您不需要採取其他行動。

不過,如果您判斷可以將更多子項 (包括註解等) 納入酬載,而不會造成任何影響,請根據您的需求將 <ChildCount> 修改為適當的值。

舉例來說,如果你認為自己最多可允許 10 個子元素,請依下列方式修改 XMLThreatProtection 政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>5</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>5</NodeDepth>
        <AttributeCountPerElement>2</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">10</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

NodeDepthExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Node depth exceeded [num] at line [num](possibly around
        char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Node depth exceeded 5 at line 6(possibly around char 110)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 <Source> 元素指定的輸入訊息酬載內容包含 XML 文件,且該文件的節點階層超過 XMLThreatProtection 政策 <NodeDepth> 元素中指定的數量,就會發生這個錯誤。

舉例來說,如果政策中的 <NodeDepth> 元素指定為 4,但輸入酬載的節點深度超過 4,系統就會擲回這個錯誤。

診斷

  1. 請查看錯誤訊息,找出 XMLThreatProtection 政策名稱,以及超過節點深度的行號。例如,在下列錯誤訊息中,政策名稱為 XML-Threat-Protection-1,酬載中的行號為 6

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Node depth
    exceeded 5 at line 6(possibly around char 109)
    
  2. 檢查失敗的 XMLThreatProtection 政策 (如步驟 1 所示),並記下 <NodeDepth> 元素中指定的值。

    在以下 XMLThreatProtection 政策範例中,<NodeDepth> 會設為 5

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>5</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行數 (如步驟 1 所示),檢查指定的節點深度是否多於 <NodeDepth> 元素中指定的數字 (如步驟 2 中所示)。如果 XML 子元素層級超過數量,就會造成錯誤。

    以下是輸入酬載的範例:

    <hellos>
       <hello1>
           <wave1>
                <wave2>
                    <wave3>
                        <wave4>
                           <wave5>wave</wave5>
                        </wave4>
                    </wave3>
                </wave2>
           </wave1>
       </hello1>
       <hello2>world2</hello2>
       <hello3>world3</hello3>
       <hello4>world4</hello4>
       <hello5>world5</hello5>
       <hello6>world6</hello6>
    </hellos>
    

    上方第 6 行所示的 XML 酬載的節點深度大於 5. (為 <NodeDepth> 元素指定的值),您會收到以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Node depth
    exceeded 5 at line 6(possibly around char 109)
    

解析度

如果 XMLThreatProtection 政策旨在防範具有特定節點深度門檻的酬載,則會收到錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果您認為可以允許更大的節點深度,請根據需求將 <NodeDepth> 修改為適當的值。

舉例來說,如果您認為最多可允許節點深度為 10,請按照下列方式修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>5</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>2</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

AttributeCountExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Attribute count exceeded [num] at line [num](possibly around
        char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Attribute count exceeded 2 at line 3(possibly around char 105)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLThreatProtection 政策 <Source> 元素指定的輸入訊息酬載包含 XML 文件,其中單一元素的屬性數量超過政策中 <AttributeCountPerElement> 元素中指定的數量,就會發生這個錯誤。

舉例來說,如果 <AttributeCountPerElement> 元素在 XMLThreatProtection 政策中指定為 2,但輸入酬載含有超過 2 個屬性的元素,就會擲回這個錯誤。

診斷

  1. 請查看錯誤訊息,找出 XMLThreatProtection 政策名稱和屬性數量超出上限的行號。舉例來說,在以下錯誤訊息中,政策名稱為 XMLThreat-Protection-1,而酬載中的行號為 3

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Attribute
    count exceeded 2 at line 3(possibly around char 105)
    
  2. 檢查失敗的政策 (如步驟 1 所示),並記下 <AttributeCountPerElement> 元素中指定的值。

    在以下政策範例中,<AttributeCountPerElement> 設為 2

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認指定的屬性數量是否超過 <AttributeCountPerElementh> 元素 (在步驟 2 中指出) 所指定的數量。如果屬性數量超過數量,就會造成錯誤。

    以下是輸入酬載的範例:

    <?xml version="1.0" encoding="UTF-8"?>
    <bookstore>
      <book category="cooking" cuisine="Indian" lang="en">
        <title>Easy Indian Cooking</title>
        <author>Suneeta</author>
        <year>2004</year>
        <price>300.00</price>
      </book>
    </bookstore>
    

    上方第 3 行顯示的 XML 酬載包含三個屬性。由於屬性計數大於 2 (為 <AttributeCountPerElement> 元素指定的值),因此會收到以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Attribute
    count exceeded 2 at line 3(possibly around char 105)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定數量屬性的酬載,則會出現錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果您認為可以允許更多屬性,請根據需求將 <AttributeCountPerElement> 修改為適當的值。

舉例來說,如果您認為每個元素最多可允許 5 個屬性,請修改政策如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>5</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

AttributeNameExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Attribute name length exceeded [num] at line [num](possibly around char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Attribute name length exceeded 5 at line 3(possibly around char 105)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLThreatProtection 政策的 <Source> 元素指定的輸入訊息酬載內容包含 XML 文件,且屬性名稱超過政策 <NameLimits> 元素 <Attribute> 子項元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果政策中指定 <Attribute> 元素為 5,但輸入酬載含有超過 5 個字元的屬性名稱,就會擲回此錯誤。

診斷

  1. 請查看錯誤訊息,找出 XMLThreatProtection 政策名稱,以及超過屬性名稱長度的行號。例如,在下列錯誤訊息中,政策名稱為 XML-Threat-Protection-1,酬載中的行號為 3

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Attribute
    name length exceeded 5 at line 3(possibly around char 105)
    
  2. 檢查失敗的政策 (在步驟 1 中指出),並記下 <Attribute> 元素中指定的值

    在以下 XMLThreatProtection 政策範例中,<Attribute> 已設為 5

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認該處指定屬性的長度是否比 <Attribute> 元素 (在步驟 2 中指出) 指定的數字長。如果字元數超過屬性值,則會導致錯誤。

    以下是輸入酬載的範例:

    <?xml version="1.0" encoding="UTF-8"?>
    <bookstore>
      <book category="cooking" cuisine="Indian" lang="en">
        <title>Easy Indian Cooking</title>
        <author>Suneeta</author>
        <year>2004</year>
        <price>300.00</price>
      </book>
    </bookstore>
    

    上方第 3 行顯示的 XML 酬載包含 categorycuisine 兩個屬性,名稱長度分別為 8 和 7 個字元.因為屬性名稱長度大於 5 (為 <Attribute> 元素指定的值),因此會出現以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Attribute
    name length exceeded 5 at line 3(possibly around char 105)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定屬性名稱長度的酬載,則會傳回錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果決定允許使用更長的屬性名稱長度,則請根據需求將 <Attribute> 修改為合適的值。

舉例來說,假設你認為屬性名稱最多可以有 10 個半形字元,然後依照下列方式修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

AttributeValueExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]: Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:  Attribute value length exceeded [num] at line [num](possibly around char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Attribute value length exceeded 10 at line 3(possibly around char 111)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果政策 <Source> 元素指定的輸入訊息酬載包含 XML 文件,而其中的屬性值超過 <ValueLimits> 元素 <Attribute> 子元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果在 XMLThreatProtection 政策中將 <Attribute> 元素指定為 10,但輸入酬載的屬性值超過 10 個字元,系統就會擲回這個錯誤。

診斷

  1. 請查看錯誤訊息,找出 XMLThreatProtection 政策名稱和屬性數量超出上限的行號。例如,在下列錯誤訊息中,政策名稱為 XML-Threat-Protection-1,酬載中的行號為 3

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Attribute
    value length exceeded 10 at line 3(possibly around char 111)
    
  2. 檢查失敗的政策 (如步驟 1 所示),並記下 <ValueLimits> 元素 <Attribute> 子元素中指定的值。

    在以下 XMLThreatProtection 政策範例中,<Attribute> 設為 10:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行數 (如步驟 1 所示),檢查指定屬性值的長度是否超過 <Attribute> 元素中指定的字元數 (在步驟 2 中識別)。如果字元數超過屬性值,就會造成錯誤。

    以下是輸入酬載的範例:

    <?xml version="1.0" encoding="UTF-8"?>
    <bookstore>
      <book category="cooking" cuisine="South Indian" lang="en">
        <title>Easy Indian Cooking</title>
        <author>Suneeta</author>
        <year>2004</year>
        <price>300.00</price>
      </book>
    </bookstore>
    

    上方第 3 行顯示的 XML 酬載含有值長度為 12 個字元的屬性 (cuisine)。屬性值長度大於 10 (為 <Attribute> 元素指定的值),因此會出現下列錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Attribute
    value length exceeded 10 at line 3(possibly around char 111)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定屬性值長度的酬載,則會收到錯誤訊息。這種情況不需要採取其他行動。

不過,如果決定允許使用更長的屬性值,則請根據需求,將 <ValueLimits> 元素的 <Attribute> 子項元素修改為合適的值。

舉例來說,假設你最多可以將屬性值修改為 15 個半形字元,請按照下列步驟修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>15</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

TextExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]: Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:  Text length exceeded [num] at line [num](possibly around char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Text length exceeded 15 at line 4(possibly around char 66)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }

原因

如果 XMLThreatProtection 政策的 <Source> 元素指定的輸入訊息酬載包含 XML 文件,而該文件中元素的文字長度超過政策 <ValueLimits> 元素 <Text> 子元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果政策中的 <Text> 元素指定為 15,但輸入酬載包含超過 15 個半形字元的文字,系統就會擲回這個錯誤。

診斷

  1. 請查看錯誤訊息,找出 XMLThreatProtection 政策名稱和屬性數量超出限制的行號。舉例來說,在下列錯誤訊息中,政策名稱為 XML-Threat-Protection-1,酬載中的行號為 4

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Text length
    exceeded 15 at line 4(possibly around char 66)
    
  2. 檢查失敗的政策 (在步驟 1 中指出),並記下 <ValueLimits> 元素 <Text> 子項中指定的值。

    在以下 XMLThreatProtection 政策範例中,<Text> 設為 15

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認該行指定的屬性值長度是否比 <Text> 元素 (在步驟 2 中指出) 指定的數字長。如果字元數超過屬性值,就會造成錯誤。

    <food>
      <name>Veg Sandwich</name>
      <price>$5.95</price>
      <description>Vegetarian Sandwich with onions, tomatoes and lettuce</description>
      <calories>650</calories>
    </food>
    

    上方第 4 行顯示的 XML 酬載包含長度為 53 個字元的文字。屬性值長度超過 15 (為 <Text> 元素指定的值),因此會出現下列錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Text length
    exceeded 15 at line 4(possibly around char 66)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定文字長度的酬載,則會收到錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果您認為可以允許更長的文字長度,請根據需求將 <ValueLimits> 元素的 <Text> 子元素修改為適當的值。

舉例來說,假設你認為屬性值最多可達 60 個半形字元,請依下列方式修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>60</Text>
        <Attribute>15</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

CommentExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Comment length exceeded [num] at line [num](possibly around char
        [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Comment length exceeded 10 at line 2(possibly around char 48)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLThreatProtection 政策的 <Source> 元素指定的輸入訊息酬載含有 XML 文件,且該文件的註解長度超過政策 <ValueLimits> 元素 <Comment> 子元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果 <Comment> 元素在政策中指定 10,但輸入酬載包含的註解超過 10 個字元,系統就會擲回這個錯誤。

診斷

  1. 檢查錯誤訊息,找出 XMLThreatProtection 政策名稱,以及超過註解長度的行號。例如,在下列錯誤訊息中,政策名稱為 XML-Threat-Protection-1,酬載中的行號為 2

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Comment length exceeded 10 at line 2(possibly around char 48)
    
  2. 檢查失敗的政策 (如步驟 1 所示),並記下 <ValueLimits> 元素 <Comment> 子元素中指定的值。

    在以下 XMLThreatProtection 政策範例中,<Comment> 設為 10

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認該行註解的長度是否超過 <Comment> 元素 (在步驟 2 中指出) 中指定的數字。如果字元數超過屬性值,則會導致錯誤。

    以下是輸入酬載的範例:

    <food>
      <!--This is somewhat a long comment-->
      <name>Veg Sandwich</name>
      <price>$5.95</price>
      <description>Vegetarian Sandwich with onions, tomatoes and lettuce</description>
      <calories>650</calories>
    </food>
    

    上方第 2 行顯示的 XML 酬載含有長度為 31 個字元的註解. 由於註解長度超過 10 (<Comment> 元素指定的值),因此會收到以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Comment length
    exceeded 10 at line 2(possibly around char 48)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定註解長度的酬載,則會顯示錯誤訊息。這種情況不需要採取其他行動。

不過,如果您認為可以允許較長的留言,請根據需求將 <ValueLimits> 元素的 <Comment> 子元素修改為適當的值。

舉例來說,假設你最多可以將屬性值設成 40 個半形字元,然後依照下列方式修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>15</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>40</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

PIDataExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Processing Instruction data length exceeded [num] at line
        [num](possibly around char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Processing Instruction data length exceeded 30 at line 2(possibly around char 109)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLThreatProtection 政策 <Source> 元素指定的輸入訊息酬載包含 XML 文件,其中的處理資料指示超過政策 <ValueLimits> 元素 <ProcessingInstructionData> 子元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果 XMLThreatProtection 政策中的 <ProcessingInstructionData> 元素指定為 10,但輸入酬載的處理指示含有超過 10 個字元,系統就會擲回這個錯誤。

診斷

  1. 檢查錯誤訊息,找出 XMLThreatProtection 政策名稱,以及超過處理指示長度的行號。舉例來說,在以下錯誤訊息中,政策名稱為 XML-Threat-Protection-1,而酬載中的行號為 2

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Processing
    Instruction data length exceeded 30 at line 2(possibly around char 109)
    
  2. 檢查失敗的政策 (在步驟 1 中指出),並記下 <ValueLimits> 元素 <ProcessingInstructionData> 子項中指定的值。

    在以下 XMLThreatProtection 政策範例中,<ProcessingInstructionData> 設為 30

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>30</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行數 (如步驟 1 所示),檢查指定的處理指示資料長度是否超過 <ProcessingInstructionData> 元素中指定的字元數 (如步驟 2 所示)。如果字元數超過處理說明資料,就是發生錯誤的原因。

    以下是輸入酬載的範例:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?xml-stylesheet type="text/xsl" href="mobilephones.xsl"?>
    <mobilephones>
      <mobilephone>
          <name>iPhone</name>
          <price>$600</price>
      </mobilephone>
      <mobilephone>
          <name>Samsung</name>
          <price>$500</price>
      </mobilephone>
    </mobilephones>
    

    上方第 1 行顯示的 XML 酬載包含處理操作說明資料元素 (type="text/xsl" href="mobilephones.xsl"?)長度為 40 個字元.),因為此長度超過 30 個字元 (<ProcessingInstructionData> 元素指定的值) 會產生以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Processing
    Instruction data length exceeded 30 at line 2(possibly around char 109)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定處理指示資料長度的酬載,則應顯示錯誤訊息。這種情況不需要採取其他行動。

不過,如果您判斷可以允許較長的處理指示資料元素,請根據需求將 <ValueLimits> 元素的 <ProcessingInstructionData> 子元素修改為適當的值。

舉例來說,如果您認為資料處理指示的長度可達 50 個字元,請修改政策如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>15</Attribute>
        <NamespaceURI>10</NamespaceURI>
        <Comment>40</Comment>
        <ProcessingInstructionData>50</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

PITargetExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Processing Instruction target length exceeded [num] at line [num](possibly around
        char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Processing Instruction target length exceeded 10 at line 2(possibly around char 114)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLThreatProtection 政策 <Source> 元素指定的輸入訊息酬載包含 XML 文件,其中的程序指示目標超過政策 <NameLimits> 元素 <ProcessingInstructionTarget> 子元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果在 XMLThreatProtection 政策中將 <ProcessingInstructionTarget> 元素指定為 10,但輸入酬載包含超過 10 個字元的程序指示目標,系統就會擲回這個錯誤。

診斷

  1. 請查看錯誤訊息,找出 XMLThreatProtection 政策名稱和超過處理指令目標數量的行號。舉例來說,在以下錯誤訊息中,政策名稱為 XML-Threat-Protection-1,而酬載中的行號為 1

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Processing
    Instruction target length exceeded 10 at line 2(possibly around char 114)
    
  2. 檢查失敗的 XMLThreatProtection 政策 (如步驟 1 所示),並記下 <NameLimits> 的 <ProcessingInstructionTarget> 子元素中指定的值元素。

    在以下 XMLThreatProtection 政策範例中,<ProcessingInstructionTarget> 設為 10

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>10</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>5</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>20</Text>
            <Attribute>15</Attribute>
            <NamespaceURI>40</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>30</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認處理指令目標的長度是否比 <ProcessingInstructionTarget> 元素 (在步驟 2 中指出) 指定的數字長。如果字元數超過目標大小限制,就會導致錯誤。

    以下是輸入酬載的範例:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?xml-stylesheet type="text/xsl" href="mobilephones.xsl"?>
    <mobilephones>
      <mobilephone>
          <name>iPhone</name>
          <price>$600</price>
      </mobilephone>
      <mobilephone>
          <name>Samsung</name>
          <price>$500</price>
      </mobilephone>
    </mobilephones>
    

    上方第 2 行顯示的 XML 酬載包含處理指示目標名稱「xml-stylesheet"」,長度為 14 個字元。由於處理指示目標名稱超過 10 (<ProcessingInstructionTarget> 元素指定的值),因此會出現以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Processing
    Instruction target length exceeded 10 at line 2(possibly around char 114)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定處理程序指令目標長度的酬載,則會顯示錯誤訊息。這種情況不需要採取其他行動。

不過,如果您判斷程序指示目標可能更長,請根據您的要求,將 <NameLimits> 元素的 <ProcessingInstructionTarget> 子項元素修改為適當的值。

舉例來說,如果您認為程序指示目標最多可達 25 個字元,請按照下列方式修改政策:

  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>5</Attribute>
        <NamespacePrefix>15</NamespacePrefix>
    <ProcessingInstructionTarget>25</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>2</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>40</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
  </XMLThreatProtection>

NSURIExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]: Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:  Namespace uri length length exceeded [num] at line [num](possibly around char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Namespace uri length exceeded 10 at line 2(possibly around char 97)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLThreatProtection 政策 <Source> 元素指定的輸入訊息酬載包含 XML 文件,而其中的 Namespace URI 超過政策 <ValueLimits>元素 <NamespaceURI> 子元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果政策中指定 <NamespaceURI> 元素為 10,但輸入酬載含有超過 10 個字元的命名空間 URI,就會擲回這個錯誤。

診斷

  1. 檢查錯誤訊息,找出 XMLThreatProtection 政策名稱,以及超過命名空間 URI 長度的行號。舉例來說,在以下錯誤訊息中,政策名稱為 XML-Threat-Protection-1,而酬載中的行號為 2

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Namespace
    uri length exceeded 10 at line 2(possibly around char 97)
    
  2. 檢查失敗政策 (如步驟 1 所示),並記下 <ValueLimits> 的 <NamespaceURI> 子元素中指定的值元素。

    在以下 XMLThreatProtection 政策範例中,<NamespaceURI> 會設為 10

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>5</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>2</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>15</Text>
            <Attribute>10</Attribute>
            <NamespaceURI>10</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>10</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行數 (如步驟 1 所示),檢查指定的命名空間 URI 長度是否超過 <NamespaceURI> 元素中指定的數字 (如步驟 2 所示)。如果字元數量超過命名空間 URI 長度,就會導致錯誤。

    以下是輸入酬載的範例:

    <?xml version = "1.0" encoding = "UTF-8"?>
      <profile:user xmlns:profile = "www.google.com/profile">
      <profile:name>Rama Krishna</profile:name>
      <profile:company>Google</profile:company>
      <profile:phone>(91) 9876543210</profile:phone>
    </profile:user>
    

    上方第 2 行顯示的 XML 酬載資料包含一個長度為 22 個字元的命名空間 URI www.google.com/profile。命名空間 URI 的長度超過 10 個字元 (為 <NamespaceURI> 元素指定的值),因此會出現下列錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Namespace
    uri length exceeded 10 at line 2(possibly around char 99)
    

解析度

如果 XMLThreatProtection 政策旨在防範超過特定命名空間 URI 長度的酬載,則系統會顯示錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果您認為可以允許較長的命名空間 URI,請根據需求將 <ValueLimits> 元素的 <NamespaceURI> 子元素修改為適當的值。

舉例來說,如果您認為命名空間 URI 的長度最多可達 30 個字元,請按照下列方式修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>5</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>2</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>30</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

NSPrefixExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Namespace prefix length exceeded [num] at line [num](possibly
        around char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Namespace prefix length exceeded 10 at line 2(possibly around char 105)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 <Source> 元素指定的輸入訊息酬載內容包含 XML 文件,且命名空間前置字串超過政策 <NameLimits> 元素 <NamespacePrefix> 子元素中指定的字元數,就會發生這個錯誤。

舉例來說,如果在 XMLThreatProtection 政策中將 <NamespacePrefix> 元素指定為 10,但輸入酬載的命名空間前置字元超過 10 個字元,系統就會擲回這個錯誤。

診斷

  1. 檢查錯誤訊息,找出 XMLThreatProtection 政策名稱,以及超過命名空間 URI 前置字串長度的行號。例如,在下列錯誤訊息中,政策名稱為 XML-Threat-Protection-1,酬載中的行號為 2

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Namespace
    prefix length exceeded 10 at line 2(possibly around char 105)
    
  2. 檢查失敗的政策 (在步驟 1 中指出),並記下 <NameLimits> 元素 <NamespacePrefix> 子元素中指定的值。

    在以下 XMLThreatProtection 政策範例中,<NamespacePrefix> 會設為 10

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>10</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>5</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>20</Text>
            <Attribute>15</Attribute>
            <NamespaceURI>40</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>30</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認其中指定的命名空間前置字串長度是否比 <NamespacePrefix> 元素 (在步驟 2 中指出) 指定的數字長。如果字元數超過命名空間前置字串限制,這就是發生錯誤的原因。

    以下是輸入酬載的範例:

    <?xml version = "1.0" encoding = "UTF-8"?>
    <userprofile:user xmlns:userprofile = "www.googlecom/profile">
      <userprofile:name>Rama Krishna</userprofile:name>
      <userprofile:company>Google</userprofile:company>
      <userprofile:phone>(011) 123-4567</userprofile:phone>
    </userprofile:user>
    

    上方第 2 行顯示的 XML 酬載包含長度為 11 個字元的命名空間前置碼 userprofile。由於命名空間 URI 前置字串長度超過 10 (這是 <NamespacePrefix> 元素指定的值),因此您會收到以下錯誤訊息:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Namespace
    prefix length exceeded 10 at line 2(possibly around char 105)
    

解析度

如果 XMLThreatProtection 政策旨在防止酬載超過特定命名空間 URI 前置字元長度,則會顯示錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果您決定允許使用更長的命名空間 URI 前置字元,請根據您的需求,將 <NameLimits> 元素的 <NamespacePrefix> 子項元素修改為適當的值。

舉例來說,如果您認為命名空間 URI 前置字串長度可達 15 個字元,請依下方方式修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>5</Attribute>
        <NamespacePrefix>15</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>2</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>15</Text>
        <Attribute>10</Attribute>
        <NamespaceURI>40</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>10</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

NSCountExceeded

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. reason: XMLThreatProtection stepDefinition [policy_name]:
        Namespace count exceeded [num] at line [num](possibly around char [num])",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed. reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Namespace count exceeded 3 at line 2(possibly around char 234)",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLThreatProtection 政策的 <Source> 元素指定的輸入訊息酬載內容包含 XML 文件,且單一元素中使用的命名空間數量超過政策 <StructureLimits> 元素 <NamespaceCountPerElement> 子元素中指定的數量,就會發生此錯誤。

舉例來說,如果政策中的 <NamespaceCountPerElement> 元素指定為 3,但輸入酬載所含元素有超過 3 個命名空間,系統就會擲回這個錯誤。

診斷

  1. 檢查錯誤訊息,找出 XMLThreatProtection 政策名稱,以及超過命名空間數量的行號。舉例來說,在以下錯誤訊息中,政策名稱為 XMLThreat-Protection-1,而酬載中的行號為 2

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Namespace count
    exceeded 3 at line 2(possibly around char 234)
    
  2. 檢查失敗政策 (如步驟 1 所示),並記下 <StructureLimits> 的 <NamespaceCountPerElement> 子元素中指定的值元素。

    在以下 XMLThreatProtection 政策範例中,<NamespaceCountPerElement> 會設為 3

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>10</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>request</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>5</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>20</Text>
            <Attribute>15</Attribute>
            <NamespaceURI>40</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>30</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    
  3. 檢查輸入酬載的特定行號 (在步驟 1 中指出),確認其中為單一元素指定的命名空間數量是否高於 <NamespaceCountPerElement> 元素 (在步驟 2 中指出) 指定的數量。如果命名空間數量超過每項元素限制的命名空間數量,就會造成錯誤。

    以下是輸入酬載的範例:

    <?xml version = "1.0" encoding = "UTF-8"?>
    <hellos xmlns:h="https://www.w3schools.com/greeting1" xmlns:a="https://www.w3schools.com/greeting2" xmlns:b="https://www.w3schols.com/greeting3" xmlns:c="https://www.w3schools.com/greeting4">
        <a:hello1>world1</a:hello1>
        <b:hello2>world2</b:hello2>
        <c:hello2>world2</c:hello2>
        <h:hello2>world2</h:hello2>
    </hellos>
    

    上方第 2 行顯示的 XML 酬載有超過 3 個命名空間。命名空間數量大於 3 (為 <NamespaceCountPerElement> 元素指定的值),因此會出現以下錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: XMLThreatProtection stepDefinition XML-Threat-Protection-1: Namespace
    count exceeded 3 at line 2(possibly around char 234)
    

解析度

如果 XMLThreatProtection 政策旨在防範單一元素中超過特定數量的命名空間,便會顯示錯誤訊息。在這種情況下,您不需要採取其他行動。

不過,如果您認為可以允許更多命名空間,請根據需求將 <StructureLimits> 元素的 <NamespaceCountPerElement> 子元素修改為適當的值。

舉例來說,如果您認為單一元素最多可包含 5 個命名空間,請按照下列方式修改政策:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>5</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>20</Text>
        <Attribute>15</Attribute>
        <NamespaceURI>40</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>30</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

InvalidXMLPayload

錯誤代碼

steps.xmlthreatprotection.ExecutionFailed

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition [policy_name]:
        Execution failed. Reason: [error_description]",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Execution failed. reason: Syntax error while parsing XML prologue",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
        }
    }
}

原因

如果 XMLProtectionPolicy 政策的 <Source> 元素指定的輸入訊息酬載不是有效的 XML 文件,就會發生這個錯誤。

診斷

  1. 查看錯誤訊息,找出發生錯誤的政策名稱。在以下範例中,政策名稱為 XML-Threat-Protection-1

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: Syntax error while parsing XML prologue
    
  2. 檢查輸入酬載,並檢查在酬載中傳遞的 XML 文件是否確實是格式正確的 XML 文件。

    以下是輸入酬載的範例:

    <?xml version="1.0" encoding="UTF-8"?>
    <bookstore>
      <book category="cooking">
        <title lang="en">Easy Indian Cooking</title>
        <author>Suneeta</author>
        <year>2004</year>
        <price>300.00</price>
      </book>
    <bookstore>
    

    在上方顯示的 XML 酬載中,第 9 行未正確關閉根元素,因為缺少 /。的 XML 格式不正確,因此您會收到下列錯誤:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: Syntax error while parsing XML prologue
    

解析度

確保將有效的輸入 XML 酬載傳遞至包含 XMLThreatProtection 政策的任何 API Proxy。

如要修正上述範例錯誤,請按照下列方式修改輸入 XML 酬載:

<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
  <book category="cooking">
    <title lang="en">Easy Indian Cooking
    <author>Suneeta</author>
    <year>2004</year>
    <price>300.00</price>
  </book>
</bookstore>

SourceUnavailable

錯誤代碼

steps.xmlthreatprotection.SourceUnavailable

錯誤回應主體

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition[policy_name]: Source[var_name] is not available"
        "detail": {
            "errorcode": "steps.xmlthreatprotection.SourceUnavailable"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "XMLThreatProtection stepDefinition XML-Threat-Protection-1:
        Source requests is not available",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.SourceUnavailable"
        }
    }
}

原因

如果 XMLThreatProtection 政策的 <Source> 元素中指定的 message 變數為下列任一情況,就會發生這個錯誤:

  • 範圍外 (不適用於執行政策的特定流程)
  • 不是有效的值 (requestresponsemessage)

舉例來說,如果政策中的 <Source> 元素設為在執行政策的流程中不存在的變數,就會發生這項錯誤。

診斷

  1. 找出 XMLThreatProtection 政策名稱,以及錯誤訊息中的「來源」變數名稱。舉例來說,在以下錯誤訊息中,XMLThreatProtection 政策名稱為 XML-Threat-Protection-1,而 Source 變數為 requests:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Source requests
    is not available
    
  2. 檢查失敗的 XMLThreatProtection 政策,並查看步驟 1 中識別的 <Source> 元素指定的值。

    在以下 XMLThreatProtection 政策範例中,<Source> 元素會設為 requests

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>10</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>requests</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>5</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>20</Text>
            <Attribute>15</Attribute>
            <NamespaceURI>40</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>30</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    

    <Source> 元素的有效值為 requestresponsemessage.。由於 requests 並非有效值,且不在執行政策的流程中,您會收到錯誤訊息:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Source requests
    is not available
    

解析度

請確認失敗的 XMLThreatProtection 政策在 <Source> 元素中設定的變數已設為 requestresponsemessage,且在政策執行的流程中存在。

如要修正上述範例政策,您可以修改 <Source> 元素,以便使用 request 變數,因為該變數存在於要求流程中:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>request</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>20</Text>
        <Attribute>15</Attribute>
        <NamespaceURI>40</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>30</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>

NonMessageVariable

錯誤代碼

steps.xmlthreatprotection.NonMessageVariable

錯誤回應主體

{
    "fault": {
        "faultstring": "Variable var_name does not resolve to a Message"
        "detail": {
            "errorcode": "steps.xmlthreatprotection.NonMessageVariable"
        }
    }
}

錯誤回應主體範例

{
    "fault": {
        "faultstring": "Variable message.content does not resolve to a Message",
        "detail": {
            "errorcode": "steps.xmlthreatprotection.NonMessageVariable"
        }
    }
}

原因

如果 XMLThreatProtection 政策中的 <Source> 元素設為非 Message 類型的變數,就會發生這個錯誤。

訊息類型變數代表整個 HTTP 要求和回應。內建的 Apigee Edge 流程變數 requestresponsemessage 是 Message 類型。如要進一步瞭解訊息變數,請參閱變數參考資料

診斷

  1. 從錯誤訊息中找出能解析為 Message 類型變數的變數名稱。例如,在以下錯誤訊息中,變數名稱為 message.content

    Variable message.content does not resolve to a Message
    
  2. 檢查發生錯誤的 API 代理程式中所有 XMLThreadProtection 政策,並找出使用上述步驟 1 中所述變數名稱指定 <Source> 元素的特定 XMLThreadProtection 政策。

    在以下 XMLThreatProtection 政策範例中,<Source> 會設為 message.content

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
        <DisplayName>XML Threat Protection-1</DisplayName>
        <Properties/>
        <NameLimits>
            <Element>10</Element>
            <Attribute>10</Attribute>
            <NamespacePrefix>10</NamespacePrefix>
            <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
        </NameLimits>
        <Source>message.content</Source>
        <StructureLimits>
            <NodeDepth>10</NodeDepth>
            <AttributeCountPerElement>5</AttributeCountPerElement>
            <NamespaceCountPerElement>3</NamespaceCountPerElement>
            <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
        </StructureLimits>
        <ValueLimits>
            <Text>20</Text>
            <Attribute>15</Attribute>
            <NamespaceURI>40</NamespaceURI>
            <Comment>10</Comment>
            <ProcessingInstructionData>30</ProcessingInstructionData>
        </ValueLimits>
    </XMLThreatProtection>
    

    由於變數 message.content 不是 Message 類型,因此您會收到以下錯誤:

    Variable message.content does not resolve to a Message
    

解析度

請確認失敗的 XMLThreatProtection 政策中的 <Source> 元素設為 Message 類型流程變數,且該變數存在於政策執行的流程中。

如要修正政策,您可以修改 <Source> 元素,指定「Message」類型的變數。舉例來說,在失敗的 XMLThreatProtection 中,您可以將 <Source> 元素指定為 message

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
    <DisplayName>XML Threat Protection-1</DisplayName>
    <Properties/>
    <NameLimits>
        <Element>10</Element>
        <Attribute>10</Attribute>
        <NamespacePrefix>10</NamespacePrefix>
        <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
    </NameLimits>
    <Source>message</Source>
    <StructureLimits>
        <NodeDepth>10</NodeDepth>
        <AttributeCountPerElement>5</AttributeCountPerElement>
        <NamespaceCountPerElement>3</NamespaceCountPerElement>
        <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
    </StructureLimits>
    <ValueLimits>
        <Text>20</Text>
        <Attribute>15</Attribute>
        <NamespaceURI>40</NamespaceURI>
        <Comment>10</Comment>
        <ProcessingInstructionData>30</ProcessingInstructionData>
    </ValueLimits>
</XMLThreatProtection>