Bạn đang xem tài liệu về Apigee Edge.
Chuyển đến tài liệu về
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" } } }
Nội dung phản hồi mẫu cho 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ể xảy ra
Chính sách XML AeeGuard 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 khác nhau và nguyên nhân có thể xảy ra của các lỗi đó:
Lỗi | Nguyên nhân |
ElementNameExceeded | Thẻ XML đã vượt quá độ dài tối đa cho phép. |
ChildCountExceeded | Đã vượt quá số lượng phần tử con tối đa được phép trong tải trọng XML. |
NodeDepthExceeded | Độ sâu tối đa của các phần tử XML được cho phép trong tải trọng XML đã vượt quá. |
AttributeCountExceeded | Đã vượt quá số lượng thuộc tính tối đa trong một phần tử. |
AttributeNameExceeded | Tên thuộc tính đã vượt quá độ dài tối đa cho phép. |
AttributeValueExceeded | Đã vượt quá độ dài tối đa cho phép đối với một giá trị thuộc tính. |
TextExceeded | Đã vượt quá độ dài tối đa cho phép đối với văn bản. |
CommentExceeded | Một bình luận đã vượt quá độ dài tối đa cho phép. |
PIDataExceeded | Đã vượt quá độ dài dữ liệu lệnh xử lý được phép. |
PITargetExceeded | Đã vượt quá độ dài tên hướng dẫn quá trình. |
NSURIExceeded | Đã vượt quá độ dài URL của không gian tên. |
NSPrefixExceeded | Vượt quá độ dài tiền tố không gian tên. |
NSCountExceeded | Đã vượt quá số lượng dấu cách tên được sử dụng trong một phần tử. |
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 với 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" } } }
Nội dung phản hồi mẫu cho 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 chứa các phần tử XML vượt quá độ dài tối đa đã chỉ định trong phần tử <Element>
bên dưới phần tử <NameLimits>
.
Chẳng hạn, nếu phần tử <Element>
được chỉ định là 5
trong chính sách XML AeProtection, nhưng phần tải trọng đầu vào lại có một phần tử có nhiều hơn 5 ký tự, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên chính sách XML XinProtection, số dòng và số ký tự có thể có trong tải trọng đầu vào có vượt quá độ dài phần tử.
Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định trong Bước 1) và lưu ý giá trị được chỉ định trong phần tử
<Element>
.Ví dụ: trong chính sách XMLedProtection sau đây,
<Element>
được đặt thành5
:<?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>
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>
hay không (đã xác định trong Bước 2). Nếu chiề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.Dưới đâ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 hiển thị ở trên có thành phần gốc tên là
company
ở dòng 1, có 7 ký tự. Vì chiều 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 được thiết kế để bảo vệ các gói dữ liệu có tên phần tử vượt quá giá trị đã xác định, thì bạn sẽ thấy thông báo lỗi 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 dẫn đến hậu quả nào, hãy sửa đổi <Element>
thành một giá trị phù hợp tuỳ theo 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 phần tử, hãy sửa đổi chính sách XML AeProtection 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" } } }
Nội dung phản hồi mẫu cho 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 phần tử XML chứa 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ó nhiều hơn 3 phần tử con, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên chính sách XML XinProtection và số dòng nơi vượt quá số mục nhập. Ví dụ: trong thông báo lỗi sau đây, 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)"
Kiểm tra chính sách không đạt (xác định trong Bước 1) và lưu ý giá trị được chỉ định trong phần tử
<ChildCount>
.Trong ví dụ sau về chính sách,
<ChildCount>
được đặt thành3
(lưu ý rằng nhận xét, bao gồm các phần tử và các phần tử khác sẽ được tính vào hạn mức 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>
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ả nhận xét, v.v.) trong tải trọng có lớn hơn giá trị được chỉ định cho phần tử
<ChildCount>
(đã 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 phần tử con, thì đó là nguyên nhân gây ra lỗi.Dưới đâ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 như minh hoạ ở 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 bạn muốn thiết lập chính sách XML XineProtection để 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ì sẽ có thông báo lỗi xuất hiện. Trong trường hợp này, bạn không cần phải làm gì thêm.
Tuy nhiên, nếu bạn xác định rằng có thể đưa nhiều phần tử con (bao gồm cả nhận xét, v.v.) vào tải trọng mà không gây ra hậu quả nào, hãy sửa đổi <ChildCount>
thành một giá trị phù hợp tuỳ theo 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 XMLedProtection 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" } } }
Nội dung phản hồi mẫu cho 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 tài liệu XML, trong đó hệ 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 XML AeProtection.
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ẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên chính sách XML XinProtection và số dòng tại đó độ sâu nút bị vượt quá. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách XML AeeGuard không thành công (xác định ở Bước 1) và ghi lại giá trị được chỉ định trong phần tử
<NodeDepth>
.Trong ví dụ sau đây về chính sách XML HayProtection,
<NodeDepth>
được đặt thành5
:<?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>
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âu nút được chỉ định ở đó có số lượng cao hơn số được chỉ định trong phần tử
<NodeDepth>
hay không (đã xác định trong Bước 2). Nếu mức độ phần tử con XML vượt quá số lượng, thì đó là nguyên nhân gây ra lỗi.Dưới đâ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 minh hoạ phía 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 bạn muốn thiết lập chính sách XML vẽ lại mối đe doạ để ngăn chặn các tải trọng có ngưỡng về độ sâu nút 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 chiều sâu nút lớn hơn, hãy sửa đổi <NodeDepth>
thành một giá trị phù hợp tuỳ theo yêu cầu của bạn.
Ví dụ: nếu bạn cho rằng mình có thể cho phép chiều sâu nút tối đa là 10, 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" } } }
Nội dung phản hồi mẫu cho 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 XML XinProtection 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ử vượt quá số lượng thuộc tính đượ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áchXMLProtection, nhưng phần tử dữ liệu đầu vào lại có một phần tử có nhiều hơn 2 thuộc tính, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên của chính sách XML XinProtection và số dòng nơi vượt quá số lượng thuộc tính. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định trong Bước 1) và lưu ý giá trị được chỉ định trong phần tử
<AttributeCountPerElement>
.Trong ví dụ sau đây về chính sách,
<AttributeCountPerElement>
được đặt thành2
:<?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>
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 thuộc tính được chỉ định có vượt quá số dòng được chỉ định trong phần tử
<AttributeCountPerElementh>
hay không (xác định trong Bước 2). 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.Dưới đâ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 như minh hoạ ở trên tại dòng 3 có một phần tử với ba 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 bạn muốn dùng chính sách XML 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 bạn có thể cho phép số lượng thuộc tính lớn hơn, hãy sửa đổi <AttributeCountPerElement>
thành một giá trị phù hợp tuỳ theo 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 5 thuộc tính trên 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" } } }
Nội dung phản hồi mẫu cho 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 phần tử <Source>
của chính sách XML<Attribute>
<NameLimits>
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ẽ được tạo ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên chính sách XML XinProtection và số dòng vượt quá độ dài tên thuộc tính. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định trong Bước 1) và lưu ý giá trị được chỉ định trong phần tử
<Attribute>
Trong ví dụ sau đây về chính sách XML HayProtection,
<Attribute>
được đặt thành5
:<?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>
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 độ dài của thuộc tính được chỉ định ở đó có nhiều ký tự hơn số được chỉ định trong phần tử
<Attribute>
hay không (đã xác định trong Bước 2). Nếu số lượng 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à 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 hiển thị ở dòng 3 ở trên có hai thuộc tính
category
vàcuisine
với tên có độ dài 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 bạn muốn dùng chính sách XML Trong trường hợp này, bạn không cần làm gì thêm.
Tuy nhiên, nếu cho phép độ dài tên thuộc tính dài hơn, bạn có thể sửa đổi <Attribute>
thành giá trị phù hợp tuỳ theo yêu cầu của mình.
Ví dụ: Nếu bạn cho rằng mình có thể đặt tên thuộc tính gồm 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" } } }
Nội dung phản hồi mẫu cho 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 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>
.
Chẳng hạn như nếu phần tử <Attribute>
được chỉ định là 10
trong chính sách XML AeProtection, nhưng phần tải trọng đầu vào lại có giá trị thuộc tính dài hơn 10 ký tự, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên của chính sách XML XinProtection và số dòng nơi vượt quá số lượng thuộc tính. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (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ụ sau đây về chính sách XML vết đe doạ,
<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>
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 độ dài của giá trị thuộc tính được chỉ định ở đó có nhiều ký tự hơn số được chỉ định trong phần tử
<Attribute>
hay không (đã xác định trong Bước 2). Nếu số lượng 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à 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 được hiển thị ở trên tại dòng 3 có một thuộc tính (cuisine) 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 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 bạn muốn dùng chính sách XML Trong trường hợp này, bạn không cần làm gì thêm.
Tuy nhiên, nếu thấy rằng bạn có thể cho phép 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ể gán giá trị 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>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" } } }
Nội dung phản hồi mẫu cho 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 được chỉ định trong phần tử <Source>
của chính sách XML AeProtection 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>
thuộc phần tử <ValueLimits>
của 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ẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên của chính sách XML XinProtection và số dòng nơi vượt quá số lượng thuộc tính. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (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ụ sau đây về chính sách XML HayProtection,
<Text>
được đặt thành15
:<?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>
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 độ dài của giá trị thuộc tính được chỉ định ở đó có nhiều ký tự hơn số được chỉ định trong phần tử
<Text>
hay không (đã xác định trong Bước 2). Nếu số lượng 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 hiển thị ở trên ở dòng 4 có văn bản 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 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 bạn muốn thiết lập chính sách XML AeProtection khỏi các gói dữ liệu vượt quá một độ dài văn bản cụ thể, thì bạn sẽ thấy thông báo lỗi 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 cho phép văn bản có độ dài 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ể đặt giá trị thuộc tính lên đến 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" } } }
Nội dung phản hồi mẫu cho 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 phần tử thông báo đầu vào do phần tử <Source>
của chính sách XML AeProtection chỉ định có chứa một tài liệu XML, trong đó độ dài nhận xét vượt quá số ký tự được chỉ định trong phần tử con <Comment>
thuộc phần tử <ValueLimits>
của 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ó nhận xét dài hơn 10 ký tự, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên của chính sách XML XinProtection và số dòng nơi vượt quá độ dài nhận xét. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định ở 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ụ sau đây về chính sách XML HayProtection,
<Comment>
được đặt thành10
:<?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>
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 trong đó có nhiều ký tự hơn số được chỉ định trong phần tử
<Comment>
hay không (đã xác định trong Bước 2). Nếu số lượng 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à 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 hiển thị ở 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 bạn muốn dùng chính sách XML Trong trường hợp này, bạn không cần làm gì thêm.
Tuy nhiên, nếu thấy có thể chấp nhận ghi chú dài hơn, bạn có thể sửa đổi <Comment>
phần tử con 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ể gán giá trị lên đến 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" } } }
Nội dung phản hồi mẫu cho 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 XML AeProtection chỉ định chứa một tài liệu XML, trong đó lệnh xử lý dữ liệu vượt quá số lượng ký tự được chỉ định trong phần tử con <ProcessingInstructionData>
thuộc phần tử <ValueLimits>
của chính sách.
Ví dụ: nếu phần tử <ProcessingInstructionData>
được chỉ định là 10
trong chính sách XML AeProtection, nhưng tải trọng đầu vào có lệnh xử lý dài hơn 10 ký tự, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên của chính sách XML XinProtection và số dòng nơi vượt quá độ dài lệnh xử lý. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định ở 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ụ sau đây về chính sách XML HayProtection,
<ProcessingInstructionData>
được đặt thành30
:<?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>
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 độ dài của dữ liệu lệnh xử lý được chỉ định ở đó có nhiều ký tự hơn số được chỉ định trong phần tử
<ProcessingInstructionData>
hay không (xác định trong Bước 2). Nếu số lượng ký tự vượt quá dữ liệu lệnh xử lý thì đó là nguyên nhân gây ra lỗi.Dưới đâ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 minh hoạ ở trên tại dòng 1 có phần tử dữ liệu lệnh xử lý (
type="text/xsl" href="mobilephones.xsl"?)
có độ dài 40 ký tự.
) Vì chiều 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 bạn muốn dùng chính sách XML 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 phần tử dữ liệu lệnh 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ể dài tối đa 50 ký tự cho lệnh xử lý dữ liệu, 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" } } }
Nội dung phản hồi mẫu cho 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 phần tử thông báo đầu vào do phần tử <Source>
của chính sách XML AeProtection chỉ định chứa một tài liệu XML, trong đó mục tiêu của lệnh xử lý vượt quá số lượng ký tự được chỉ định trong phần tử con <ProcessingInstructionTarget>
thuộc phần tử <NameLimits>
của chính sách.
Chẳng hạn như nếu phần tử <ProcessingInstructionTarget>
được chỉ định là 10
trong chính sách XML AeProtection, nhưng tải trọng đầu vào có mục tiêu hướng dẫn quy trình dài hơn 10 ký tự, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên chính sách XML XinProtection và số dòng nơi vượt quá số mục tiêu lệnh xử lý. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách XML AeeGuard không thành công (xác định trong Bước #1) và để ý đến giá trị được chỉ định trong phần tử con
<ProcessingInstructionTarget>
của phần tử<NameLimits
>.Trong ví dụ sau đây về chính sách XML HayProtection,
<ProcessingInstructionTarget>
được đặt thành10
:<?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>
Kiểm tra số dòng cụ thể (xác định trong Bước 1) của tải trọng đầu vào và kiểm tra xem độ dài của mục tiêu lệnh xử lý được chỉ định tại đó có nhiều ký tự hơn số được chỉ định trong phần tử
<ProcessingInstructionTarget>
hay không (xác định trong Bước 2). 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à 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 minh hoạ ở trên tại dòng 2 có tên mục tiêu của lệnh xử lý là "
xml-stylesheet"
với độ dài 14 ký tự. Vì tên đích của lệnh 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 bạn muốn thiết kế chính sách XML 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ột mục tiêu của lệnh 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ó tối đa 25 ký tự cho mục tiêu hướng dẫn xử lý, 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" } } }
Nội dung phản hồi mẫu cho 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 XML AeProtection chỉ định chứa một tài liệu XML, trong đó URI không gian tên vượt quá số ký tự được chỉ định trong phần tử con <NamespaceURI>
thuộc phần tử <ValueLimits>
của 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 dài hơn 10 ký tự, thì lỗi này sẽ xảy ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên chính sách XMLedProtection và số dòng vượt quá độ dài URI không gian tên. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định trong 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ụ sau đây về chính sách XML HayProtection,
<NamespaceURI>
được đặt thành10
:<?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>
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 độ dài của URI không gian tên được chỉ định trong đó có nhiều ký tự hơn số được chỉ định trong phần tử
<NamespaceURI>
hay không (đã xác định trong Bước 2). Nếu số lượng 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à 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 hiển thị ở trên tại dòng 2 có 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 bạn muốn dùng chính sách XML 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 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 mình có thể đặt độ dài URI không gian tên tối đa 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" } } }
Nội dung phản hồi mẫu cho 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 tài liệu XML, trong đó tiền tố Không gian tên vượt quá số ký tự được chỉ định trong phần tử con <NamespacePrefix>
của phần tử <NameLimits>
của chính sách.
Ví dụ: nếu phần tử <NamespacePrefix>
được chỉ định là 10
trong chính sách XML AeProtection, nhưng tải trọng đầu vào có tiền tố không gian tên dài hơn 10 ký tự, thì lỗi này sẽ được gửi ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên chính sách XML AeProtection và số dòng bị vượt quá độ dài tiền tố URI không gian tên. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định trong 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ụ sau đây về chính sách XML HayProtection,
<NamespacePrefix>
được đặt thành10
:<?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>
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 trong đó có nhiều ký tự hơn số được chỉ định trong phần tử
<NamespacePrefix>
(đã xác định trong 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à 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 hiển thị ở trên ở 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 bạn muốn thiết kế chính sách XML 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 mình có thể đặt độ dài tiền tố URI không gian tên 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>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" } } }
Nội dung phản hồi mẫu cho 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 XML AeProtection chỉ định chứa một tài liệu XML, trong đó số lượng không gian tên dùng trong một phần tử vượt quá số lượng không gian tên được chỉ định trong phần tử con <NamespaceCountPerElement>
thuộc phần tử <StructureLimits>
của 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ó nhiều hơn 3 không gian tên, thì lỗi này sẽ được tạo ra.
Chẩn đoán
Kiểm tra thông báo lỗi để xác định tên của chính sách XML XinProtection và số dòng nơi vượt quá số lượng không gian tên. Ví dụ: trong thông báo lỗi sau đây, 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)
Kiểm tra chính sách không đạt (xác định trong 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ụ sau đây về chính sách XML HayProtection,
<NamespaceCountPerElement>
được đặt thành3
:<?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>
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 không gian tên được chỉ định ở đó cho một phần tử có cao hơn số được chỉ định trong phần tử
<NamespaceCountPerElement>
hay không (xác định trong Bước 2). 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 trên mỗi phần tử, thì đó là nguyên nhân gây ra lỗi.Dưới đâ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 hiển thị ở trên ở dòng 2 có nhiều 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 bạn muốn xây dựng chính sách XML AeeProtection khỏi các gói dữ liệu vượt quá 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 số lượng không gian tên có thể lớ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 mình có thể có tối đa 5 vùng chứa 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" } } }
Nội dung phản hồi mẫu cho 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
Kiểm tra thông báo lỗi để xác định tên chính sách gâ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
Kiểm tra tải trọng đầu vào và kiểm tra xem tài liệu XML đã được chuyển trong tải trọng có thực sự là tài liệu XML được định dạng đúng hay không.
Dưới đâ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 hiển thị ở trên, dòng 9 không đóng phần tử gốc đúng cách vì thiếu
/
. Vì XML này không được định dạng đúng, 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
Hãy đảm bảo tải trọng XML đầu vào hợp lệ được truyền tới bất kỳ proxy API nào có chứa chính sách XML AeeGuard.
Để sửa lỗi ví dụ 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" } } }
Nội dung phản hồi mẫu cho 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 thông báo được chỉ định trong phần tử <Source>
của chính sách XML AeeProtection:
- Ngoài phạm vi (không có trong quy trình cụ thể đang thực thi chính sách)
- Không phải là một trong các giá trị hợp lệ
request
,response
hoặcmessage
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 quy trình thực thi chính sách.
Chẩn đoán
Xác định tên của chính sách XML vẽ mối đe doạ 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 của chính sách XML XinProtection là
XML-Threat-Protection-1
và biến Nguồn làrequests:
XMLThreatProtection stepDefinition XML-Threat-Protection-1: Source requests is not available
Kiểm tra chính sách XML AeeProtection không thành công và kiểm tra giá trị được chỉ định cho phần tử
<Source>
đã xác định ở Bước 1.Trong ví dụ sau đây về chính sách XML vẽ mối đe doạ, phần tử
<Source>
được đặt thànhrequests
.<?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ặcmessage.
Vìrequests
không phải là giá trị hợp lệ và không tồn tại trong luồng đang thực thi chính sách, 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 XML AeeProtection 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 này thực thi.
Để sửa chính sách ví dụ nêu trên, bạn có thể sửa đổi phần tử <Source>
để sử dụng biến request
, vì phần tử này tồn tại trong luồng 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" } } }
Nội dung phản hồi mẫu cho 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 bạn đặt phần tử <Source>
trong chính sách XMLedProtection thành một biến không thuộc loại Message.
Các biến 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 được 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 Tài liệu tham khảo về biến.
Chẩn đoán
Xác định tên của biến đã phân giải thành Loại thông báo của biến trong thông báo lỗi. Ví dụ: trong thông báo lỗi sau đây, tên của biến là
message.content
Variable message.content does not resolve to a Message
Kiểm tra tất 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ể, trong đó phần tử
<Source>
được chỉ định bằng tên biến đã xác định trong Bước 1 ở trên.Trong ví dụ sau đây về chính sách XML HayProtection,
<Source>
được đặt thànhmessage.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 Thông báo, 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 bạn đã đặt phần tử <Source>
trong chính sách XMLedProtection không thành công thành biến luồng loại Message (Thông báo) tồn tại trong luồng mà chính sách thực thi.
Để sửa chính sách, bạn có thể sửa đổi phần tử <Source>
để chỉ định một biến thuộc loại Tin nhắn. Ví dụ: trong tệp XML mạo hiểm 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>