What is the proper XML format for Login Forms with a "FieldInfoChoice" element in the Yodlee Aggregation API

StackOverflow https://stackoverflow.com/questions/23085854

  •  04-07-2023
  •  | 
  •  

Question

We are building an aggregation application working with Yodlee data and while most of the institutions we work with have Login Forms that have a series of fields that need info, there is one institution (Thrift Savings Plan, Content Service ID 4479) that has a "FieldInfoChoice" element where it provides 2 fields to choose from. In attempting to test and handle this, we used the Java sample application "Aggregation12" (which is what we used as the implementation example for all other Yodlee SOAP interaction so far, and which we found here).

When trying to use the console app "yconsole.sh" to add "Thrift Savings Plan" accounts to a user, the initial login is never able to provide us with output and instead errors before it can ever produce a prompt for login info. The XML from our access logs looks like this:

=======================================================
= Elapsed: 515 milliseconds
= In message: <?xml version="1.0" encoding="UTF-8"?><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><getLoginFormForContentService xmlns="http://itemmanagement.accountmanagement.core.soap.yodlee.com"><cobrandContext xsi:type="ns1:UserContext" xmlns="" xmlns:ns1="http://common.soap.yodlee.com"><cobrandId xsi:type="xsd:long">10008392</cobrandId><channelId xsi:type="xsd:long">-1</channelId><locale xsi:type="ns2:Locale" xmlns:ns2="http://collections.soap.yodlee.com"><country xsi:type="xsd:string">US</country><language xsi:type="xsd:string">en</language><variant xsi:type="xsd:string"></variant></locale><tncVersion xsi:type="xsd:long">2</tncVersion><applicationId xsi:type="xsd:string">7A318B9CD555B6A3FF82D22CBF3C9F00</applicationId><cobrandConversationCredentials xsi:type="ns3:SessionCredentials" xmlns:ns3="http://login.ext.soap.yodlee.com"><sessionToken xsi:type="xsd:string">10122012_0:90da6f12012f755cfe402d5c72a39086e476df0913209ad6e021120fcf0434c132888648c296a3521f0f6eab3bf76b39018be8bb89278e897ad905e0c10d6288</sessionToken></cobrandConversationCredentials><preferenceInfo xsi:type="ns1:PreferenceInfo"><currencyCode xsi:type="xsd:string">USD</currencyCode><timeZone xsi:type="xsd:string">PST</timeZone><dateFormat xsi:type="xsd:string">MM/dd/yyyy</dateFormat><currencyNotationType xsi:type="ns1:CurrencyNotation">SYMBOL_NOTATION</currencyNotationType><numberFormat xsi:type="ns1:NumberFormat"><decimalSeparator xsi:type="xsd:string">.</decimalSeparator><groupingSeparator xsi:type="xsd:string">,</groupingSeparator><groupPattern xsi:type="xsd:string">###,##0.##</groupPattern></numberFormat></preferenceInfo><fetchAllLocaleData xsi:type="xsd:boolean">false</fetchAllLocaleData><conversationCredentials xsi:type="ns4:SessionCredentials" xmlns:ns4="http://login.ext.soap.yodlee.com"><sessionToken xsi:type="xsd:string">10122012_0:d0f5fdbed4521f52da62dd5b161885c4a6a45ecd6025a4225d026ef39c8b8e662bcf07f0db6dea2c177446e87e11915ffecf1332dbe8645a0655d9f5b4d4940b</sessionToken></conversationCredentials><valid xsi:type="xsd:boolean">true</valid><isPasswordExpired xsi:type="xsd:boolean">false</isPasswordExpired></cobrandContext><contentServiceId xmlns="">4479</contentServiceId></getLoginFormForContentService></soapenv:Body></soapenv:Envelope>
= Out message: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns27:getLoginFormForContentServiceResponse xmlns:ns27="http://itemmanagement.accountmanagement.core.soap.yodlee.com"><getLoginFormForContentServiceReturn xmlns:ns4="http://common.soap.yodlee.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:Form"><conjunctionOp>AND</conjunctionOp><componentList><elements xsi:type="ns4:FieldInfoChoice"><fieldInfoList><elements xsi:type="ns4:FieldInfoMultiFixed"><name>TSP Account Number (13 Digit)</name><displayName>TSP Account Number (13 Digit)</displayName><isEditable>true</isEditable><isOptional>true</isOptional><isEscaped>false</isEscaped><helpText>134201</helpText><isOptionalMFA>false</isOptionalMFA><isMFA>false</isMFA><defaultValues><elements xsi:nil="1" /><elements xsi:nil="1" /><elements xsi:nil="1" /></defaultValues><values><elements xsi:nil="1" /><elements xsi:nil="1" /><elements xsi:nil="1" /></values><validValues><elements xsi:nil="1" /><elements xsi:nil="1" /><elements xsi:nil="1" /></validValues><displayValidValues><elements xsi:nil="1" /><elements xsi:nil="1" /><elements xsi:nil="1" /></displayValidValues><valueIdentifiers><elements>OP_LOGIN</elements><elements>OP_LOGIN1</elements><elements>OP_LOGIN2</elements></valueIdentifiers><valueMasks><elements>LOGIN_FIELD</elements><elements>LOGIN_FIELD</elements><elements>LOGIN_FIELD</elements></valueMasks><fieldTypes><elements>LOGIN</elements><elements>LOGIN</elements><elements>LOGIN</elements></fieldTypes><validationRules><elements xsi:nil="1" /><elements xsi:nil="1" /><elements xsi:nil="1" /></validationRules><sizes><elements>20</elements><elements>20</elements><elements>20</elements></sizes><maxlengths><elements>4</elements><elements>4</elements><elements>5</elements></maxlengths><userProfileMappingExpressions><elements xsi:nil="1" /><elements xsi:nil="1" /><elements xsi:nil="1" /></userProfileMappingExpressions></elements><elements xsi:type="ns4:FieldInfoSingle"><name>OP_LOGIN3</name><displayName>User ID</displayName><isEditable>true</isEditable><isOptional>true</isOptional><isEscaped>false</isEscaped><helpText>134200</helpText><isOptionalMFA>false</isOptionalMFA><isMFA>false</isMFA><valueIdentifier>OP_LOGIN3</valueIdentifier><valueMask>LOGIN_FIELD</valueMask><fieldType>LOGIN</fieldType><size>20</size><maxlength>40</maxlength><fieldErrorCode xsi:nil="1" /></elements></fieldInfoList></elements><elements xsi:type="ns4:FieldInfoSingle"><name>PASSWORD</name><displayName>8-character Web Password</displayName><isEditable>true</isEditable><isOptional>false</isOptional><isEscaped>false</isEscaped><helpText>134205</helpText><isOptionalMFA>false</isOptionalMFA><isMFA>false</isMFA><valueIdentifier>PASSWORD</valueIdentifier><valueMask>LOGIN_FIELD</valueMask><fieldType>PASSWORD</fieldType><size>20</size><maxlength>8</maxlength><fieldErrorCode xsi:nil="1" /></elements></componentList><defaultHelpText>3043</defaultHelpText></getLoginFormForContentServiceReturn></ns27:getLoginFormForContentServiceResponse></soapenv:Body></soapenv:Envelope>
=======================================================

