คุณกำลังดูเอกสารประกอบของ Apigee Edge
ไปที่เอกสารประกอบของ
Apigee X info
SourceMessageNotAvailable
รหัสข้อผิดพลาด
steps.messagevalidation.SourceMessageNotAvailable
เนื้อหาการตอบกลับข้อผิดพลาด
{ "fault": { "faultstring": "source_var_name message is not available for[policy_name]", "detail": { "Errorcode": "steps.messagevalidation.SourceMessageNotAvailable" } } }
ตัวอย่างเนื้อหาการตอบกลับข้อผิดพลาด
{
"fault": {
"faultstring": "request message is not available for MessageValidation: SOAP-Message-Validation-1",
"detail": {
"errorcode": "steps.messagevalidation.SourceMessageNotAvailable"
}
}
}
สาเหตุ
ข้อผิดพลาดนี้จะเกิดขึ้นหากตัวแปร message ที่ระบุในองค์ประกอบ <Source> ของนโยบาย SOAPMessageValidation เป็นอย่างใดอย่างหนึ่งต่อไปนี้
- อยู่นอกขอบเขต (ไม่พร้อมใช้งานในโฟลว์ที่เฉพาะเจาะจงซึ่งมีการดำเนินการตามนโยบาย) หรือ
- ไม่สามารถแก้ไขได้ (ไม่ได้กำหนด)
ตัวอย่างเช่น ข้อผิดพลาดนี้จะเกิดขึ้นหากตั้งค่าองค์ประกอบ <Source> ในนโยบาย SOAPMessageValidation เป็นตัวแปรที่ไม่มีอยู่ในโฟลว์ที่เรียกใช้นโยบาย
การวินิจฉัย
ระบุชื่อนโยบาย SOAPMessageValidation ที่เกิดข้อผิดพลาดและชื่อตัวแปร
sourceจากสตริงข้อผิดพลาด เช่น ในสตริงข้อผิดพลาดต่อไปนี้ ชื่อของนโยบาย SOAPMessageValidation คือSOAP-Message-Validation-1และตัวแปรsourceคือrequest"faultstring": "request message is not available for MessageValidation: SOAP-Message-Validation-1"ใน XML ของนโยบาย SOAPMessageValidation ที่ล้มเหลว ให้ตรวจสอบว่าชื่อของตัวแปรที่ตั้งค่าไว้ในองค์ประกอบ
<Source>ตรงกับชื่อตัวแปรที่ระบุในสตริงข้อผิดพลาด (ขั้นตอนที่ 1 ด้านบน)ตัวอย่างเช่น นโยบาย SOAPMessageValidation ต่อไปนี้จะระบุตัวแปรชื่อ
requestในองค์ประกอบ<Source>ซึ่งตรงกับสิ่งที่อยู่ในสตริงข้อผิดพลาด<MessageValidation async="false" continueOnError="false" enabled="true" name="SOAP-Message-Validation-1"> <DisplayName>SOAP Message Validation-1</DisplayName> <Properties/> <Element namespace="http://schemas.xmlsoap.org/soap/prices">GetPriceResponse</Element> <SOAPMessage/> <Source>request</Source> <ResourceURL>xsd://Script-1.xsd</ResourceURL> </MessageValidation>ตรวจสอบว่าตัวแปรที่ใช้ในองค์ประกอบ
<Source>มีการกำหนดและพร้อมใช้งานในโฟลว์ที่นโยบาย SOAPMessageValidation กำลังดำเนินการอยู่หรือไม่หากตัวแปรเป็นอย่างใดอย่างหนึ่งต่อไปนี้
- อยู่นอกขอบเขต (ไม่พร้อมใช้งานในโฟลว์ที่เฉพาะเจาะจงซึ่งมีการบังคับใช้นโยบาย) หรือ
- ไม่สามารถแก้ไขได้ (ไม่ได้กำหนด)
นั่นคือสาเหตุของข้อผิดพลาด
ตัวอย่างเช่น สมมติว่านโยบาย SOAPMessageValidation ที่แสดงด้านบนทำงานในโฟลว์การตอบกลับ อย่างไรก็ตาม ตัวแปร
requestที่ใช้ในตัวอย่างองค์ประกอบ<Source>ด้านบนจะใช้ได้เฉพาะในโฟลว์คำขอเนื่องจากตัวแปร
requestไม่มีอยู่ในขั้นตอนการตอบกลับ คุณจึงได้รับข้อผิดพลาดต่อไปนี้"faultstring": "request message is not available for MessageValidation: SOAP-Message-Validation-1"
ความละเอียด
ตรวจสอบว่าได้กำหนดตัวแปรที่ตั้งค่าไว้ในองค์ประกอบ <Source> ของนโยบาย SOAPMessageValidation ที่ล้มเหลว และตัวแปรนั้นมีอยู่ในโฟลว์ที่นโยบายดำเนินการ
หากต้องการแก้ไขตัวอย่างที่แสดงด้านบน คุณสามารถแก้ไของค์ประกอบ <Source> ให้ใช้ตัวแปร response ซึ่งอยู่ในโฟลว์การตอบกลับได้ดังนี้
<MessageValidation async="false" continueOnError="false" enabled="true" name="SOAP-Message-Validation-1">
<DisplayName>SOAP Message Validation-1</DisplayName>
<Properties/>
<Element namespace="http://schemas.xmlsoap.org/soap/prices">GetPriceResponse</Element>
<SOAPMessage/>
<Source>response</Source>
<ResourceURL>xsd://Script-1.xsd</ResourceURL>
</MessageValidation>
NonMessageVariable
รหัสข้อผิดพลาด
steps.messagevalidation.NonMessageVariable
เนื้อหาการตอบกลับข้อผิดพลาด
{ "fault": { "faultstring": "Variable var_name does not resolve to a Message" "detail": { "errorcode": "steps.messagevalidation.NonMessageVariable" } } }
ตัวอย่างเนื้อหาการตอบกลับข้อผิดพลาด
{
"fault": {
"faultstring": "Variable message.content does not resolve to a Message",
"detail": {
"errorcode": "steps.messagevalidation.NonMessageVariable"
}
}
}
สาเหตุ
ข้อผิดพลาดนี้จะเกิดขึ้นหากตั้งค่าองค์ประกอบ <Source> ในนโยบาย SOAPMessageValidation เป็นตัวแปรที่ไม่ใช่ประเภท Message
ตัวแปรประเภทข้อความแสดงถึงคำขอและการตอบกลับ HTTP ทั้งหมด ตัวแปรโฟลว์ Apigee Edge แบบบิวท์อิน request, response และ message มีประเภทเป็นข้อความ ดูข้อมูลเพิ่มเติมเกี่ยวกับตัวแปรข้อความได้ที่ข้อมูลอ้างอิงตัวแปร
การวินิจฉัย
ระบุชื่อของตัวแปรที่ไม่แปลงเป็นประเภทข้อความจากสตริงข้อผิดพลาด เช่น ในสตริงข้อผิดพลาดต่อไปนี้ ชื่อตัวแปรคือ
message.content"faultstring": "Variable message.content does not resolve to a Message"ตรวจสอบนโยบาย SOAPMessageValidation ทั้งหมดใน API Proxy ที่เฉพาะเจาะจงซึ่งเกิดข้อผิดพลาด อาจมีนโยบาย SOAPMessageValidation อย่างน้อย 1 รายการ ระบุนโยบาย SOAPMessageValidation ที่เฉพาะเจาะจงซึ่งตัวแปรที่ระบุในองค์ประกอบ
<Source>ตรงกับชื่อตัวแปรที่ระบุในสตริงข้อผิดพลาด (ขั้นตอนที่ 1 ด้านบน)ตัวอย่างเช่น นโยบายต่อไปนี้จะตั้งค่าองค์ประกอบ
<Source>เป็นตัวแปรชื่อmessage.contentซึ่งตรงกับสิ่งที่อยู่ในสตริงข้อผิดพลาด<MessageValidation async="false" continueOnError="false" enabled="true" name="SOAP-Message-Validation-1"> <DisplayName>SOAP Message Validation-1</DisplayName> <Properties/> <Element namespace="http://schemas.xmlsoap.org/soap/prices">GetPriceResponse</Element> <SOAPMessage/> <Source>message.content</Source> <ResourceURL>xsd://Script-1.xsd</ResourceURL> </MessageValidation>เนื่องจากตัวแปร
message.contentไม่ใช่ประเภทข้อความ คุณจึงได้รับข้อผิดพลาดต่อไปนี้"faultstring": "Variable message.content does not resolve to a Message"
ความละเอียด
ตรวจสอบว่าได้ตั้งค่าองค์ประกอบ <Source> ในนโยบาย SOAPMessageValidation ที่ล้มเหลวเป็นตัวแปรประเภท Message ที่มีอยู่ในโฟลว์ที่นโยบายดำเนินการ
หากต้องการแก้ไขนโยบาย คุณสามารถแก้ไของค์ประกอบ <Source> เพื่อระบุตัวแปรประเภทข้อความ เช่น ในนโยบาย SOAPMessageValidation ที่ล้มเหลว
คุณสามารถระบุองค์ประกอบ <Source> เป็น request ได้
<MessageValidation async="false" 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>xsd://Script-1.xsd</ResourceURL>
</MessageValidation>
ล้มเหลว
รหัสข้อผิดพลาด
steps.messagevalidation.Failed
เนื้อหาการตอบกลับข้อผิดพลาด
{ "fault": { "faultstring": "Variable var_name failed with reason: \"reason [Line varline_num "detail": { "errorcode": "steps.messagevalidation.Failed" } } }
ตัวอย่างเนื้อหาการตอบกลับข้อผิดพลาด
{
"fault": {
"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Expecting a child element but found none [Line 9]\"",
"detail": {
"errorcode": "steps.messagevalidation.Failed"
}
}
}
สาเหตุ
ข้อผิดพลาดนี้เกิดขึ้นหากนโยบาย SOAPMessageValidation ตรวจสอบความถูกต้องของเพย์โหลดข้อความอินพุตกับสคีมา XSD หรือคำจำกัดความ WSDL ไม่สำเร็จ นอกจากนี้ ยังจะเกิดขึ้นหากมี JSON หรือ XML ที่มีรูปแบบไม่ถูกต้องในข้อความเพย์โหลด
สาเหตุที่เป็นไปได้บางประการที่อาจทำให้เกิดข้อผิดพลาดนี้มีดังนี้
| สาเหตุ | คำอธิบาย |
| เพย์โหลด XML ไม่ตรงกัน | เพย์โหลด XML ของอินพุตไม่เป็นไปตามสคีมา XSD ที่ระบุไว้ในนโยบาย SoapMessageValidation |
| เพย์โหลด SOAP ไม่ตรงกัน | เพย์โหลด SOAP อินพุตไม่เป็นไปตามคำจำกัดความ WSDL ที่ระบุไว้ในนโยบาย SoapMessageValidation |
| JSON หรือ XML มีรูปแบบไม่ถูกต้อง | เพย์โหลด SOAP ของอินพุตไม่มี XML หรือ JSON ที่มีรูปแบบถูกต้อง |
สาเหตุ: เพย์โหลด XML ไม่ตรงกัน
ข้อผิดพลาดนี้เกิดขึ้นหากเพย์โหลด XML อินพุตไม่เป็นไปตามสคีมา XSD
ที่ระบุไว้ในองค์ประกอบ <ResourceURL> ของนโยบาย SoapMessageValidation
ตัวอย่างข้อความแสดงข้อผิดพลาด
{
"fault": {
"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Expecting a child element but found none [Line 9]\"",
"detail": {
"errorcode": "steps.messagevalidation.Failed"
}
}
}
การวินิจฉัย
ระบุชื่อนโยบาย SOAPMessageValidation, สาเหตุที่ดำเนินการไม่สำเร็จ และหมายเลขบรรทัดที่เพย์โหลด XML ไม่ตรงกับสคีมา XSD ข้อมูลทั้งหมดนี้อยู่ในสตริงข้อผิดพลาด ตัวอย่างเช่น ในสตริงข้อผิดพลาดต่อไปนี้ ชื่อนโยบาย SOAPMessageValidation คือ
SOAP-Message-Validation-1,the reason for the failure isExpecting a child element but found none [Line 9]และหมายเลขบรรทัดคือ9"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Expecting a child element but found none [Line 9]\""ตรวจสอบนโยบาย SOAPMessageValidation และยืนยันว่าใช้นิยามสคีมา XSD เพื่อตรวจสอบข้อความ ตัวอย่างเช่น นโยบาย SOAPMessageValidation ต่อไปนี้มีไฟล์ทรัพยากร XSD ในองค์ประกอบ
<ResourceURL><?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MessageValidation async="false" continueOnError="false" enabled="true" name="SOAP-Message-Validation-1"> <DisplayName>SOAP Message Validation-1</DisplayName> <Properties/> <SOAPMessage/> <Source>request</Source> <ResourceURL>xsd://Script-1.xsd</ResourceURL> </MessageValidation>ตรวจสอบเพย์โหลดอินพุตในหมายเลขบรรทัดที่ระบุในขั้นตอนที่ 1 ด้านบนเพื่อทำความเข้าใจสาเหตุที่ทำให้เกิดข้อผิดพลาด
เพย์โหลด XML ของอินพุตตัวอย่าง
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> <soap:Body> <shipOrder xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"> <shipTo> <name>Karl Kalckstein</name> </shipTo> <items> <item> <title>I love APIs</title> <quantity>1</quantity> <price>2.90</price> </item> </items> </shipOrder> </soap:Body> </soap:Envelope>ในตัวอย่างที่แสดงด้านบน บรรทัดที่ 9 มีแท็กสิ้นสุด
</shipTo>ตรวจสอบไฟล์คำจำกัดความสคีมา XML,
Script-1.xsdที่ใช้ในนโยบาย SOAPMessageValidation เพื่อดูว่าองค์ประกอบ<shipTo>ควรมีลักษณะอย่างไร... <xsd:element name="shipTo" type="shipAddress"/> ... <xsd:complexType name="shipAddress"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="street" type="xsd:string"/> <xsd:element name="address" type="xsd:string"/> <xsd:element name="country" type="xsd:string"/> </xsd:sequence> </xsd:complexType> ...ตาม XSD ตัวอย่างที่ใช้สำหรับการตรวจสอบความถูกต้อง องค์ประกอบ
<shipTo>ต้องมีองค์ประกอบย่อย<name>,<street>,<address>และ<country>อย่างไรก็ตาม เพย์โหลด XML อินพุตมีองค์ประกอบย่อยเพียงรายการเดียวคือ<name>ดังนั้น คุณจึงได้รับข้อผิดพลาดต่อไปนี้"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Expecting a child element but found none [Line 9]\""
ความละเอียด
คุณแก้ไขข้อผิดพลาดในการตรวจสอบนี้ได้ 2 วิธี ดังนี้
วิธีแก้ปัญหา #1
หากพิจารณาแล้วว่าคำจำกัดความของสคีมา XSD กำหนดข้อจำกัดที่ไม่จำเป็นและต้องมีเฉพาะองค์ประกอบย่อย <name> ภายใต้องค์ประกอบ <shipTo> คุณสามารถแก้ไข Script-1.xsd ที่ใช้ในนโยบาย SOAPMessageValidation ได้ หากต้องการตรวจสอบตัวอย่างเพย์โหลดข้างต้น คุณสามารถแก้ไขไฟล์ XSD ได้ดังนี้
...
<xsd:element name="shipTo" type="shipAddress"/>
...
<xsd:complexType name="shipAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
วิธีที่ 2
หากไฟล์คำจำกัดความ XSD ถูกต้อง คุณจะเปลี่ยนเพย์โหลด XML ของอินพุตให้ตรงกับ xsd ได้ เช่น คุณอาจแก้ไขเพย์โหลดให้เป็นไปตาม xsd ดังนี้
<?xml version="1.0">
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<shipOrder xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<shipTo>
<name>Karl Kalckstein</name>
<street>1020 Parkway</street>
<address>Mountain View, CA 94043</address>
<country>USA</country>
</shipTo>
<items>
<item>
<title>I love APIs</title>
<quantity>1</quantity>
<price>2.90</price>
</item>
</items>
</shipOrder>
</soap:Body>
</soap:Envelope>
สาเหตุ: เพย์โหลด SOAP ไม่ตรงกัน
ข้อผิดพลาดนี้จะเกิดขึ้นหากเพย์โหลด SOAP อินพุตไม่เป็นไปตามคำจำกัดความ WSDL ที่ระบุไว้ในองค์ประกอบ <ResourceURL> ของนโยบาย SoapMessageValidation
ตัวอย่างข้อความแสดงข้อผิดพลาด
{
"fault": {
"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Element name mismatch. Wildcard? [Line 11]\"",
"detail": {
"errorcode": "steps.messagevalidation.Failed"
}
}
}
การวินิจฉัย
ระบุชื่อนโยบาย SOAPMessageValidation, สาเหตุที่ดำเนินการไม่สำเร็จ และหมายเลขบรรทัดที่เพย์โหลด SOAP ไม่ตรงกับคำจำกัดความ WSDL คุณดูข้อมูลทั้งหมดนี้ได้จากสตริงข้อผิดพลาด ตัวอย่างเช่น ในสตริงข้อผิดพลาดต่อไปนี้ ชื่อของนโยบาย SOAPMessageValidation คือ
SOAP-Message-Validation-1สาเหตุที่ทำให้เกิดข้อผิดพลาดคือ\"Element name mismatch. Wildcard? [Line 11]\""และหมายเลขบรรทัดคือ11"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Element name mismatch. Wildcard? [Line 11]\""ตรวจสอบนโยบาย SOAPMessageValidation และยืนยันว่าใช้วิธีการ
wsdlเพื่อตรวจสอบข้อความ ตัวอย่างเช่น นโยบาย SOAPMessageValidation ต่อไปนี้มีไฟล์ทรัพยากรwsdlในองค์ประกอบ<ResourceURL><?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MessageValidation async="false" continueOnError="false" enabled="true" name="SOAP-Message-Validation-1"> <DisplayName>SOAP Message Validation-1</DisplayName> <Properties/> <SOAPMessage/> <Source>request</Source> <ResourceURL>wsdl://SOAP-Message-Validation-1.wsdl</ResourceURL> </MessageValidation>ตรวจสอบเพย์โหลดอินพุตในหมายเลขบรรทัดที่ระบุในขั้นตอนที่ 1 เพื่อทำความเข้าใจสาเหตุที่ทำให้เกิดข้อผิดพลาด
เพย์โหลด SOAP ของอินพุตตัวอย่าง
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> <soap:Body> <shipOrder xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"> <shipTo> <name>Karl Kalckstein</name> <street>1020 Parkway</street> <address>Mountain View, CA 94043</address> <country>USA</country> </shipTo> <items> <item> <title>I love APIs</title> <quantity>1</quantity> <price>2.90</price> </item> </items>ในตัวอย่างที่แสดงด้านบน บรรทัดที่ 11 มีองค์ประกอบย่อย
<country>ภายใต้องค์ประกอบ<shipTo>ตรวจสอบไฟล์คำจำกัดความ WSDL,
SOAP-Message-Validation-1.wsdlที่ใช้ในนโยบาย SOAPMessageValidation เพื่อดูว่าองค์ประกอบย่อย<country>ภายใต้องค์ประกอบ<shipTo>อาจมีข้อผิดพลาดใด<?xml version="1.0" encoding="ISO-8859-1"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="shipOrder" type="order"/> <xsd:complexType name="order"> <xsd:sequence> <xsd:element name="shipTo" type="shipAddress"/> <xsd:element name="items" type="cdItems"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="shipAddress"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="street" type="xsd:string"/> <xsd:element name="address" type="xsd:string"/> </xsd:sequence> ...ตามคำจำกัดความของ WSDL ที่ใช้สำหรับการตรวจสอบ
<shipTo>องค์ประกอบไม่มีองค์ประกอบย่อย<country>ดังนั้น คุณจึงได้รับข้อผิดพลาดต่อไปนี้"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Element name mismatch. Wildcard? [Line 11]\""
ความละเอียด
คุณแก้ไขข้อผิดพลาดในการตรวจสอบนี้ได้ 2 วิธี ดังนี้
วิธีแก้ปัญหา #1
หากพิจารณาว่าคำจำกัดความ WSDL ที่ใช้ไม่ถูกต้อง คุณสามารถเปลี่ยน SOAP-Message-Validation-1.wsdl ที่ใช้ในนโยบาย SOAPMessageValidation ได้ หากต้องการตรวจสอบตัวอย่างเพย์โหลดข้างต้น คุณสามารถแก้ไขไฟล์ได้ดังนี้
...
<xsd:complexType name="shipAddress">`
...
<sequence>
<element name="name" type="xsd:string"/>
<element name="street" type="xsd:string"/>
<element name="address" type="xsd:string"/>
<element name="country" type="xsd:string"/>
</sequence>
วิธีที่ 2
หากคำจำกัดความ WSDL ถูกต้อง คุณจะเปลี่ยนเพย์โหลด SOAP ของอินพุตให้ตรงกับคำจำกัดความ WSDL ได้
เช่น คุณสามารถแก้ไขเพย์โหลด SOAP ของอินพุตได้ดังนี้
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<shipOrder xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<shipTo>
<name>Karl Kalckstein</name>
<street>1020 Parkway</street>
<address>Mountain View, CA 94043</address>
</shipTo>
<items>
<item>
<title>I love APIs</title>
<quantity>1</quantity>
<price>2.90</price>
</item>
</items>
สาเหตุ: JSON หรือ XML มีรูปแบบไม่ถูกต้อง
ข้อผิดพลาดนี้จะเกิดขึ้นหากเพย์โหลด SOAP อินพุตไม่เป็นไปตามคำจำกัดความ WSDL ที่ระบุไว้ในองค์ประกอบ <ResourceURL> ของนโยบาย SoapMessageValidation
ตัวอย่างข้อความแสดงข้อผิดพลาด
{
"fault": {
"faultstring": "SOAP-Message-Validation-1 failed with reason: \"Expected <\/title> at line 15(possibly around char 420)\"",
"detail": {
"errorcode": "steps.messagevalidation.Failed"
}
}
}
การวินิจฉัย
ระบุชื่อนโยบาย SOAPMessageValidation, เหตุผลที่ทำให้เกิดข้อผิดพลาด และหมายเลขบรรทัดของเพย์โหลด XML ที่ไม่ตรงกับคำจำกัดความของ WSDL คุณดูข้อมูลทั้งหมดนี้ได้ในสตริงข้อผิดพลาด ตัวอย่างเช่น ในสตริงข้อผิดพลาดต่อไปนี้ ชื่อนโยบาย SOAPMessageValidation คือ
SOAP-Message-Validation-1เหตุผลที่ทำให้เกิดข้อผิดพลาดคือExpected </title> at line 15(possibly around char 420):และหมายเลขบรรทัดคือ15."faultstring": "SOAP-Message-Validation-1 failed with reason: \"Expected </title> at line 15(possibly around char 420)\""ตรวจสอบเพย์โหลดอินพุตในหมายเลขบรรทัดที่ระบุในขั้นตอนที่ 1 ด้านบนเพื่อทำความเข้าใจสาเหตุที่ทำให้เกิดข้อผิดพลาด
เพย์โหลด SOAP ของอินพุตตัวอย่าง
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> <soap:Body> <shipOrder xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"> <shipTo> <name>Karl Kalckstein</name> <street>1020 Parkway</street> <address>Mountain View, CA 94043</address> <country>USA</country> </shipTo> <items> <item> <title>I love APIs</titles> <quantity>1</quantity> <price>2.90</price> </item> </items> </shipOrder> </soap:Body> </soap:Envelope>ในตัวอย่างที่แสดงด้านบน บรรทัดที่ 15 ของ XML อินพุตมีองค์ประกอบ
<title>แต่ไม่ได้ปิดด้วยแท็กสิ้นสุด</title>
ความละเอียด
หากต้องการแก้ไขข้อผิดพลาด ให้ตรวจสอบว่าเพย์โหลดอินพุตถูกต้องและสร้างขึ้นอย่างถูกต้อง
เช่น คุณอาจแก้ไขเพย์โหลด XML ของอินพุตได้ดังนี้
...
</shipTo>
<items>
<item>
<title>I love APIs</title>
<quantity>1</quantity>
<price>2.90</price>
</item>
</items>
...