我的代码在Codeigniter中使用Restful api。
$cobSessionToken=cobloginss();
$userSession_Token=getUserToken();
$response = array();
$config = array(
"url" => "https://rest.developer.yodlee.com/services/srest/restserver/v1.0/jsonsdk/SiteAccountManagement/addSiteAccount1",
"parameters" => array(
"cobSessionToken" => $cobSessionToken,
"userSessionToken" => $userSession_Token,
"siteId" => $_POST['siteId'],
"credentialFields.enclosedType" => 'com.yodlee.common.FieldInfoSingle',
"credentialFields[0].displayName" => $_POST['credentialFields1_displayName'],
"credentialFields[0].typeName" => $_POST['credentialFields1_fieldType_typeName'],
"credentialFields[0].name" => $_POST['credentialFields1_name'],
"credentialFields[0].value" => $_POST['credentialFields'][0],
"credentialFields[0].valueIdentifier" => $_POST['credentialFields1_valueIdentifier'],
"credentialFields[0].valueMask" => $_POST['credentialFields1_valueMask'],
"credentialFields[0].isEditable" => $_POST['credentialFields1_isEditable'],
"credentialFields[0].helpText" => $_POST['credentialFields1_helpText'],
"credentialFields[0].maxlength" => $_POST['credentialFields1_maxlength'],
"credentialFields[0].size" => $_POST['credentialFields1_size'],
"credentialFields[1].displayName" => $_POST['credentialFields2_displayName'],
"credentialFields[1].typeName" => $_POST['credentialFields2_fieldType_typeName'],
"credentialFields[1].name" => $_POST['credentialFields2_name'],
"credentialFields[1].value" => $_POST['credentialFields'][1],
"credentialFields[1].valueIdentifier" => $_POST['credentialFields2_valueIdentifier'],
"credentialFields[1].valueMask" => $_POST['credentialFields2_valueMask'],
"credentialFields[1].isEditable" => $_POST['credentialFields2_isEditable'],
"credentialFields[1].helpText" => $_POST['credentialFields2_helpText'],
"credentialFields[1].maxlength" => $_POST['credentialFields2_maxlength'],
"credentialFields[1].size" => $_POST['credentialFields2_size']
)
);
当我执行print_r($ config)
时,这看起来如下所示Array
(
[url] => https://rest.developer.yodlee.com/services/srest/restserver/v1.0/jsonsdk/SiteAccountManagement/addSiteAccount1
[parameters] => Array
(
[cobSessionToken] => 08062013_0:52e7099efa26aa3393dacc1d237ad3b53609041d8f82188491fb9c70764e20e05c63e3e7e1850dfc7913bbf54a5c7880f14531fc71e234d24200a51812b992e0
[userSessionToken] => 08062013_0:0588a3039977888a5d3f49a741b43b0d3e9aa9325b8daa444de6f31f3008f1481d9faa0a301d75173f42a6c84d824cd9467ec8634f45ae60f987c7d2c28fb8f7
[siteId] => 3345
[credentialFields.enclosedType] => com.yodlee.common.FieldInfoSingle
[credentialFields[0].displayName] => User ID
[credentialFields[0].typeName] => IF_LOGIN
[credentialFields[0].name] => LOGIN
[credentialFields[0].value] => dustingyoder
[credentialFields[0].valueIdentifier] => LOGIN
[credentialFields[0].valueMask] => LOGIN_FIELD
[credentialFields[0].isEditable] => true
[credentialFields[0].helpText] => 53224
[credentialFields[0].maxlength] => 40
[credentialFields[0].size] => 20
[credentialFields[1].displayName] => Password
[credentialFields[1].typeName] => IF_PASSWORD
[credentialFields[1].name] => PASSWORD
[credentialFields[1].value] => Dus08Yod1985
[credentialFields[1].valueIdentifier] => PASSWORD
[credentialFields[1].valueMask] => LOGIN_FIELD
[credentialFields[1].isEditable] => true
[credentialFields[1].helpText] => 53223
[credentialFields[1].maxlength] => 40
[credentialFields[1].size] => 20
)
)
,最后的回复是
Array
(
[Body] => stdClass Object
(
[errorOccurred] => true
[exceptionType] => com.yodlee.core.IncompleteArgumentException
[referenceCode] => _08ddcbd6-7d93-4365-9ee0-e3555ca181f9
[message] => Incomplete argument: FieldInfoSingle: {FieldInfo: name="null" displayName="null" editable=false optional=false helpText="null" valuePattern="null" } defaultValue="null" value="null" validValues=[null] displayValidValues=[null] valueIdentifier="PASSWORD" valueMask="LOGIN_FIELD" fieldType="null" validationRules=[null] size=null maxlength=null userProfileMappingExpression=null fieldErrorCode=null fieldErrorMessage=null
)
)
任何人都可以请让我知道我做错了什么
答案 0 :(得分:0)
只是在服务中缺少参数,我在firebug控制台中找到了这些参数感谢firebug ..总共需要传递32个参数我只传递了24个参数所以通过将剩余的参数(参数)传递给Web来解决问题服务
答案 1 :(得分:0)
我们建议您传递所有必需的参数以及哪些参数是可选的,但视具体用途而定。
很高兴你已经确定了根本原因。