Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Extract XML from the response of a web service

SAURABH DUDEJAMar 21 2018 — edited Mar 21 2018

Hi Team,

I need some inputs on how to efficiently extract XML from a response of a web service call. Below are the details

I am calling a web service which gives me response like below, some where in that response there is a XML embedded which I need to extract and then parse that XML to process it. I need efficient way to retrieve that XML

The Response from the payload is as below

{

------=_Part_17670_1128501005.1521615976060

Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

Content-Transfer-Encoding: 8bit

Content-ID: <66bd8c4a-60d5-4c2b-899a-7fef20978dba>

<?xml version="1.0" encoding="utf-8" ?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing"><env:Header><wsa:Action>http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService//ErpIntegrationService/uploadFileToUcmResponse</wsa:Action><wsa:MessageID>urn:uuid:cc90ddb4-5422-4347-919c-4e0a8b658224</wsa:MessageID></env:Header><env:Body><ns0:uploadFileToUcmResponse xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/"><result xmlns="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/">8859099</result></ns0:uploadFileToUcmResponse></env:Body></env:Envelope>

------=_Part_17670_1128501005.1521615976060--

}

my requirement is to extract the XML from the above CLOB

{

<?xml version="1.0" encoding="utf-8" ?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing"><env:Header><wsa:Action>http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService//ErpIntegrationService/uploadFileToUcmResponse</wsa:Action><wsa:MessageID>urn:uuid:cc90ddb4-5422-4347-919c-4e0a8b658224</wsa:MessageID></env:Header><env:Body><ns0:uploadFileToUcmResponse xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/"><result xmlns="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/">8859099</result></ns0:uploadFileToUcmResponse></env:Body></env:Envelope>

}

my Data Base version is 12c

I have tried using DBMS_LOB.SUBSTR/INSTR to retrieve the XML, but wanted to check if there is other good way

Thanks in Advance !!!!!!!!!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2018
Added on Mar 21 2018
1 comment
897 views