Khắc phục lỗi khi bắt đầu chạy chính sách XMLchiến đấu

Bạn đang xem tài liệu về Apigee Edge.
Truy cập vào tài liệu Apigee X.
thông tin

ExecutionFailed

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Các loại lỗi và nguyên nhân có thể gây ra lỗi

Chính sách XMLThreatProtection có thể gửi nhiều loại lỗi ExecutionFailed. Bảng dưới đây liệt kê các loại lỗi và nguyên nhân có thể gây ra lỗi:

Lỗi Nguyên nhân
ElementNameExceeded Độ dài tối đa của chuỗi được phép trong thẻ XML đã vượt quá.
ChildCountExceeded Bạn đã vượt quá số lượng tối đa các phần tử con được phép trong một tải trọng XML.
NodeDepthExceeded Đã vượt quá độ sâu tối đa của các phần tử XML được phép trong tải trọng XML.
AttributeCountExceeded Bạn đã vượt quá số lượng thuộc tính tối đa trong một phần tử.
AttributeNameExceeded Độ dài tối đa được phép cho tên thuộc tính đã bị vượt quá.
AttributeValueExceeded Giá trị thuộc tính vượt quá độ dài tối đa cho phép.
TextExceeded Độ dài tối đa cho phép của văn bản đã bị vượt quá.
CommentExceeded Đã vượt quá độ dài tối đa cho phép đối với một bình luận.
PIDataExceeded Độ dài dữ liệu chỉ thị xử lý được cho phép đã vượt quá.
PITargetExceeded Độ dài tên hướng dẫn quy trình đã vượt quá.
NSURIExceeded Đã vượt quá độ dài URL không gian tên.
NSPrefixExceeded Đã vượt quá độ dài tiền tố không gian tên.
NSCountExceeded Số lượng không gian tên được dùng trong một phần tử duy nhất đã vượt quá.
Tải trọng XML không hợp lệ Tải trọng XML đầu vào không hợp lệ.

ElementNameExceeded

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

Lưu lượng truy cập trong thời gian chạy trả về mã phản hồi 500 kèm theo lỗi sau:

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng đầu vào do phần tử <Source> của chính sách chỉ định có chứa các phần tử XML vượt quá độ dài tối đa được chỉ định trong phần tử <Element> bên dưới phần tử <NameLimits>.

