Extract multiple values from SOAP Respond
717341Aug 20 2009 — edited Aug 23 2009Hello,
I'm trying to consume a custom Web Service I've written from PL/SQL and published using JDeveloper. I'm able to write a code to successfully use this Web Service if the SOAP output contains only one value.
I've updated this Web Service and now, the SOAP yields 2 output. My question is, how can I store each value to a variable?
Here's the SOAP output. I want to store the values from tags perrormsgInout and return.
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://trn2/UpdatePO.wsdl">
<env:Body>
<ns0:updatePoResponseElement>
<ns0:result>
<ns0:perrormsgInout>Successfully updated PO 0818200902</ns0:perrormsgInout>
<ns0:return>Y</ns0:return>
</ns0:result>
</ns0:updatePoResponseElement>
</env:Body>
</env:Envelope>
And here's the later part of my code. I'm only able to store the first value. How can I store into a variable the 2nd value?
l_resp:= l_resp.extract (
'ns0:updatePoResponseElement/ns0:result/ns0:perrormsgInout/text()'
,'xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://trn2/UpdatePO.wsdl"'
);
l_error_msg := l_resp.getClobVal();
DBMS_OUTPUT.put_line ('l_error_msg = ' || l_error_msg);
Thanks in advance for the help.