The output from the console app is here:

********************
Choice: 9

ITEM MANAGEMENT
********************
1. View Items
2. View Item
3. Dump Item
4. Add Item (Includes MFA)
5. Edit Item
6. Remove Item
7. Refresh Item
8. Refresh All
0. Exit Sub-menu
********************
Choice: 4

Enter Content ServiceId: 4479
Total time take to fetch the login form(in millis) - 786
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.yodlee.soap.common.FieldInfo;
at     com.yodlee.sampleapps.helper.FormFieldsVisitor.populateQueue(FormFieldsVisitor.java:115)
at com.yodlee.sampleapps.helper.FormFieldsVisitor.<init>(FormFieldsVisitor.java:59)
at com.yodlee.sampleapps.helper.FormUtil.getUserInputFieldInfoList(FormUtil.java:353)
at com.yodlee.sampleapps.item.AddItem.doAddItem(AddItem.java:97)
at com.yodlee.sampleapps.YodleeConsole.addItem(YodleeConsole.java:314)
at com.yodlee.sampleapps.YodleeConsole.itemManagementMenu(YodleeConsole.java:174)
at com.yodlee.sampleapps.YodleeConsole.loop(YodleeConsole.java:529)
at com.yodlee.sampleapps.YodleeConsole.main(YodleeConsole.java:574)

