我一直在尝试使用REST api进行即时帐户验证,但遇到了几个问题。调用addTransferAccountForItem或addItemAndStartVerificationDataRequest api时收到错误415(问题更新帐户)。我想知道是否有任何方法可以获得更详细的错误消息,以便在进行这些调用时了解我做错了什么。错误消息以XML格式返回,但应以JSON格式返回。
以下是我如何进行addItemAndStartVerificationDataRequest调用的示例摘录。 GDURL是一个简单的类,它保存url并将所有参数连接成一个字符串,格式为“param1 = param1Value& param2 = param2Value ...”。
任何朝着正确方向的推动都将受到赞赏。谢谢。
我使用的网址是:
addItemAndStartVerificationDataRequestURL = 的baseUrl + jsonsdk / ExtendedInstantVerificationDataService / addItemAndStartVerificationDataRequest /
addTransferAccountForItem = 的baseUrl + jsonsdk / TransferAccountManagement / addTransferAccountForItem /
logger.info("Attempting to add item and start verification");
try{
GDURL iavUrl = new GDURL(restURL + addItemAndStartVerificationDataRequestURL);
iavUrl.addParameter("cobSessionToken", cobrandSessionToken);
iavUrl.addParameter("userSessionToken", userSessionToken);
iavUrl.addParameter("contentServiceId", contentServiceId);
iavUrl.addParameter("accountNumber", accountNumber);
iavUrl.addParameter("routingNumber", routingNumber);
iavUrl.addParameter("credentialFields.enclosedType", "com.yodlee.common.FieldInfoSingle");
iavUrl.addParameter("credentialFields[0].displayName", "UserID");
iavUrl.addParameter("credentialFields[0].fieldType.typeName", "IF_LOGIN");
iavUrl.addParameter("credentialFields[0].helpText", "4710");
iavUrl.addParameter("credentialFields[0].isEditable", "true");
iavUrl.addParameter("credentialFields[0].maxlength", "32");
iavUrl.addParameter("credentialFields[0].name", "LOGIN");
iavUrl.addParameter("credentialFields[0].size", "20");
iavUrl.addParameter("credentialFields[0].value", bankUsername);
iavUrl.addParameter("credentialFields[0].valueIdentifier", "LOGIN");
iavUrl.addParameter("credentialFields[0].valueMask", "LOGIN_FIELD");
iavUrl.addParameter("credentialFields[1].displayName", "Password");
iavUrl.addParameter("credentialFields[1].fieldType.typeName", "IF_PASSWORD");
iavUrl.addParameter("credentialFields[1].helpText", "11976");
iavUrl.addParameter("credentialFields[1].isEditable", "true");
iavUrl.addParameter("credentialFields[1].maxlength", "40");
iavUrl.addParameter("credentialFields[1].name", "PASSWORD");
iavUrl.addParameter("credentialFields[1].size", "20");
iavUrl.addParameter("credentialFields[1].value", bankPassword);
iavUrl.addParameter("credentialFields[1].valueIdentifier", "PASSWORD");
iavUrl.addParameter("credentialFields[1].valueMask", "LOGIN_FIELD");
HttpURLConnection connection = null;
connection = (HttpURLConnection) iavUrl.getURL().openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.addRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.connect();
String s="";
DataOutputStream wr = new DataOutputStream(connection.getOutputStream ());
wr.writeBytes(iavUrl.getParamString());
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
while(bufferedReader.ready())
s+=bufferedReader.readLine()+"/n";
}
System.out.println("add item response: /n" + s);
}catch(IOException e){
logger.error("error occured", e);
}
答案 0 :(得分:0)
415(问题更新帐户)是Yodlee的数据代理在尝试从终端站点汇总帐户时遇到异常时抛出的错误。如果最终站点终止由数据代理建立的会话,则会抛出此特定错误,因为用户可能已直接登录到终端站点。
要了解有关错误代码的详情,请参阅此document