将我们的.wsdl文件更新为最新的Yodlee SOAP API(2014_Q4)时,以前没有出现的代码区域便开始引发错误。我们处理交易搜索的代码没有任何变化。引发的错误是
org.apache.axis2.databinding.ADBException: Unexpected subelement highLevelCategoryReq
这是在
executeUserSearchRequest
调用中发生的,即Locators.transactionSearchService.executeUserSearchRequest(userContext, transactionSearchRequest)
searchRequest的设置实际上与示例代码(最新Java SDK示例代码,文件夹名为
Aggregation12-JavaSampleApps
)中显示的设置完全相同。如下所示val transactionSearchRange = new TransactionSearchResultRange()
transactionSearchRange.setStartNumber(startRange)
transactionSearchRange.setEndNumber(endRange)
val transactionSearchRequest = new TransactionSearchRequest()
val transactionSearchFilter = new TransactionSearchFilter
transactionSearchFilter.setTransactionSplitType(TransactionSplitType.ALL_TRANSACTION)
val itemAccountId = new ItemAccountId()
itemAccountId.setIdentifier(bankData.getItemAccountId)
transactionSearchFilter.setItemAccountId(itemAccountId)
transactionSearchRequest.setSearchFilter(transactionSearchFilter)
transactionSearchRequest.setIgnorePaymentTransactions(false)
transactionSearchRequest.setIncludeAggregatedTransactions(true)
transactionSearchRequest.setResultRange(transactionSearchRange)
transactionSearchRequest.setContainerType("all")
transactionSearchRequest.setSearchClients(TransactionSearchClients.DEFAULT_SERVICE_CLIENT)
transactionSearchRequest.setIgnoreUserInput(true)
Locators.transactionSearchService.executeUserSearchRequest(userContext, transactionSearchRequest)
Stacktrace直至相关内容如下
org.apache.axis2.databinding.ADBException: Unexpected subelement highLevelCategoryReq
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.yodlee.soap.core.transactionsearch.transactionsearchservice.TransactionSearchServiceSoapBindingStub.executeUserSearchRequest(TransactionSearchServiceSoapBindingStub.java:1019)
这是我们期望发现并处理的错误,还是表明存在更大的潜在问题?
最佳答案
您需要使用正确的SOAP版本端点。由于您使用的是2014Q4 WSDL,因此所有API调用的端点都应指向2014Q4版本。
范例-
对于交易搜索-https://xxx.yodlee.com/yodsoap/services/TransactionSearchService_2014Q4
因此,请更改所有URL的服务版本,它应该可以解决您的问题。