gpt4 book ai didi

xml - 如何使用 plsql oracle apex 解析 soap 响应

转载 作者:数据小太阳 更新时间:2023-10-29 02:43:57 26 4
gpt4 key购买 nike

我试图解析一个 xml 响应,但没有找到任何数据。下面给出代码。任何人都请帮助我

WITH DATA AS (SELECT '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetDeliveryReportResponse xmlns="MyTest WebService">
<GetDeliveryReportResult>919748021520500 -3-4/6/2017 1:18:49 PM,919400159619-3-4/6/2017 1:19:20 PM,||rc_smsSND_NUMB-11-4/6/2017 6:10:00 PM,||rc_smsSND_NUMB-11-4/6/2017 6:11:00 PM</GetDeliveryReportResult>
</GetDeliveryReportResponse>
</soap:Body>
</soap:Envelope>' xml FROM dual)

SELECT did
FROM data,
xmltable(XMLNamespaces ('http://schemas.xmlsoap.org/soap/envelope/'
AS "soap"),
'/soap:Envelope/soap:Body/GetDeliveryReportResponse'
PASSING XMLTYPE(xml)
COLUMNS
did Varchar2(1000) PATH 'GetDeliveryReportResult');

最佳答案

您只需要在您已经编写的代码中添加一个默认声明。

WITH DATA AS (SELECT '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetDeliveryReportResponse xmlns="MyTest WebService">
<GetDeliveryReportResult>919748021520500 -3-4/6/2017 1:18:49 PM,919400159619-3-4/6/2017 1:19:20 PM,||rc_smsSND_NUMB-11-4/6/2017 6:10:00 PM,||rc_smsSND_NUMB-11-4/6/2017 6:11:00 PM</GetDeliveryReportResult>
</GetDeliveryReportResponse>
</soap:Body>
</soap:Envelope>' xml FROM dual)

SELECT did
FROM data,
xmltable(XMLNamespaces (default 'MyTest WebService',
'http://schemas.xmlsoap.org/soap/envelope/'
AS "soap"),
'/soap:Envelope/soap:Body/GetDeliveryReportResponse'
PASSING XMLTYPE(xml)
COLUMNS
did Varchar2(1000) PATH 'GetDeliveryReportResult');

关于xml - 如何使用 plsql oracle apex 解析 soap 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43257913/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com