So, 2 questions:

1) what's the origin of this error? Without having the example of how the java sample app works with a login form of this type, it is difficult to handle it correctly in our application.

2) Can you provide us with an example of the XML format that should be sent back when this form is filled out, as we can reasonably assume that it will be different from submitting filled out fields for all of the other institutions we already work successfully with?

Was it helpful?

Solution

@ethanvizitei-

Here are answers to your query.

  1. Seems like there is some issue in Sample App code in FormFieldsVisitor.java , I suggest you to make these changes in method populateQueue(Form form).

Incorrect Code:

FieldInfo[] fieldInfoArray = null;                
                if (fieldInfos != null) {
                                fieldInfoArray = (FieldInfo[])fieldInfos.getElements();
                }              
                for(int j = 0; j < fieldInfoArray.length; j++) {
                                populateQueue(fieldInfoArray[j]);
                               if(j > 0) {
                                                needsLittleOr.add(fieldInfoArray[j]);
                                }
                }

Correct Code:

        Object[] fieldInfoArray = null;                    
        if (fieldInfos != null) {
                        fieldInfoArray = (Object[])fieldInfos.getElements();
        }              
        for(int j = 0; j < fieldInfoArray.length; j++) {
                        populateQueue((FieldInfo)fieldInfoArray[j]);
                        if(j > 0) {
                                        needsLittleOr.add((FieldInfo)fieldInfoArray[j]);
                        }
        }

This code should work, to explain the issue in the incorrect code here is it is trying to downcast complete array which should not be done. Instead we down downcast one by one element while iterating.

After this change if you'll get this error

java.lang.RuntimeException: Error fetching login form credentials for this ItemId

Then please comment this part in AddItem.java file

FormUtil.writeFormHtml(userContext, itemId,
                getLoginFormCredentialsForItem(userContext, itemId), false,
                "FilledForm");

We will get this corrected in SampleApps.

