I am calling a SOAP based webservice using PL/SQL block. The response returned is in the following format :
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header/>
<env:Body>
<ns0:getDocumentDataResponse xmlns:ns0="http://xmlns.oracle.com/oxp/service/ScheduleReportService">
<ns3:getDocumentData ="http://xmlns.oracle.com/oxp/service/ScheduleReportService">JVBERi0xLjYNCjUgMCB vYmoNCjw8DQovVHlwZSAvWE9iamVjdA0KL1N1YnR5cGUgL0ltYWdlDQov
RmlsdGVyIC9GbGF0ZURlY29kZQ0KL0xlbmd0aCA1MzUNCi9XaWR0aCA5Mg0KL0hlaWdodCAxNQ0K
L0JpdHNQZXJDb21wb25lbnQgOA0KL0NvbG9yU3BhY2UgL0RldmljZVJHQg0KPj4NCnN0cmVhbQ0K
eJztVzuOAjEM5U65yJwip6DgGnOhrai5AhLNLh0SRfZ5nDiexPFktS1PFgqMYz//kiGlD47xeDzS
9WoKPdJ4/4w0s/g40nm9Xo5xeUqLGbhsszWT5LKkU0inky0hpBjrXixGmqI/ivp8yTqmAvivK20f
WT5fqECOBYXn80nuHGvwxe4aU/hRx2JKE6nkxNfvOetkhkCcFahkVJqxZTx9/9CuiZxQ6jTzXmLM
....
OWExMDllPjxhMWE2NTE2ZDNmYTcwY2Y2NzhkY2EwMWIzZjlhMTA5ZT5dDQo+Pg0Kc3RhcnR4cmVm
DQoxMDg0MTIwDQolJUVPRg0K</ns3:getDocumentData>
</ns0:getDocumentDataResponse>
</env:Body>
</env:Envelope>
This response is stored in the variable : l_xml_response_text(varchar2) and when I execute the following code: l_xml_response_xmltype := xmltype(l_xml_response_text);
it Is throwing the error:
Exception ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00007: unexpected end-of-file encountered.
On further analysis, I was able to see that DBMS_OUTPUT.PUT_LINE (l_xml_response_text) is printing only a part of the data and not the entire response. Is it possible that, since it is not able to fetch the whole data and therefore not able to extract the ending tags for the XML and thus giving this error?
If yes, how can we handle this ?
I am working on database version 11g