从CLOB调用Soap wanto ExtractValue /返回null

时间:2017-07-18 17:12:26

标签: xml web-services oracle11g xml-parsing

我是XML和Clobs的新手。我已经阅读了很多关于这个主题的帖子。我试图从这个clob中提取“processNPCMsgReturn”值。我正在使用Oracle 11.2

`

              -- Create XML type from response text
            l_resp_xml := xmltype.createxml(l_clob_response);
            -- Clean SOAP header
            SELECT extract(l_resp_xml
                          ,'Envelope/Body/node()'
                          ,l_namespace_soap)
              INTO l_resp_xml
              FROM dual;
            -- Extract Fahrenheit value 
            l_result_xml_node := '/processNPCMsgResponse/processNPCMsgReturn/';
            dbms_output.put_line('Response from w3schools webservices:');
            l_result_XML_node := 'processNPCMsgResponse/';
    SELECT EXTRACTVALUE(l_resp_xml, 'processNPCMsgResponse/processNPCMsgReturn', 'xmlns="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ws="http://ws.inpac.telcordia.com/"') INTO l_response_value FROM dual;

0 != b

1 个答案:

答案 0 :(得分:0)

通过以下

解决问题
select xmltype( l_clob_response ).extract('//processNPCMsgReturn/text()','xmlns:soap="http://schemas.xmlsoap.org/soap/encoding/" ' ||'xmlns:ws="http://ws.inpac.telcordia.com/"').getStringVal() INTO l_response_value1 from dual;