นโยบาย SOAPMessageValidation

คุณกําลังดูเอกสารประกอบของ Apigee Edge
ไปที่เอกสารประกอบของ Apigee X
info

นโยบาย SOAPMessageValidation ทําสิ่งต่อไปนี้

  • ตรวจสอบข้อความ XML กับสคีมา XSD
  • ตรวจสอบข้อความ SOAP เทียบกับคําจํากัดความ WSDL
  • ตรวจสอบความถูกต้องของรูปแบบข้อความ JSON และ XML

แม้ว่าชื่อของนโยบายนี้จะแสดงใน UI เป็น "การตรวจสอบข้อความ SOAP" แต่นโยบายนี้จะตรวจสอบมากกว่าข้อความ SOAP ส่วนนี้จะเรียกนโยบายนี้ว่า "นโยบายการตรวจสอบข้อความ"

องค์ประกอบ <MessageValidation>

กำหนดนโยบายการตรวจสอบข้อความ

ค่าเริ่มต้น ดูแท็บนโยบายเริ่มต้นด้านล่าง
ต้องระบุหรือไม่ ไม่บังคับ
ประเภท วัตถุที่ซับซ้อน
องค์ประกอบหลัก ไม่มี
องค์ประกอบย่อย <DisplayName>
<Element>
<ResourceURL>
<SOAPMessage>
<Source>

ไวยากรณ์

องค์ประกอบ <MessageValidation> ใช้ไวยากรณ์ต่อไปนี้

<MessageValidation
  continueOnError="[false|true]"
  enabled="[true|false]"
  name="policy_name"
>
    <!-- All MessageValidation child elements are optional -->
    <DisplayName>policy_display_name</DisplayName>
    <Element namespace="element_namespace">element_to_validate</Element>
    <SOAPMessage version="[ 1.1 | 1.2 | 1.1/1.2 ]"/>
    <Source>message_to_validate</Source>
    <ResourceURL>validation_WSDL_or_XSD</ResourceURL>

</MessageValidation>

นโยบายเริ่มต้น

ตัวอย่างต่อไปนี้แสดงการตั้งค่าเริ่มต้นเมื่อคุณเพิ่มนโยบายการตรวจสอบข้อความลงในโฟลว์ใน UI ของ Edge

<MessageValidation continueOnError="false" enabled="true" name="SOAP-Message-Validation-1">
  <DisplayName>SOAP Message Validation-1</DisplayName>
  <Properties/>
  <Element namespace="http://sample.com">sampleObject</Element>
  <SOAPMessage/>
  <Source>request</Source>
  <ResourceURL>wsdl://SOAP-Message-Validation-1.wsdl</ResourceURL>
</MessageValidation>

This element has the following attributes that are common to all policies:

Attribute Default Required? Description
name N/A Required

The internal name of the policy. The value of the name attribute can contain letters, numbers, spaces, hyphens, underscores, and periods. This value cannot exceed 255 characters.

Optionally, use the <DisplayName> element to label the policy in the management UI proxy editor with a different, natural-language name.

continueOnError false Optional Set to "false" to return an error when a policy fails. This is expected behavior for most policies. Set to "true" to have flow execution continue even after a policy fails.
enabled true Optional Set to "true" to enforce the policy. Set to "false" to "turn off" the policy. The policy will not be enforced even if it remains attached to a flow.
async   false Deprecated This attribute is deprecated.

ตัวอย่าง

ตัวอย่างต่อไปนี้แสดงวิธีใช้นโยบายการตรวจสอบข้อความ

1: การตรวจสอบ XSD

