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!

Extract Values From XMLTYPE (SOAP Response)

User_TQYB8Apr 26 2020 — edited Apr 27 2020

Dear ,

i receive a soap response in xml response format , i need to save my result in database column , i used to use the below command , but now it's giving me error

will you guide me what should be the correct format to extract the "Contract Number" Value

Used Command :

LV_EJCONTR_NUM  varchar2(500);

  LV_EJCONTR_NUM := XMLTYPE( LV_SOAP_RESP).EXTRACT('//ContractNumber/text()','xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" '  || 'xmlns="http://tempuri.org/').GETSTRINGVAL();

Error :ORA-31011: XML parsing failed

Receieved XML Response :

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

      <TCGetByContractNumberResponse xmlns="http://tempuri.org/">

         <TCGetByContractNumberResult>NoErrors</TCGetByContractNumberResult>

         <TenancyContract xmlns:a="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

            <a:AmmountInformations i:nil="true"/>

            <a:ContractAmount>18000</a:ContractAmount>

            <a:ContractEndDate>2020-06-14T00:00:00</a:ContractEndDate>

            <a:ContractNumber>0120200422005734</a:ContractNumber>

            <a:ContractStartDate>2019-06-15T00:00:00</a:ContractStartDate>

            <a:ContractStatus>Pending</a:ContractStatus>

This post has been answered by odie_63 on Apr 26 2020
Jump to Answer
Comments
Post Details
Added on Apr 26 2020
2 comments
3,441 views