I have been struggling with the Freemarker syntax to read values from a java object using xpath.
I tried lot of options and every time i am seeing an error :
freemarker.core.InvalidReferenceException: Expression ficustomer["hostCredential/loginId"] is undefined on line 1, column 789 in TPV_ST.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125) [nestedjar5644171301190540297.tmp:2.3.18]
According to this ficustomer, is not XML (not a wrapped XML DOM). You also call getHostCredential() and such on it, which also shows that it's not XML. XPath is for XML. (BTW, you don't have to write ficustomer.getHostCredential() and such, it's just ficustomer.hostCredential, on almost all configurations.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I have been struggling with the Freemarker syntax to read values from a java object using xpath.
I tried lot of options and every time i am seeing an error :
freemarker.core.InvalidReferenceException: Expression ficustomer["hostCredential/loginId"] is undefined on line 1, column 789 in TPV_ST.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125) [nestedjar5644171301190540297.tmp:2.3.18]
Syntax I am Using:
<#if ficustomer?exists && ficustomer.getHostCredential()?exists && ficustomer.getHostCredential().getLoginId()?exists>
<#list ficustomer["hostCredential\loginId"] as id>
<AmountDue>${id}</AmountDue>
<UserLoginID>${ficustomer.getHostCredential().getLoginId()}</UserLoginID>
Thanks In Advance
Here is my Response XML which is nothing but the ficustomer object:
<ns5:FICustomer>
<ns5:id>c0a8e4400000d9cc4f21cf47130f3b00</ns5:id>
<ns5:fiId>DI4715</ns5:fiId>
<ns5:name>Josh Larsen</ns5:name>
<ns5:memberNumber>depositslip</ns5:memberNumber>
<ns5:hostCredential>
<ns4:loginId>depositslip</ns4:loginId>
</ns5:hostCredential>
<ns5:person>
<ns4:contactInfo>
<ns4:emailAddress>josh.larsen@digitalinsight.com</ns4:emailAddress>
</ns4:contactInfo>
</ns5:person>
<ns5:channelInfos>
<ns5:channelInfo>
<ns5:channelType>WEB</ns5:channelType>
<ns5:credential>
<ns4:loginId>DEPOSITSLIP</ns4:loginId>
</ns5:credential>
<ns5:service>0</ns5:service>
<ns5:id>0</ns5:id>
<ns5:failedLoginCount>0</ns5:failedLoginCount>
<ns5:validLoginCount>3</ns5:validLoginCount>
<ns5:userStatus>
<ns5:limbo>false</ns5:limbo>
<ns5:active>true</ns5:active>
<ns5:newUser>false</ns5:newUser>
<ns5:onHold>false</ns5:onHold>
<ns5:reinitiated>false</ns5:reinitiated>
<ns5:locked>false</ns5:locked>
<ns5:acceptedDisclosure>true</ns5:acceptedDisclosure>
<ns5:appliedForBPElectronicRegistration>false</ns5:appliedForBPElectronicRegistration>
<ns5:needsToAcceptDisclosure>false</ns5:needsToAcceptDisclosure>
<ns5:mustChangePassword>true</ns5:mustChangePassword>
<ns5:invalidEmailId>false</ns5:invalidEmailId>
<ns5:mustChangeAltUserId>false</ns5:mustChangeAltUserId>
<ns5:needsToAcceptSecondaryDisclosure>false</ns5:needsToAcceptSecondaryDisclosure>
<ns5:bpFrontPageFalseBpPendingPaymentsTrue>false</ns5:bpFrontPageFalseBpPendingPaymentsTrue>
<ns5:adminApprovedIBRegistrationInMC>false</ns5:adminApprovedIBRegistrationInMC>
<ns5:fiApprovalPending>false</ns5:fiApprovalPending>
<ns5:reset>true</ns5:reset>
<ns5:mfaEnrolledCookie>false</ns5:mfaEnrolledCookie>
<ns5:mfaMandatory>false</ns5:mfaMandatory>
<ns5:mfaOptional>false</ns5:mfaOptional>
<ns5:inquiryOnly>false</ns5:inquiryOnly>
<ns5:bpOptOut>false</ns5:bpOptOut>
<ns5:smsMobileActivationConfirmed>false</ns5:smsMobileActivationConfirmed>
<ns5:smsMobileEnrolled>false</ns5:smsMobileEnrolled>
<ns5:issoUserEnrolled>false</ns5:issoUserEnrolled>
<ns5:resetIssoUserEnrolled>false</ns5:resetIssoUserEnrolled>
<ns5:entitlements>false</ns5:entitlements>
<ns5:emailMfaEnrolled>false</ns5:emailMfaEnrolled>
<ns5:uspEnrolled>true</ns5:uspEnrolled>
</ns5:userStatus>
<ns5:lastLoginDate>2014-11-07-08:00</ns5:lastLoginDate>
<ns5:lastLoginDateTime>2014-11-07T14:18:30-08:00</ns5:lastLoginDateTime>
</ns5:channelInfo>
</ns5:channelInfos>
<ns5:billPayEnabled>false</ns5:billPayEnabled>
<ns5:lastMobileLoginDateTime>2014-09-23T05:13:05-07:00</ns5:lastMobileLoginDateTime>
<ns5:memberRegistrationDate>2012-01-26-08:00</ns5:memberRegistrationDate>
<ns5:productAppUserInfos>
<ns5:productAppUserInfo>
<ns5:appCode>QOL</ns5:appCode>
<ns5:statusCode>ACTIVE</ns5:statusCode>
<ns5:lastActivityDate>2012-05-09-07:00</ns5:lastActivityDate>
</ns5:productAppUserInfo>
<ns5:productAppUserInfo>
<ns5:appCode>IAM</ns5:appCode>
<ns5:externalAuthId>219841123</ns5:externalAuthId>
<ns5:externalPassword>6805e1f2bf01a45b49a887520a8b99f0</ns5:externalPassword>
</ns5:productAppUserInfo>
<ns5:productAppUserInfo>
<ns5:appCode>onlineStatement</ns5:appCode>
<ns5:acceptedDisclosureDate>2013-11-13-08:00</ns5:acceptedDisclosureDate>
<ns5:OSPaperStatement>true</ns5:OSPaperStatement>
<ns5:OSEmailReminder>false</ns5:OSEmailReminder>
<ns5:OSDisclosure>true</ns5:OSDisclosure>
</ns5:productAppUserInfo>
<ns5:productAppUserInfo>
<ns5:appCode>SBFW</ns5:appCode>
<ns5:statusCode>ELIGIBLE</ns5:statusCode>
<ns5:lastActivityDate>2012-01-26-08:00</ns5:lastActivityDate>
</ns5:productAppUserInfo>
<ns5:productAppUserInfo>
<ns5:appCode>TTO</ns5:appCode>
<ns5:statusCode>ELIGIBLE</ns5:statusCode>
</ns5:productAppUserInfo>
</ns5:productAppUserInfos>
<ns5:ibStartupPage>SECONDARY~PRIMARY_BUTTON_ACCOUNT_ACCESS.BUTTON_NAME~ACCOUNT_ACCESS_SECONDARY_BUTTON_SDP.BUTTON_NAME</ns5:ibStartupPage>
</ns5:FICustomer>
According to this
ficustomer
, is not XML (not a wrapped XML DOM). You also callgetHostCredential()
and such on it, which also shows that it's not XML. XPath is for XML. (BTW, you don't have to writeficustomer.getHostCredential()
and such, it's justficustomer.hostCredential
, on almost all configurations.)