I have an anonymous PL / SQL block that returns an XML to me as the result of running a web service. How do I give a select in this XML to get only one column I want?
Anonymous block:
DECLARE
l_filename varchar2(255);
l_BLOB BLOB;
l_CLOB CLOB;
l_envelope CLOB;
l_response_msg varchar2(32767);
l_result VARCHAR2(32767);
l_xml XMLTYPE;
BEGIN
l_envelope := q'!<?xml version='1.0' encoding='UTF-8'?>!';
l_envelope := l_envelope ||
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:rev1="http://www.ikhon.com.br/soap/rev1">
<soapenv:Header/>
<soapenv:Body>
<rev1:AssuntoPesquisar>
<!--Optional:-->
<rev1:cod_assunto>9999</rev1:cod_assunto>
<!--Optional:-->
<rev1:txt_conarq_codigo></rev1:txt_conarq_codigo>
<!--Optional:-->
<rev1:txt_conarq_assunto></rev1:txt_conarq_assunto>
</rev1:AssuntoPesquisar>
</soapenv:Body>
</soapenv:Envelope>';
l_xml := apex_web_service.make_request(
p_url => 'http://intrahml/system/x64/ws/Proton.asmx',
p_action => 'http://www.ikhon.com.br/soap/rev1/AssuntoPesquisar',
p_envelope => l_envelope,
p_username => 'username',
p_password => 'password' );
DBMS_OUTPUT.put_line('Resultado: ' || l_xml.getClobVal());
END;