ORA-31011 XML parsing failed
ORA-31011 XML parsing failed
Titleimage
Posted by Patrick Hamou on 2017:09:19 21:43:55
APPLIES TO: Oracle Database- Enterprise Edition - Version 11.2.0.4 and later
Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.
SYMPTOMS: XML parsing, ORA-31011
When attempting to XML parsing ,
the following error occurs.
ERROR
-----------------------
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Error processing input</faultstring>
<detail>
<OracleErrors xmlns="http://xmlns.oracle.com/orawsv/faults">
<OracleError>
<ErrorNumber>ORA-31011</ErrorNumber>
<Message>
<![CDATA[ XML parsing failed ]]>
</Message>
</OracleError>
</OracleErrors>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
CAUSE: XMLTYPE, WEB Service
Having XMLTYPE as a return type of a function is a problem when the function is called by a web service
create or replace procedure serpt.PTCL_DLVRY(TELENO IN VARCHAR2,
P_DOUT OUT xmltype) is
BEGIN
SELECT XMLFOREST(consignmentno,
bkg_date,
telephoneno,
customerid,
accountid,
exchangecode,
exchangename,
orgn,
dstn,
received_by,
delivery_date,
dlvry_tim,
status,
X.RECEIVER_MOBILE,
RECEIVER_RELATION,
NEAREST_LANDMARK,
UPDATED_ADDRESS,
RESERVE_1,
RESERVE_2,
RESERVE_3,
RESERVE_4) into l_xmltype
FROM SE.ptcl_dlvry_data_vu X
where x.telephoneno = TELENO;
exception
when no_data_found then
null;
end PTCL_DLVRY;
SOLUTION
Change its return type to CLOB and add the following conversion in the end of it.RETURN return_xml.getClobVal();
Posted by Patrick Hamou on 2017:09:19 21:43:55