คุณสามารถใช้นโยบายการตรวจสอบข้อความเพื่อตรวจสอบเพย์โหลดของคําขอข้อความ XML กับสคีมา XSD

  1. สร้างไฟล์ทรัพยากร XSD ใหม่ เช่น "note-schema.xsd"
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="note">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="to" type="xs:string"/>
            <xs:element name="from" type="xs:string"/>
            <xs:element name="heading" type="xs:string"/>
            <xs:element name="body" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
  2. เพิ่มนโยบายการตรวจสอบข้อความ SOAP ไปยังขั้นตอนก่อนการเรียกใช้ของปลายทางพร็อกซี โดยทำดังนี้
    1. ระบุตำแหน่งของไฟล์ทรัพยากร XSD ด้วยองค์ประกอบ <ResourceURL> เช่น
      ...
        <ResourceURL>xsd://note-schema.xsd</ResourceURL>
      ...
    2. นําองค์ประกอบ <SOAPMessage> และ <Element> ออกจากคําจํากัดความของนโยบาย

    คําจํากัดความของนโยบายควรมีลักษณะดังต่อไปนี้

    <MessageValidation continueOnError="false"
        enabled="true" name="validateXMLRequest">
      <DisplayName>My XML Validator</DisplayName>
      <Properties/>
      <Source>request</Source>
      <ResourceURL>xsd://note-schema.xsd</ResourceURL>
    </MessageValidation>
  3. ส่งคําขอ POST ไปยังพร็อกซี API โดยให้ XML เป็นเพย์โหลดข้อความ ดังตัวอย่างต่อไปนี้
    curl -v -X POST -H 'Content-Type: application/xml' http://my-test.apigee.net/v1/xsd-mock
      -d '<note>
      <to>Fred Rogers</to>
      <from>Nick Danger</from>
      <heading>Greetings from my neighborhood</heading>
      <body>Just writing to say hello.</body>
    </note>'

    โปรดทราบว่าส่วนหัว Content-type มีการตั้งค่าเป็น "application/xml"

    นอกจากนี้ คุณยังสร้างไฟล์ข้อมูลสำหรับเพย์โหลดและอ้างอิงด้วยคําสั่งที่คล้ายกับตัวอย่างต่อไปนี้ได้ด้วย

    curl -v -X POST -H 'Content-type: application/xml' http://my-test.apigee.net/v1/xsd-mock
      --data '@../examples/note-payload.xml'

คุณควรได้รับการตอบกลับ HTTP 200 คุณอาจได้รับรายละเอียดเพิ่มเติมเกี่ยวกับคำขอ ทั้งนี้ขึ้นอยู่กับปลายทางเป้าหมาย ตัวอย่างเช่น หากคุณใช้ http://httpbin.org/post เป็นปลายทางเป้าหมายและระบุเอาต์พุต -v (รายละเอียด) คำตอบควรคล้ายกับตัวอย่างต่อไปนี้

< HTTP/1.1 200 OK
< Date: Wed, 16 May 2018 21:24:54 GMT
< Content-Type: application/xml
< Content-Length: 431
< Connection: keep-alive
< Server: gunicorn/19.8.1
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Via: 1.1 vegur
{
  "args":{},
  "data":"<note><to>fred</to><from>nick</from><heading>hello</heading>
    <body>Just writing to say hello.</body></note>",
  "files":{},
  "form":{},
  "headers": {
    "Accept":"*/*",
    "Connection":"close",
    "Content-Length":"106",
    "Content-Type":"application/xml",
    "Host":"httpbin.org",
    "User-Agent":"curl/7.58.0"
  },
  "json":null,
  "origin":"10.1.1.1, 104.154.179.1",
  "url":"http://httpbin.org/post"
}

หากต้องการยืนยันว่าการตรวจสอบ XSD ทำงานอยู่ ให้ลองแทรกแท็กอื่นลงในเนื้อหาของคำขอ เช่น

curl -v -X POST -H 'Content-Type: application/xml' http://my-test.apigee.net/v1/xsd-mock
  -d '<note>
  <to>Fred Rogers</to>
  <from>Nick Danger</from>
  <heading>Greetings from my neighborhood</heading>
  <body>Just writing to say hello.</body>
  <badTag>Not good</badTag>
</note>'

คุณควรได้รับข้อผิดพลาดในการตรวจสอบความถูกต้อง

2: การตรวจสอบ SOAP

