How to extract a lengthy XML(98628 bytes) using EXTRACT. Is it possible to extract such a huge XML? [message #377627] |
Wed, 24 December 2008 00:11 |
ulaganathank
Messages: 2 Registered: December 2008 Location: India
|
Junior Member |
|
|
hi,
I'm passing the request XML to webservice and getting the response XML from webservice.
After getting the response XML, I tried to extact the same.
It was working fine for the XML's which is lesser than 92000 bytes(approx.).
This time my response XML is 98628. When I tried to extract, the XML is not completely extracted. I'm getting Partial XML(9140 bytes).
Oracle version : 9i.
I'm using the below piece of code :
declare
xyz clob := null;
abc clob := null;
ijk clob := null ;
v_req_xml clob := null;
x_response_xml XMLTYPE;
x_soap_header_xml XMLTYPE;
soap_header_xml CLOB;
p_response_xml clob := null;
begin
select req_xml into v_req_xml from test_xml ;---I stored the response XML as a CLOB and fetching the same.
sample_procedure('v_req_xml = ',v_req_xml) ;--Sample_procedure - autonomous procedure
x_soap_header_xml := XMLTYPE.createxml (v_req_xml);
x_soap_header_xml :=
x_soap_header_xml.EXTRACT
('/soap:Envelope/soap:Header/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
);
IF x_soap_header_xml IS NOT NULL
THEN
soap_header_xml := x_soap_header_xml.getclobval ();
soap_header_xml := '<Response>' || soap_header_xml || '</Response>';
x_soap_header_xml := XMLTYPE.createxml (soap_header_xml);
/*SELECT EXTRACTVALUE (VALUE (t), '//ServiceErrCode'),
EXTRACTVALUE (VALUE (t), '//ServiceErrMessage')
INTO service_error_code,
service_error_message
FROM TABLE (XMLSEQUENCE (EXTRACT (x_soap_header_xml, '/'))) t;
IF service_error_code IS NOT NULL
OR service_error_message IS NOT NULL
THEN
p_output_message_out :=
service_error_code || ':' || service_error_message;
p_response_xml := v_req_xml;
p_request_xml := v_request_xml;
RETURN;
END IF;*/
END IF;
x_response_xml := XMLTYPE.createxml (v_req_xml);
abc := x_response_xml.getclobval() ;--Covert XMLTYPE to CLOB to store it as a CLOB. Till here there is no issue, I'm getting the full XML
sample_procedure('abc = ',abc) ;
x_response_xml :=
x_response_xml.EXTRACT
('/soap:Envelope/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
);
ijk := x_response_xml.getclobval ();
sample_procedure('ijk = ',ijk) ;--Covert XMLTYPE to CLOB to store it as a CLOB. Here I'm getting Partial XML
x_response_xml :=
x_response_xml.EXTRACT ('/m:getPriceResponse/m:return/child::node()',
'xmlns:m="http://com/bgs/services"'
);
p_response_xml := x_response_xml.getclobval ();
sample_procedure('p_response_xml =',p_response_xml) ;
end ;
Is there any limitation to extract the huge XML?
Thanks a lot.....
|
|
|
|
|
|