排解 XMLThreatProtection 政策執行階段錯誤

您正在查看 Apigee Edge 說明文件。
查看 Apigee X 說明文件
資訊

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 元素,當中的子元素超過政策 <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> 的第 4 個子項元素 <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 酬載的節點深度為 6.由於節點深度大於 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> 元素中指定的數量,就會發生這個錯誤。

舉例來說,如果 XMLThreatProtection 政策中的 <AttributeCountPerElement> 元素指定為 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 酬載具有 cuisine 屬性,其值長度為 12 個字元。由於屬性值長度大於 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 政策的用意是防止酬載超過特定留言長度,則預期會顯示錯誤訊息。在這種情況下,您不需要採取其他動作。

不過,如果您決定允許使用較長的註解,請依據您的需求,將 <Comment><ValueLimits> 元素的子元素修改為適當的值。

例如,如果您認為自己最多可以有 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 文件,其中命名空間 URI 超過政策 <ValueLimits> 元素 <NamespaceURI> 子元素中指定的字元數,就會發生這個錯誤。

例如,如果在政策中將 <NamespaceURI> 元素指定為 10,但輸入酬載的命名空間 URI 長度超過 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
    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 酬載具有命名空間 URI (www.google.com/profile),長度為 22 個字元。由於命名空間 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 酬載具有命名空間前置字元 userprofile,長度為 11 個字元。由於命名空間 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,來源變數為 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 屬於訊息類型。如要進一步瞭解訊息變數,請參閱「變數參考資料」。

診斷

  1. 找出可解析為錯誤訊息中「訊息」類型變數的變數名稱。例如,在下列錯誤訊息中,變數名稱是 message.content

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

    在以下 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> 元素,指定「訊息」類型的變數。舉例來說,在失敗的 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>