Ví dụ: nếu phần tử <Element> được chỉ định là 5 trong chính sách XMLThreatProtection, nhưng tải trọng đầu vào có một phần tử có nhiều hơn 5 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection, số dòng và số ký tự có thể có trong tải trọng đầu vào mà độ dài phần tử đã vượt quá.

    Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1,, số dòng trong tải trọng là 1 và số ký tự có thể có là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử <Element>.

    Ví dụ: trong chính sách XMLThreatProtection sau đây, <Element> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của phần tử trên dòng đó có lớn hơn giá trị được chỉ định cho phần tử <Element> (được xác định ở Bước 2) hay không. Nếu độ dài của phần tử vượt quá giá trị này, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

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

    Tải trọng XML ở trên có một phần tử gốc tên là company ở dòng 1, có 7 ký tự. Vì độ dài của phần tử lớn hơn 5 (giá trị được chỉ định cho phần tử <Element>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreadProtection nhằm mục đích bảo vệ chống lại các tải trọng có tên phần tử vượt quá giá trị đã xác định, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể chỉ định các phần tử dài hơn trong tải trọng mà không gây ra hậu quả nào, thì hãy sửa đổi <Element> thành một giá trị phù hợp dựa trên các yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng mình có thể cho phép các phần tử có độ dài tối đa là 10, hãy sửa đổi chính sách XMLThreatProtection như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> chỉ định chứa một phần tử XML có nhiều phần tử con hơn giá trị được chỉ định trong phần tử <ChildCount> của chính sách.

Ví dụ: nếu phần tử <ChildCount> là 3, nhưng tải trọng XML đầu vào có một phần tử có hơn 3 phần tử con, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà số mục nhập vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử <ChildCount>.

    Trong ví dụ về chính sách sau đây, <ChildCount> được đặt thành 3(lưu ý rằng nhận xét, bao gồm cả các phần tử và những phần tử khác đều được tính vào giới hạn này):

    <?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. Kiểm tra số dòng cụ thể (được xác định trong Bước 1) của tải trọng đầu vào và kiểm tra xem số lượng phần tử con (bao gồm tất cả các bình luận, v.v.) trong tải trọng có lớn hơn giá trị được chỉ định cho phần tử <ChildCount> (được xác định trong Bước 2) hay không. Nếu số lượng phần tử con vượt quá số lượng con, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

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

    Trong tải trọng XML nêu trên, dòng 5 chứa phần tử con thứ tư <director> của phần tử gốc <movie>. Vì số lượng phần tử con trong tải trọng XML đầu vào lớn hơn 3 (giá trị được chỉ định cho phần tử <ChildCount>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại các tải trọng có số lượng phần tử con vượt quá một ngưỡng cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể đưa một số lượng lớn hơn các phần tử con (bao gồm cả bình luận, v.v.) vào tải trọng mà không gây ra hậu quả nào, thì hãy sửa đổi <ChildCount> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng mình có thể cho phép tối đa 10 phần tử con, hãy sửa đổi chính sách XMLThreatProtection như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> chỉ định chứa một tài liệu XML trong đó hệ thống phân cấp nút vượt quá số lượng được chỉ định trong phần tử <NodeDepth> của chính sách XMLThreatProtection.

Ví dụ: nếu phần tử <NodeDepth> được chỉ định là 4 trong chính sách, nhưng tải trọng đầu vào có độ sâu nút vượt quá 4, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà độ sâu của nút vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách XMLThreatProtection không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử <NodeDepth>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <NodeDepth> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ sâu của nút được chỉ định ở đó có số lượng cao hơn số lượng được chỉ định trong phần tử <NodeDepth> (được xác định ở Bước 2) hay không. Nếu số lượng phần tử con XML vượt quá số lượng, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

    <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>
    

    Tải trọng XML xuất hiện ở trên tại dòng 6 có độ sâu nút là 6.Vì độ sâu nút lớn hơn 5 (giá trị được chỉ định cho phần tử <NodeDepth>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại các tải trọng có ngưỡng độ sâu nút cụ thể, thì thông báo lỗi này là điều có thể xảy ra. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép độ sâu nút lớn hơn, hãy sửa đổi <NodeDepth> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng bạn có thể cho phép độ sâu của nút lên đến 10, thì hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML trong đó số lượng thuộc tính của một phần tử duy nhất vượt quá số lượng được chỉ định trong phần tử <AttributeCountPerElement> của chính sách.

Ví dụ: nếu phần tử <AttributeCountPerElement> được chỉ định là 2 trong chính sách XMLThreatProtection, nhưng tải trọng đầu vào có một phần tử có hơn 2 thuộc tính, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà số lượng thuộc tính vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XMLThreat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử <AttributeCountPerElement>.

    Trong ví dụ sau về chính sách, <AttributeCountPerElement> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem số lượng thuộc tính được chỉ định có vượt quá số lượng được chỉ định trong phần tử <AttributeCountPerElementh> (được xác định ở Bước 2) hay không. Nếu số lượng thuộc tính vượt quá số lượng, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML ở trên tại dòng 3 có một phần tử với 3 thuộc tính. Vì số lượng thuộc tính lớn hơn 2 (giá trị được chỉ định cho phần tử <AttributeCountPerElement>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại những tải trọng vượt quá một số lượng thuộc tính cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép nhiều thuộc tính hơn, hãy sửa đổi <AttributeCountPerElement> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: nếu bạn cho rằng bạn có thể cho phép tối đa 5 thuộc tính cho mỗi phần tử, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML trong đó tên thuộc tính vượt quá số ký tự được chỉ định trong phần tử con <Attribute> của phần tử <NameLimits> trong chính sách.

Ví dụ: nếu phần tử <Attribute> được chỉ định là 5 trong chính sách, nhưng tải trọng đầu vào có tên thuộc tính dài hơn 5 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà độ dài tên thuộc tính vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử <Attribute>

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <Attribute> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của thuộc tính được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <Attribute> (được xác định ở Bước 2) hay không. Nếu số ký tự vượt quá giá trị thuộc tính, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML xuất hiện ở trên tại dòng 3 có 2 thuộc tính category và cuisine với độ dài tên lần lượt là 8 và 7 ký tự. Vì độ dài tên thuộc tính lớn hơn 5 (giá trị được chỉ định cho phần tử <Attribute>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại các tải trọng vượt quá độ dài tên thuộc tính cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép độ dài tên thuộc tính dài hơn, hãy sửa đổi <Attribute> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng mình có thể có tên thuộc tính dài tối đa 10 ký tự, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách chỉ định chứa một tài liệu XML trong đó giá trị thuộc tính vượt quá số ký tự được chỉ định trong phần tử con <Attribute> của phần tử <ValueLimits>.

Ví dụ: nếu phần tử <Attribute> được chỉ định là 10 trong chính sách XMLThreatProtection, nhưng tải trọng đầu vào có giá trị thuộc tính có hơn 10 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà số lượng thuộc tính vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <Attribute> của phần tử <ValueLimits>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <Attribute> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của giá trị thuộc tính được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <Attribute> (được xác định ở Bước 2) hay không. Nếu số ký tự vượt quá giá trị thuộc tính, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML ở trên tại dòng 3 có một thuộc tính (ẩm thực) với độ dài giá trị là 12 ký tự. Vì độ dài giá trị thuộc tính lớn hơn 10 (giá trị được chỉ định cho phần tử <Attribute>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại những tải trọng vượt quá độ dài giá trị thuộc tính cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép các giá trị thuộc tính dài hơn, hãy sửa đổi phần tử con <Attribute> của phần tử <ValueLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng mình có thể phân bổ các giá trị có tối đa 15 ký tự, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML trong đó độ dài văn bản của một phần tử vượt quá số ký tự được chỉ định trong phần tử con <Text> của phần tử <ValueLimits> trong chính sách.

Ví dụ: nếu phần tử <Text> được chỉ định là 15 trong chính sách, nhưng tải trọng đầu vào có văn bản dài hơn 15 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà số lượng thuộc tính vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <Text> của phần tử <ValueLimits>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <Text> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của giá trị thuộc tính được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <Text> (được xác định ở Bước 2) hay không. Nếu số ký tự vượt quá giá trị thuộc tính, thì đó là nguyên nhân gây ra lỗi.

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

    Tải trọng XML ở trên tại dòng 4 có văn bản với độ dài 53 ký tự. Vì độ dài giá trị thuộc tính lớn hơn 15 (giá trị được chỉ định cho phần tử <Text>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại các tải trọng vượt quá một độ dài văn bản cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép độ dài văn bản dài hơn, hãy sửa đổi phần tử con <Text> của phần tử <ValueLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: nếu bạn cho rằng mình có thể có giá trị thuộc tính dài tối đa 60 ký tự, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML có độ dài bình luận vượt quá số ký tự được chỉ định trong phần tử con <Comment> của phần tử <ValueLimits> trong chính sách.

Ví dụ: nếu phần tử <Comment> được chỉ định là 10 trong chính sách, nhưng tải trọng đầu vào có một nhận xét dài hơn 10 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà độ dài bình luận vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định trong Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <Comment> của phần tử <ValueLimits>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <Comment> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của nhận xét được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <Comment> (được xác định ở Bước 2) hay không. Nếu số ký tự vượt quá giá trị thuộc tính, thì đó là nguyên nhân gây ra lỗi.

    Dưới đây là một ví dụ về tải trọng đầu vào:

    <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>
    

    Tải trọng XML xuất hiện ở trên tại dòng 2 có một chú thích với độ dài giá trị là 31 ký tự. Vì độ dài chú thích lớn hơn 10 (giá trị được chỉ định cho phần tử <Comment>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ khỏi những tải trọng vượt quá độ dài bình luận cụ thể, thì thông báo lỗi này là điều dự kiến. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép bình luận dài hơn, hãy sửa đổi phần tử con <Comment> của phần tử <ValueLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng mình có thể phân bổ giá trị tối đa 40 ký tự, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML trong đó một chỉ dẫn xử lý dữ liệu vượt quá số ký tự được chỉ định trong phần tử con <ProcessingInstructionData> của phần tử <ValueLimits> trong chính sách.

Ví dụ: nếu phần tử <ProcessingInstructionData> được chỉ định là 10 trong chính sách XMLThreatProtection, nhưng tải trọng đầu vào có một chỉ thị xử lý có hơn 10 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà độ dài chỉ thị xử lý vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định trong Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <ProcessingInstructionData> của phần tử <ValueLimits> .

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <ProcessingInstructionData> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của dữ liệu chỉ dẫn xử lý được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <ProcessingInstructionData> (được xác định ở Bước 2) hay không. Nếu số lượng ký tự vượt quá dữ liệu chỉ dẫn xử lý, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML nêu trên ở dòng 1 có một phần tử dữ liệu chỉ dẫn xử lý (type="text/xsl" href="mobilephones.xsl"?)có độ dài 40 ký tự. Vì độ dài này lớn hơn 30 (giá trị được chỉ định cho phần tử <ProcessingInstructionData>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại những tải trọng vượt quá độ dài dữ liệu chỉ thị xử lý cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu xác định rằng bạn có thể cho phép các phần tử dữ liệu chỉ dẫn xử lý dài hơn, hãy sửa đổi phần tử con <ProcessingInstructionData> của phần tử <ValueLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng mình có thể có độ dài hướng dẫn xử lý dữ liệu lên đến 50 ký tự, thì hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML trong đó đích đến của chỉ thị xử lý vượt quá số ký tự được chỉ định trong phần tử con <ProcessingInstructionTarget> của phần tử <NameLimits> trong chính sách.

Ví dụ: nếu phần tử <ProcessingInstructionTarget> được chỉ định là 10 trong chính sách XMLThreatProtection, nhưng tải trọng đầu vào có một đích đến của chỉ thị xử lý có hơn 10 ký tự, thì lỗi này sẽ xuất hiện.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà số lượng mục tiêu chỉ thị xử lý vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách XMLThreatProtection không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <ProcessingInstructionTarget> của phần tử <NameLimits>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <ProcessingInstructionTarget> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của đích hướng dẫn xử lý được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <ProcessingInstructionTarget> (được xác định ở Bước 2) hay không. Nếu số lượng ký tự vượt quá giới hạn kích thước mục tiêu, thì đó là nguyên nhân gây ra lỗi.

    Dưới đây là một ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML xuất hiện ở dòng 2 có tên mục tiêu hướng dẫn xử lý "xml-stylesheet"" với độ dài 14 ký tự. Vì tên đích của chỉ thị xử lý dài hơn 10 (giá trị được chỉ định cho phần tử <ProcessingInstructionTarget>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ khỏi những tải trọng vượt quá độ dài mục tiêu hướng dẫn xử lý cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng mục tiêu hướng dẫn xử lý có thể dài hơn, hãy sửa đổi phần tử con <ProcessingInstructionTarget> của phần tử <NameLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng mình có thể có mục tiêu hướng dẫn quy trình tối đa 25 ký tự, hãy sửa đổi chính sách như sau:

  <?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML mà URI Namespace vượt quá số ký tự được chỉ định trong phần tử con <NamespaceURI> của phần tử <ValueLimits> trong chính sách.

Ví dụ: nếu phần tử <NamespaceURI> được chỉ định là 10 trong chính sách, nhưng tải trọng đầu vào có URI không gian tên có hơn 10 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà độ dài URI không gian tên vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <NamespaceURI> của phần tử <ValueLimits>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <NamespaceURI> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của URI không gian tên được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <NamespaceURI> (được xác định ở Bước 2) hay không. Nếu số ký tự vượt quá độ dài URI không gian tên, thì đó là nguyên nhân gây ra lỗi.

    Dưới đây là một ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML xuất hiện ở trên tại dòng 2 có một URI không gian tên, www.google.com/profile, với độ dài 22 ký tự. Vì độ dài URI không gian tên lớn hơn 10 (giá trị được chỉ định cho phần tử <NamespaceURI>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại các tải trọng vượt quá độ dài URI không gian tên cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép URI không gian tên dài hơn, hãy sửa đổi phần tử con <NamespaceURI> của phần tử <ValueLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng có thể có độ dài URI không gian tên lên đến 30 ký tự, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> chỉ định chứa một tài liệu XML trong đó tiền tố Namespace vượt quá số ký tự được chỉ định trong phần tử con <NamespacePrefix> của phần tử <NameLimits> trong chính sách.

Ví dụ: nếu phần tử <NamespacePrefix> được chỉ định là 10 trong chính sách XMLThreatProtection, nhưng tải trọng đầu vào có tiền tố không gian tên có hơn 10 ký tự, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà độ dài tiền tố URI không gian tên vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XML-Threat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <NamespacePrefix> của phần tử <NameLimits>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <NamespacePrefix> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của tiền tố không gian tên được chỉ định ở đó có nhiều ký tự hơn số lượng được chỉ định trong phần tử <NamespacePrefix> (được xác định ở Bước 2) hay không. Nếu số lượng ký tự vượt quá giới hạn tiền tố không gian tên, thì đó là nguyên nhân gây ra lỗi.

    Dưới đây là một ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML ở trên tại dòng 2 có tiền tố không gian tên userprofile với độ dài 11 ký tự. Vì độ dài tiền tố URI không gian tên lớn hơn 10 (giá trị được chỉ định cho phần tử <NamespacePrefix>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ khỏi những tải trọng vượt quá độ dài tiền tố URI không gian tên cụ thể, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép tiền tố URI không gian tên dài hơn, hãy sửa đổi phần tử con <NamespacePrefix> của phần tử <NameLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: nếu bạn cho rằng có thể có độ dài tiền tố URI không gian tên lên đến 15 ký tự, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

{
    "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"
        }
    }
}

Ví dụ về nội dung phản hồi Lỗi

{
    "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"
        }
    }
}

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLThreatProtection chỉ định chứa một tài liệu XML trong đó số lượng không gian tên được dùng trong một phần tử duy nhất vượt quá số lượng được chỉ định trong phần tử con <NamespaceCountPerElement> của phần tử <StructureLimits> trong chính sách.

Ví dụ: nếu phần tử <NamespaceCountPerElement> được chỉ định là 3 trong chính sách, nhưng tải trọng đầu vào có một phần tử có hơn 3 không gian tên, thì lỗi này sẽ xảy ra.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách XMLThreatProtection và số dòng mà số lượng không gian tên vượt quá. Ví dụ: trong thông báo lỗi sau, tên chính sách là XMLThreat-Protection-1 và số dòng trong tải trọng là 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. Kiểm tra chính sách không thành công (được xác định ở Bước 1) và lưu ý giá trị được chỉ định trong phần tử con <NamespaceCountPerElement> của phần tử <StructureLimits>.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <NamespaceCountPerElement> được đặt thành 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. Kiểm tra số dòng cụ thể (được xác định ở Bước 1) của tải trọng đầu vào và kiểm tra xem số lượng không gian tên được chỉ định ở đó cho một phần tử có cao hơn số lượng được chỉ định trong phần tử <NamespaceCountPerElement> (được xác định ở Bước 2) hay không. Nếu số lượng không gian tên vượt quá giới hạn số lượng không gian tên cho mỗi phần tử, thì đó là nguyên nhân gây ra lỗi.

    Sau đây là ví dụ về tải trọng đầu vào:

    <?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>
    

    Tải trọng XML ở trên tại dòng 2 có hơn 3 không gian tên. Vì số lượng không gian tên lớn hơn 3 (giá trị được chỉ định cho phần tử <NamespaceCountPerElement>), nên bạn sẽ gặp lỗi sau:

    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)
    

Độ phân giải

Nếu chính sách XMLThreatProtection nhằm mục đích bảo vệ chống lại những tải trọng vượt quá một số lượng không gian tên cụ thể trong một phần tử, thì thông báo lỗi sẽ xuất hiện. Trong trường hợp này, bạn không cần làm gì thêm.

Tuy nhiên, nếu bạn xác định rằng có thể cho phép nhiều không gian tên hơn, hãy sửa đổi phần tử con <NamespaceCountPerElement> của phần tử <StructureLimits> thành một giá trị phù hợp dựa trên yêu cầu của bạn.

Ví dụ: Nếu bạn cho rằng có thể có tối đa 5 không gian tên trong một phần tử, hãy sửa đổi chính sách như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.ExecutionFailed

Nội dung phản hồi lỗi

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

Ví dụ về nội dung phản hồi Lỗi

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

Nguyên nhân

Lỗi này xảy ra nếu tải trọng thông báo đầu vào do phần tử <Source> của chính sách XMLProtectionPolicy chỉ định không phải là một Tài liệu XML hợp lệ.

Chẩn đoán

  1. Kiểm tra thông báo lỗi để xác định tên chính sách xảy ra lỗi. Trong ví dụ sau, tên chính sách là XML-Threat-Protection-1.

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Execution failed.
    reason: Syntax error while parsing XML prologue
    
  2. Kiểm tra tải trọng đầu vào và xem tài liệu XML được truyền trong tải trọng có thực sự là một tài liệu XML có cấu trúc hợp lệ hay không.

    Sau đây là ví dụ về tải trọng đầu vào:

    <?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>
    

    Trong tải trọng XML nêu trên, dòng 9 không đóng phần tử gốc đúng cách vì thiếu /. Vì đây không phải là XML được định dạng đúng cách, nên bạn sẽ gặp lỗi:

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

Độ phân giải

Đảm bảo rằng một tải trọng XML đầu vào hợp lệ được truyền đến mọi proxy API có chứa chính sách XMLThreatProtection.

Để sửa lỗi ví dụ được mô tả ở trên, hãy sửa đổi tải trọng XML đầu vào như sau:

<?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

Mã lỗi

steps.xmlthreatprotection.SourceUnavailable

Nội dung phản hồi lỗi

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

Ví dụ về nội dung phản hồi Lỗi

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

Nguyên nhân

Lỗi này xảy ra nếu biến message được chỉ định trong phần tử <Source> của chính sách XMLThreatProtection là:

  • Ngoài phạm vi (không có trong quy trình cụ thể nơi chính sách đang được thực thi)
  • Không phải là một trong các giá trị hợp lệ request, response hoặc message

Ví dụ: lỗi này xảy ra nếu phần tử <Source> trong chính sách được đặt thành một biến không tồn tại trong luồng mà chính sách được thực thi.

Chẩn đoán

  1. Xác định tên chính sách XMLThreatProtection và tên của biến Nguồn trong thông báo lỗi. Ví dụ: trong thông báo lỗi sau, tên chính sách XMLThreatProtection là XML-Threat-Protection-1 và biến Nguồn là requests:

    XMLThreatProtection stepDefinition XML-Threat-Protection-1: Source requests
    is not available
    
  2. Kiểm tra chính sách XMLThreatProtection không thành công và kiểm tra giá trị được chỉ định cho phần tử <Source> được xác định ở Bước 1.

    Trong ví dụ sau về chính sách XMLThreatProtection, phần tử <Source> được đặt thành 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>
    

    Các giá trị hợp lệ cho phần tử <Source> là request, response hoặc message.. Vì requests không phải là giá trị hợp lệ và không tồn tại trong quy trình mà chính sách đang được thực thi, nên bạn sẽ gặp lỗi:

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

Độ phân giải

Đảm bảo rằng biến được đặt trong phần tử <Source> của chính sách XMLThreatProtection không thành công được đặt thành request, response hoặc message và tồn tại trong luồng mà chính sách thực thi.

Để sửa chính sách mẫu nêu trên, bạn có thể sửa đổi phần tử <Source> để sử dụng biến request vì biến này có trong quy trình yêu cầu:

<?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

Mã lỗi

steps.xmlthreatprotection.NonMessageVariable

Nội dung phản hồi lỗi

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

Ví dụ về nội dung phản hồi Lỗi

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

Nguyên nhân

Lỗi này xảy ra nếu phần tử <Source> trong chính sách XMLThreatProtection được đặt thành một biến không thuộc loại Message.

Các biến thuộc loại thông báo đại diện cho toàn bộ yêu cầu và phản hồi HTTP. Các biến luồng Apigee Edge tích hợp sẵn request, response và message thuộc loại Thông báo. Để tìm hiểu thêm về các biến thông báo, hãy xem phần Tài liệu tham khảo về biến.

Chẩn đoán

  1. Xác định tên của biến phân giải thành một biến thuộc loại Thông báo trong thông báo lỗi. Ví dụ: trong thông báo lỗi sau, tên của biến là message.content

    Variable message.content does not resolve to a Message
    
  2. Kiểm tra tất cả các chính sách XMLThreadProtection trong proxy API nơi xảy ra lỗi và xác định chính sách XMLThreadProtection cụ thể nơi phần tử <Source> được chỉ định bằng tên biến được xác định trong Bước 1 ở trên.

    Trong ví dụ về chính sách XMLThreatProtection sau đây, <Source> được đặt thành 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>
    

    Vì biến message.content không thuộc loại Message, nên bạn sẽ gặp lỗi:

    Variable message.content does not resolve to a Message
    

Độ phân giải

Đảm bảo rằng phần tử <Source> trong chính sách XMLThreatProtection không thành công được đặt thành biến luồng thuộc loại Message có trong luồng mà chính sách thực thi.

Để sửa chính sách này, bạn có thể sửa đổi phần tử <Source> để chỉ định một biến thuộc loại Message. Ví dụ: trong XMLThreatProtection không thành công, bạn có thể chỉ định phần tử <Source> là 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>