你能否检查一下这个XML有什么问题?客户端正在发送此XML请求以处理我的应用程序。
<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eze="http://ezeepay_test">
<soapenv:Header/>
<soapenv:Body>
<eze:RequestService
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<InputXml xsi:type="xsd:string">
<?xml version="1.0"
encoding="UTF-8"?>
<Request>
<BankID>05</BankID>
<TransactionID>1004114741235</TransactionID>
<TransactionType>Payment</TransactionType>
<ServiceType>Bill</ServiceType>
<TransactionDateStamp>04-04-2019 11:43:13</TransactionDateStamp>
<Amount>500</Amount>
<PaymentType>Cash</PaymentType>
</Request>
</InputXml>
</eze:RequestService>
</soapenv:Body>
</soapenv:Envelope>
我需要使用xPath迭代节点来读取元素。但是当我解析这个XML时,我得到以下错误。
我正在使用DocumentBuilderFactory对它进行删除。
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
//This is where I am getting Error.
Document doc = db.parse(new InputSource(new StringReader(XMLRequestString)));
请告诉我在代码级别可以进行哪些操作。