คุณสามารถใช้นโยบายการตรวจสอบข้อความเพื่อตรวจสอบเพย์โหลดของคำขอข้อความ SOAP กับ WSDL

  1. สร้างไฟล์ทรัพยากร WSDL ใหม่ เช่น "example-wsdl.wsdl"
  2. เพิ่มนโยบายการตรวจสอบข้อความ SOAP ไปยังขั้นตอนก่อนการเรียกใช้ของปลายทางพร็อกซี ดังนี้
    1. ตั้งค่าแอตทริบิวต์ version ขององค์ประกอบ <SOAPMessage> เป็นเวอร์ชันของโปรโตคอล SOAP ที่ต้องการตรวจสอบ ตัวอย่างเช่น "1.1"
      ...
        <SOAPMessage version="1.1"/>
      ...
    2. ตั้งค่าองค์ประกอบ <Element> เป็นองค์ประกอบที่ต้องการตรวจสอบ
      ...
        <Element namespace="https://example.com/gateway">getID</Element>
      ...

      <Element> ระบุองค์ประกอบย่อยแรกภายใต้องค์ประกอบ <Body> ในโฟลเดอร์คำขอ SOAP

      ตั้งค่าแอตทริบิวต์ namespace เป็นเนมสเปซสำหรับรายการย่อยนั้น

    3. ระบุตำแหน่งของไฟล์ทรัพยากร WSDL ด้วยองค์ประกอบ <ResourceURL> เช่น
      ...
        <ResourceURL>wsdl://example-wsdl.wsdl</ResourceURL>
      ...

    คําจํากัดความของนโยบายควรมีลักษณะดังต่อไปนี้

    <MessageValidation continueOnError="false"
        enabled="true" name="validateSOAPRequest">
      <DisplayName>My SOAP Validator</DisplayName>
      <Properties/>
      <Source>request</Source>
      <SOAPMessage version="1.1"/>
      <Element namespace="https://example.com/gateway">getID</Element>
      <ResourceURL>wsdl://example-wsdl.wsdl</ResourceURL>
    </MessageValidation>
  3. ส่งคําขอ POST ไปยังพร็อกซี API ด้วยโฟลเดอร์ SOAP เป็นเพย์โหลดข้อความ ดังตัวอย่างต่อไปนี้
    curl -v -X POST -H 'Content-Type: application/xml' http://my-test.apigee.net/v1/xsd-mock
      -d '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:prox="https://example.com/gateway" xmlns:typ="https://example.com/gateway/types">
      <soapenv:Header/>
      <soapenv:Body>
        <prox:getID>
          <typ:MyType>
            <typ:ID>42</typ:ID>
          </typ:MyType>
        </prox:getID>
      </soapenv:Body>
    </soapenv:Envelope>'

    โปรดทราบว่าส่วนหัว Content-type ตั้งค่าเป็น "application/xml"

    นอกจากนี้ คุณยังสร้างไฟล์ข้อมูลสำหรับเพย์โหลดและอ้างอิงด้วยคําสั่งที่คล้ายกับตัวอย่างต่อไปนี้ได้ด้วย

    curl -v -X POST -H 'Content-type: application/xml' http://my-test.apigee.net/v1/xsd-mock
      --data '@../examples/soap-payload.xml'

คุณควรได้รับการตอบกลับ HTTP 200 คุณอาจได้รับรายละเอียดเพิ่มเติมเกี่ยวกับคำขอ ทั้งนี้ขึ้นอยู่กับปลายทางเป้าหมาย ตัวอย่างเช่น หากคุณใช้ http://httpbin.org/post เป็นปลายทางเป้าหมาย การตอบกลับควรคล้ายกับตัวอย่างต่อไปนี้

< HTTP/1.1 200 OK
< Date: Wed, 16 May 2018 21:24:54 GMT
< Content-Type: application/xml
< Content-Length: 431
< Connection: keep-alive
< Server: gunicorn/19.8.1
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Via: 1.1 vegur
{
  "args":{},
  "data":"<note><to>fred</to><from>nick</from><heading>hello</heading>
    <body>Just writing to say hello.</body></note>",
  "files":{},
  "form":{},
  "headers": {
    "Accept":"*/*",
    "Connection":"close",
    "Content-Length":"106",
    "Content-Type":"application/xml",
    "Host":"httpbin.org",
    "User-Agent":"curl/7.58.0"
  },
  "json":null,
  "origin":"10.1.1.1, 104.154.179.1",
  "url":"http://httpbin.org/post"
}

3: XML/JSON ที่มีรูปแบบถูกต้อง

คุณสามารถใช้นโยบายการตรวจสอบข้อความเพื่อยืนยันว่าเพย์โหลดข้อความ JSON หรือ XML อยู่ในรูปแบบที่ถูกต้อง (ไม่ใช่การตรวจสอบ) นโยบายนี้ช่วยให้มั่นใจได้ว่าโครงสร้างและเนื้อหาเป็นไปตามมาตรฐานที่ยอมรับ ซึ่งรวมถึง

  • มีองค์ประกอบรูทรายการเดียว
  • ไม่มีอักขระที่ไม่ถูกต้องในเนื้อหา
  • ออบเจ็กต์และแท็กซ้อนกันอย่างถูกต้อง
  • แท็กเริ่มต้นและแท็กสิ้นสุดตรงกัน

