SOAP envelope XML body extraction
990011Feb 8 2013 — edited Feb 8 2013hello , I'm new in the 'XML-world' and also new on this forum but i have a question.
My function :
create or replace
FUNCTION DHL_SOAP_RESPONSE_XMLTYPE RETURN XMLType AS
SOAP_RESPONSE constant varchar2(32767) :=
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<rateresp:RateResponse xmlns:rateresp="http://scxgxtt.phx-dc.dhl.com/euExpressRateBook/RateMsgResponse">
<Provider code="DHL">
<Notification code="0">
<Message/>
</Notification>
<Service type="C">
<TotalNet>
<Currency>EUR</Currency>
<Amount>17.28</Amount>
</TotalNet>
<Charges>
<Currency>EUR</Currency>
<Charge>
<ChargeType>MEDICAL EXPRESS</ChargeType>
<ChargeAmount>14.77</ChargeAmount>
</Charge>
<Charge>
<ChargeType>FUEL SURCHARGE</ChargeType>
<ChargeAmount>2.51</ChargeAmount>
</Charge>
</Charges>
<DeliveryTime>2013-02-06T12:00:00</DeliveryTime>
<CutoffTime>2013-02-05T20:30:00</CutoffTime>
<NextBusinessDayInd>N</NextBusinessDayInd>
</Service>
<Service type="T">
<TotalNet>
<Currency>EUR</Currency>
<Amount>17.28</Amount>
</TotalNet>
<Charges>
<Currency>EUR</Currency>
<Charge>
<ChargeType>EXPRESS 12:00</ChargeType>
<ChargeAmount>14.77</ChargeAmount>
</Charge>
<Charge>
<ChargeType>FUEL SURCHARGE</ChargeType>
<ChargeAmount>2.51</ChargeAmount>
</Charge>
</Charges>
<DeliveryTime>2013-02-06T12:00:00</DeliveryTime>
<CutoffTime>2013-02-05T20:30:00</CutoffTime>
<NextBusinessDayInd>N</NextBusinessDayInd>
</Service>
<Service type="G">
<TotalNet>
<Currency/>
<Amount>0.00</Amount>
</TotalNet>
<DeliveryTime>2013-02-06T23:59:00</DeliveryTime>
<CutoffTime>2013-02-05T20:30:00</CutoffTime>
<NextBusinessDayInd>N</NextBusinessDayInd>
</Service>
<Service type="N">
<TotalNet>
<Currency>EUR</Currency>
<Amount>13.69</Amount>
</TotalNet>
<Charges>
<Currency>EUR</Currency>
<Charge>
<ChargeType>DOMESTIC EXPRESS</ChargeType>
<ChargeAmount>11.70</ChargeAmount>
</Charge>
<Charge>
<ChargeType>FUEL SURCHARGE</ChargeType>
<ChargeAmount>1.99</ChargeAmount>
</Charge>
</Charges>
<DeliveryTime>2013-02-06T23:59:00</DeliveryTime>
<CutoffTime>2013-02-05T20:30:00</CutoffTime>
<NextBusinessDayInd>N</NextBusinessDayInd>
</Service>
<Service type="9">
<TotalNet>
<Currency/>
<Amount>0.00</Amount>
</TotalNet>
<DeliveryTime>2013-02-07T23:59:00</DeliveryTime>
<CutoffTime>2013-02-05T16:30:00</CutoffTime>
<NextBusinessDayInd>N</NextBusinessDayInd>
</Service>
</Provider>
</rateresp:RateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
';
BEGIN
RETURN XMLType(SOAP_RESPONSE);
END;
Now what I want is extract the body of the respons with a select .
Can someone help me because I don't understand this ?
I work with the Oracle Database XE 11g.
SQL developer.
Thanks already