Problema tratando XML
Publicado por Manuel (1 intervención) el 26/03/2020 12:35:50
Buenas,
Tengo un problema al tratar el xml de respuesta de un WS. Estoy tratando de recuperar el atributo code del elemento provider. Esta es la consulta
La consulta no da error pero no me devuelve nada.
Alguien me podría iluminar
Muchas gracias!!
Tengo un problema al tratar el xml de respuesta de un WS. Estoy tratando de recuperar el atributo code del elemento provider. Esta es la consulta
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
SELECT SERVICIO
FROM XMLTABLE(XMLNAMESPACES('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV",
'http://schemas.xmlsoap.org/soap/encoding/' AS "SOAP-ENC",
'http://www.w3.org/2001/XMLSchema' AS "xsd",
'http://www.w3.org/2001/XMLSchema-instance' AS "xsi",
'http://scxgxtt.phx-dc.dhl.com/euExpressRateBook/RateMsgResponse' AS "rateresp",
DEFAULT 'http://tempuri.org/'),
'/SOAP-ENV:Envelope/SOAP-ENV:Body/rateresp:RateResponse/Provider'
PASSING xmltype('<?xml version="1.0" encoding="UTF-8"?>
<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
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
</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></Message>
</Notification>
<Service type="N">
<TotalNet>
<Currency>EUR</Currency>
<Amount>7.34</Amount>
</TotalNet>
<Charges>
<Currency>EUR</Currency>
<Charge>
<ChargeType>EXPRESS DOMESTIC</ChargeType>
<ChargeAmount>6.46</ChargeAmount>
</Charge>
<Charge>
<ChargeCode>FF</ChargeCode>
<ChargeType>FUEL SURCHARGE</ChargeType>
<ChargeAmount>0.88</ChargeAmount>
</Charge>
</Charges>
<DeliveryTime>2020-01-22T23:59:00</DeliveryTime>
<CutoffTime>2020-01-21T16:00:00</CutoffTime>
<NextBusinessDayInd>N</NextBusinessDayInd>
</Service>
</Provider>
</rateresp:RateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>')
COLUMNS SERVICIO VARCHAR2(20) PATH '@code');
La consulta no da error pero no me devuelve nada.
Alguien me podría iluminar
Muchas gracias!!
Valora esta pregunta


0