วิธีตรวจสอบเพย์โหลด XML หรือ JSON อยู่ในรูปแบบที่ถูกต้อง

  1. เพิ่มนโยบายการตรวจสอบข้อความ SOAP ไปยังขั้นตอนก่อนการเรียกใช้ของปลายทางพร็อกซี
  2. นำองค์ประกอบ <ResourceURL>, <SOAPMessage> และ <Element> ออกจากคําจํากัดความของนโยบาย

    คําจํากัดความของนโยบายควรมีลักษณะดังต่อไปนี้

    <MessageValidation async="false" continueOnError="false"
        enabled="true" name="validateXMLRequest">
      <DisplayName>My JSON Checker</DisplayName>
      <Properties/>
      <Source>request</Source>
    </MessageValidation>
  3. ส่งคําขอ POST ไปยังพร็อกซี API ดังที่แสดงในตัวอย่างต่อไปนี้
    curl -v -X POST -H 'Content-Type: application/json' http://my-test.apigee.net/v1/xsd-mock
      -d '{
    "note": {
      "to": "Fred Rogers",
      "from": "Nick Danger",
      "header": "Greetings from my neighborhood",
      "body": "Just writing to say hello."
      }
    }'

    โปรดทราบว่าส่วนหัว Content-type ตั้งค่าเป็น "application/json"

    หากต้องการตรวจสอบไฟล์ XML ว่าอยู่ในรูปแบบที่ถูกต้อง ให้ใช้ XML เป็นเพย์โหลดข้อความและตั้งค่า Content-type เป็น "application/xml"

คุณควรได้รับการตอบกลับ HTTP 200 เมื่อส่งเพย์โหลดข้อความที่ไม่มี XML หรือ JSON ที่เป็นรูปแบบที่ถูกต้อง คุณจะได้รับข้อผิดพลาด steps.messagevalidation.Failed

การอ้างอิงองค์ประกอบย่อย

ส่วนนี้จะอธิบายองค์ประกอบย่อยของ <MessageValidation>

<DisplayName>

Use in addition to the name attribute to label the policy in the management UI proxy editor with a different, more natural-sounding name.

The <DisplayName> element is common to all policies.

Default Value n/a
Required? Optional. If you omit <DisplayName>, the value of the policy's name attribute is used
Type String
Parent Element <PolicyElement>
Child Elements None

The <DisplayName> element uses the following syntax:

Syntax

<PolicyElement>
  <DisplayName>policy_display_name</DisplayName>
  ...
</PolicyElement>

Example

<PolicyElement>
  <DisplayName>My Validation Policy</DisplayName>
</PolicyElement>

The <DisplayName> element has no attributes or child elements.

<Element>

ระบุองค์ประกอบในข้อความที่จะตรวจสอบ นี่คือองค์ประกอบย่อยแรกภายใต้องค์ประกอบ <Body> ในโฟลเดอร์คำขอ SOAP

ค่าเริ่มต้น sampleObject
ต้องระบุหรือไม่ ไม่บังคับ
ประเภท สตริง
องค์ประกอบหลัก <MessageValidation>
องค์ประกอบย่อย ไม่มี

องค์ประกอบ <Element> ใช้ไวยากรณ์ต่อไปนี้

ไวยากรณ์

...
  <Element namespace="element_namespace">element_to_validate</Element>
...

ตัวอย่างที่ 1

ตัวอย่างต่อไปนี้กำหนดองค์ประกอบเดียวที่จะตรวจสอบ

...
<Element namespace="https://example.com/gateway">getID</Element>
...

ตัวอย่างที่ 2

คุณสามารถระบุองค์ประกอบมากกว่า 1 รายการเพื่อตรวจสอบได้โดยเพิ่มองค์ประกอบ <Element> หลายรายการ ดังนี้

...
<Element namespace="https://example.com/gateway">getID</Element>
<Element namespace="https://example.com/gateway">getDetails</Element>
...

องค์ประกอบ <Element> มีแอตทริบิวต์ต่อไปนี้

แอตทริบิวต์ ค่าเริ่มต้น จำเป็นหรือไม่ คำอธิบาย
namespace "http://sample.com" ไม่บังคับ กำหนดเนมสเปซขององค์ประกอบที่จะตรวจสอบ

<ResourceURL>

ระบุสคีมา XSD หรือคําจํากัดความ WSDL ที่จะใช้ในการตรวจสอบความถูกต้องของข้อความต้นทาง