2 Below is the sample response which you need.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://login.ext.soap.yodlee.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://common.soap.yodlee.com" xmlns:ns3="http://itemmanagement.accountmanagement.core.soap.yodlee.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns3:addItemForContentService1>
    <userContext>
    <cobrandId>xxxxxxxxxxxxxxx</cobrandId>
    <channelId>-1</channelId>
    <locale>
    <country>US</country>
    <language>en</language>
    <variant/>
            </locale>
            <tncVersion>2</tncVersion>
            <applicationId>xxxxxxxxxxxxxxxxxxxxxx</applicationId>
            <cobrandConversationCredentials xsi:type="ns1:SessionCredentials">
              <sessionToken>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</sessionToken>
            </cobrandConversationCredentials>
            <preferenceInfo>
              <currencyCode>USD</currencyCode>
              <timeZone>PST</timeZone>
              <dateFormat>MM/dd/yyyy</dateFormat>
              <currencyNotationType>SYMBOL_NOTATION</currencyNotationType>
              <numberFormat>
                <decimalSeparator>.</decimalSeparator>
                <groupingSeparator>,</groupingSeparator>
                <groupPattern>###,##0.##</groupPattern>
              </numberFormat>
            </preferenceInfo>
            <fetchAllLocaleData>false</fetchAllLocaleData>
            <conversationCredentials xsi:type="ns1:SessionCredentials">
              <sessionToken>xxxxxxxxxxxxxxxxxxxxxxxxxxx</sessionToken>
            </conversationCredentials>
            <valid>true</valid>
            <isPasswordExpired>false</isPasswordExpired>
          </userContext>
          <contentServiceId>4479</contentServiceId>
          <credentialFields>
            <elements xsi:type="ns2:FieldInfoMultiFixed">
              <name>TSP Account Number (13 Digit)</name>
              <displayName>TSP Account Number (13 Digit)</displayName>
              <isEditable>true</isEditable>
              <isOptional>true</isOptional>
              <isEscaped>false</isEscaped>
              <helpText>134201</helpText>
              <isOptionalMFA>false</isOptionalMFA>
              <isMFA>false</isMFA>
              <defaultValues/>
              <values>
                <elements>1234567</elements>
                <elements>8765</elements>
                <elements>78923</elements>
              </values>
              <validValues/>
              <displayValidValues/>
              <valueIdentifiers>
                <elements>OP_LOGIN</elements>
                <elements>OP_LOGIN1</elements>
                <elements>OP_LOGIN2</elements>
              </valueIdentifiers>
              <valueMasks>
                <elements>LOGIN_FIELD</elements>
                <elements>LOGIN_FIELD</elements>
                <elements>LOGIN_FIELD</elements>
              </valueMasks>
              <fieldTypes>
                <elements>LOGIN</elements>
                <elements>LOGIN</elements>
                <elements>LOGIN</elements>
              </fieldTypes>
              <validationRules/>
              <sizes>
                <elements>20</elements>
                <elements>20</elements>
                <elements>20</elements>
              </sizes>
              <maxlengths>
                <elements>4</elements>
                <elements>4</elements>
                <elements>5</elements>
              </maxlengths>
              <userProfileMappingExpressions/>
            </elements>
            <elements xsi:type="ns2:FieldInfoSingle">
              <name>OP_LOGIN3</name>
              <displayName>User ID</displayName>
              <isEditable>true</isEditable>
              <isOptional>true</isOptional>
              <isEscaped>false</isEscaped>
              <helpText>134200</helpText>
              <isOptionalMFA>false</isOptionalMFA>
              <isMFA>false</isMFA>
              <value>apoorv123</value>
              <valueIdentifier>OP_LOGIN3</valueIdentifier>
              <valueMask>LOGIN_FIELD</valueMask>
              <fieldType>LOGIN</fieldType>
              <size>20</size>
              <maxlength>40</maxlength>
            </elements>
            <elements xsi:type="ns2:FieldInfoSingle">
              <name>PASSWORD</name>
              <displayName>8-character Web Password</displayName>
              <isEditable>true</isEditable>
              <isOptional>false</isOptional>
              <isEscaped>false</isEscaped>
              <helpText>134205</helpText>
              <isOptionalMFA>false</isOptionalMFA>
              <isMFA>false</isMFA>
              <value>09876tyqw</value>
              <valueIdentifier>PASSWORD</valueIdentifier>
              <valueMask>LOGIN_FIELD</valueMask>
              <fieldType>PASSWORD</fieldType>
              <size>20</size>
              <maxlength>8</maxlength>
            </elements>
            <elements xsi:type="ns2:FieldInfoSingle">
              <name/>
              <displayName>Verify 8-character Web Password</displayName>
              <isEditable>true</isEditable>
              <isOptional>false</isOptional>
              <isEscaped>false</isEscaped>
              <helpText>134205</helpText>
              <isOptionalMFA>false</isOptionalMFA>
              <isMFA>false</isMFA>
              <value>09876tyqw</value>
              <valueIdentifier>PASSWORD</valueIdentifier>
              <valueMask>LOGIN_FIELD</valueMask>
              <fieldType>PASSWORD</fieldType>
              <size>20</size>
              <maxlength>8</maxlength>
            </elements>
          </credentialFields>
          <shareCredentialsWithinSite>false</shareCredentialsWithinSite>
          <startRefreshItemOnAddition>false</startRefreshItemOnAddition>
        </ns3:addItemForContentService1>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top