0
下面是表'external'中的典型SOAP请求。用示例解析SOAP中的SOAP XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<settleResponse xmlns="urn:ABC">
<settleReturn xmlns="">
<message>Missing first name</message>
<errorCode>INVALID_ACC</errorCode>
<customData>offendingTransactionID=12345678</customData>
<divisionRequestID xsi:nil="true"/>
<status>Failed</status>
</settleReturn>
</settleResponse>
</soapenv:Body>
</soapenv:Envelope>
我需要检索参数errorCode,status ...并将它们保存到数据库表中。我怎样才能做到这一点?更简单地说
select xmlquery('declare namespace soapenv = "http://schemas.xmlsoap.org/soap/envelope/";
declare namespace urn = "urn:ABC";
/soapenv:Envelope/soapenv:Body/urn:settleResponse/settleReturn/message/text()'
passing XMLType(message)
returning content) as message,
xmlquery('declare namespace soapenv = "http://schemas.xmlsoap.org/soap/envelope/";
declare namespace urn = "urn:ABC";
/soapenv:Envelope/soapenv:Body/urn:settleResponse/settleReturn/errorCode/text()'
passing XMLType(message)
returning content) as errorCode,
xmlquery('declare namespace soapenv = "http://schemas.xmlsoap.org/soap/envelope/";
declare namespace urn = "urn:ABC";
/soapenv:Envelope/soapenv:Body/urn:settleResponse/settleReturn/status/text()'
passing XMLType(message)
returning content) as status
from external;
MESSAGE ERRORCODE STATUS
-------------------- -------------------- ----------
Missing first name INVALID_ACC Failed
或许,特别是如果你有多个邮件处理,与XMLTABLE
:
上面的SOAP XML是在'message'列中,数据类型是'external'表中的CLOB。 –
@apc:请查看此请求。 –