ค่าเริ่มต้น wsdl://display_name.wsdl
ต้องระบุหรือไม่ ไม่บังคับ
ประเภท สตริง
องค์ประกอบหลัก <MessageValidation>
องค์ประกอบย่อย ไม่มี

องค์ประกอบ <ResourceURL> ใช้ไวยากรณ์ต่อไปนี้

ไวยากรณ์

...
  <ResourceURL>[wsdl|xsd]://validation_WSDL_or_XSD</ResourceURL>
...

ตัวอย่าง

สำหรับไฟล์ XML ให้ทำดังนี้

...
<ResourceURL>xsd://note-schema.xsd</ResourceURL>
...

สำหรับ WSDL

...
<ResourceURL>wsdl://example-wsdl.wsdl</ResourceURL>
...

ค่าของ <ResourceURL> ต้องชี้ไปยังไฟล์ทรัพยากรในพร็อกซี API แต่จะอ้างอิงทรัพยากรภายนอกผ่าน HTTP หรือ HTTPS ไม่ได้

หากคุณไม่ได้ระบุค่าสำหรับ <ResourceURL> ระบบจะตรวจสอบข้อความว่าอยู่ในรูปแบบ JSON หรือ XML ที่ถูกต้อง หากส่วนหัว Content-type คือ "application/json" หรือ "application/xml" ตามลำดับ

องค์ประกอบ <ResourceURL> ไม่มีองค์ประกอบย่อยหรือแอตทริบิวต์

การใช้ XSD เพื่อตรวจสอบความถูกต้อง

หากเพย์โหลด XML ที่คุณตรวจสอบด้วยนโยบายการตรวจสอบข้อความอ้างอิงสคีมาอื่น คุณต้องใส่ xsd ไว้หน้าไฟล์ XSD ที่รวมไว้ในแอตทริบิวต์ schemaLocation

สคีมาตัวอย่างต่อไปนี้ประกอบด้วย XSD หลายรายการ

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:include schemaLocation="xsd://note-schema.xsd"/>
  <xs:include schemaLocation="xsd://letter-schema.xsd"/>
  <xs:include schemaLocation="xsd://user-schema.xsd"/>
</xs:schema>

การใช้ WSDL เพื่อตรวจสอบ

WSDL ต้องกำหนดสคีมาอย่างน้อย 1 รายการ หากไม่ได้อ้างอิงสคีมาอย่างน้อย 1 รายการ นโยบายการตรวจสอบข้อความจะไม่ทำงาน

ความลึกในการนําเข้าสูงสุดของสคีมาคือ 10 หากการนําเข้าที่ฝังอยู่มีจํานวนเกินจำนวนดังกล่าว นโยบายการตรวจสอบข้อความจะดำเนินการไม่สำเร็จ

<SOAPMessage>

กำหนดเวอร์ชัน SOAP ที่นโยบายการตรวจสอบข้อความจะตรวจสอบ

ค่าเริ่มต้น ไม่มี
ต้องระบุหรือไม่ ไม่บังคับ
ประเภท ไม่มี
องค์ประกอบหลัก <MessageValidation>
องค์ประกอบย่อย ไม่มี

องค์ประกอบ <SOAPMessage> ใช้ไวยากรณ์ต่อไปนี้

ไวยากรณ์

...
  <SOAPMessage version="[ 1.1 | 1.2 | 1.1/1.2 ]"/>
...

ตัวอย่าง

...
<SOAPMessage version="1.1"/>
...

องค์ประกอบ <SOAPMessage> มีแอตทริบิวต์ต่อไปนี้

แอตทริบิวต์ ค่าเริ่มต้น จำเป็นหรือไม่ คำอธิบาย
version ไม่มี ไม่บังคับ เวอร์ชัน SOAP ที่นโยบายนี้ใช้ตรวจสอบความถูกต้องของข้อความ SOAP

ค่าที่ใช้ได้มีดังนี้

  • "1.1"
  • "1.2"
  • "1.1/1.2"

ดูข้อมูลเพิ่มเติมได้ที่จาก SOAP/1.1 ไปเป็น SOAP เวอร์ชัน 1.2 ใน 9 จุด

<Source>

ระบุข้อความต้นทางที่จะตรวจสอบ ค่าขององค์ประกอบนี้คือชื่อข้อความที่ต้องการตรวจสอบ

หากคุณไม่ได้ตั้งค่า <Source> นโยบายนี้จะมีค่าเริ่มต้นเป็น "message" ซึ่งหมายถึงข้อความคําขอที่สมบูรณ์ (ในขั้นตอนการขอ) หรือข้อความตอบกลับ (ในขั้นตอนการตอบกลับ) รวมถึงเพย์โหลด นอกจากนี้ คุณยังตั้งค่าเป็น "คำขอ" หรือ "คำตอบ" อย่างชัดเจนเพื่ออ้างอิงคำขอหรือคำตอบได้ด้วย

ค่าเริ่มต้น ส่งคำขอ
ต้องระบุหรือไม่ ไม่บังคับ
ประเภท สตริง
องค์ประกอบหลัก <MessageValidation>
องค์ประกอบย่อย ไม่มี

องค์ประกอบ <Source> ใช้ไวยากรณ์ต่อไปนี้

ไวยากรณ์

...
  <Source>message_to_validate</Source>
...

ตัวอย่าง

...
<Source>request</Source>
...

นอกจาก "message", "request" และ "response" แล้ว คุณยังตั้งค่า <Source> เป็นชื่อข้อความใดก็ได้ในขั้นตอน อย่างไรก็ตาม หากทําเช่นนี้ คุณต้องสร้างข้อความที่กําหนดเองโดยใช้ชื่อนั้นในขั้นตอนก่อนนโยบายนี้จะมีผล มิฉะนั้น คุณจะได้รับข้อผิดพลาด

หากระบบไม่สามารถแก้ไขค่าของ <Source> ในขั้นตอนการส่งข้อความหรือแก้ไขค่าเป็นประเภทที่ไม่ใช่ข้อความ ผลลัพธ์อย่างใดอย่างหนึ่งต่อไปนี้จะเกิดขึ้น

  • หากเป็นค่า Null: Edge จะแสดงข้อผิดพลาด steps.messagevalidation.SourceMessageNotAvailable
  • หากไม่ใช่ประเภทข้อความ: Edge จะแสดงข้อผิดพลาด steps.messagevalidation.NonMessageVariable

องค์ประกอบ <Source> ไม่มีแอตทริบิวต์หรือองค์ประกอบย่อย

รหัสข้อผิดพลาด

ข้อผิดพลาดที่แสดงจากนโยบาย Edge อยู่ในรูปแบบที่สอดคล้องกันตามที่อธิบายไว้ในข้อมูลอ้างอิงรหัสข้อผิดพลาด

This section describes the fault codes and error messages that are returned and fault variables that are set by Edge when this policy triggers an error. This information is important to know if you are developing fault rules to handle faults. To learn more, see What you need to know about policy errors and Handling faults.

Runtime errors

These errors can occur when the policy executes.

Fault code HTTP status Cause Fix
steps.messagevalidation.SourceMessageNotAvailable 500

This error occurs if a variable specified in the <Source> element of the policy is either:

  • out of scope (not available in the specific flow where the policy is being executed)
  • or
  • can't be resolved (is not defined)
steps.messagevalidation.NonMessageVariable 500

This error occurs if the <Source> element in the SOAPMessageValidation policy is set to a variable which is not of type message.

Message type variables represent entire HTTP requests and responses. The built-in Edge flow variables request, response, and message are of type message. To learn more about message variables, see the Variables reference.

steps.messagevalidation.Failed 500 This error occurs if the SOAPMessageValidation policy fails to validate the input message payload against the XSD schema or WSDL definition. It will also occur if there is malformed JSON or XML in the payload message.

Deployment errors

These errors can occur when you deploy a proxy containing this policy.

Error name Cause Fix
InvalidResourceType The <ResourceURL> element in the SOAPMessageValidation policy is set to a resource type not supported by the policy.
ResourceCompileFailed The resource script referenced in the <ResourceURL> element of the SOAPMessageValidation policy contains an error that prevents it from compiling.
RootElementNameUnspecified The <Element> element in the SOAPMessageValidation policy does not contain the root element's name.
InvalidRootElementName The <Element> element in the SOAPMessageValidation policy contains a root element name that does not adhere to XML rules for valid element naming.

สคีมา

นโยบายแต่ละประเภทจะกำหนดโดยสคีมา XML (.xsd) สคีมานโยบายมีให้ใช้งานเป็นข้อมูลอ้างอิงใน GitHub

หัวข้อที่เกี่ยวข้อง