I am attempting to refresh all of the sites for a certain user account (sometimes when a user enters certain types of accounts, they don't get fully refreshed, so we wan't do a complete forced refresh of all of users accounts)
According to the startSiteRefresh, we should be using startSiteRefresh, however I am getting a 405
error on the actual call of startSiteFresh
, i.e. Locators.refreshService.startSiteRefresh(userContext,id,refreshParameters)
Here is the code (which is written in scala
, but uses the java
axis/soap API) which should correspond to the logic shown here.
def initiateRefresh(userContext:UserContext)(implicit cobrandContext:CobrandContext) = {
val toRefresh = Locators.siteAccountManagement.getAllSiteAccounts(userContext).list.collect{
case x:SiteAccountInfo if
x.getSiteRefreshInfo.getSiteRefreshStatus == SiteRefreshStatus.REFRESH_NEVER_INITIATED ||
x.getSiteRefreshInfo.getSiteRefreshStatus == SiteRefreshStatus.REFRESH_TIMED_OUT ||
x.getSiteRefreshInfo.getSiteRefreshStatus == SiteRefreshStatus.REFRESH_COMPLETED
=> x.getSiteAccountId
}
val refreshParameters = new RefreshParameters()
refreshParameters.setRefreshPriority(RefreshInitiate.High.id.toInt)
refreshParameters.setRefreshMode(RefreshMode.NORMAL_REFRESH_MODE)
refreshParameters.setForceRefresh(true)
toRefresh.foreach{id =>
Locators.refreshService.startSiteRefresh(userContext,id,refreshParameters)
}
}
RefreshInitiate
is defined here
sealed abstract class RefreshInitiate(val id:Long)
object RefreshInitiate {
case object High extends RefreshInitiate(1)
case object Low extends RefreshInitiate(2)
case object StopReasonTimeout extends RefreshInitiate(100)
case object StopReasonUserAborted extends RefreshInitiate(101)
case object StopReasonMFATimeout extends RefreshInitiate(102)
case object StopReasonMFAGathererTimeout extends RefreshInitiate(103)
}
So RefreshInitiate.High.id.toInt
corresponds to the Int(1), this is taken from java_soap_example com.yodlee.sampleapps.helper.RefreshHelper
class
Other calls like startSiteReferesh2
(which is used in the java_soap_example) and startSiteRefresh7
also return a405
Here is the stack trace from the call
<p>
(405)Method Not Allowed
</p>
</div>
<div class="details block">
<pre class="stacktrace">at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)</pre>
<pre class="stacktrace">at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)</pre>
<pre class="stacktrace">at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)</pre>
<pre class="stacktrace">at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)</pre>
<pre class="stacktrace">at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)</pre>
<pre class="stacktrace">at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)</pre>
<pre class="stacktrace">at org.apache.axis.client.Call.invokeEngine(Call.java:2784)</pre>
<pre class="stacktrace">at org.apache.axis.client.Call.invoke(Call.java:2767)</pre>
<pre class="stacktrace">at org.apache.axis.client.Call.invoke(Call.java:2443)</pre>
<pre class="stacktrace">at org.apache.axis.client.Call.invoke(Call.java:2366)</pre>
<pre class="stacktrace">at org.apache.axis.client.Call.invoke(Call.java:1812)</pre>
<pre class="stacktrace">at com.yodlee.soap.core.refresh.refresh.RefreshServiceSoapBindingStub.startSiteRefresh(RefreshServiceSoapBindingStub.java:5079)</pre>
<pre class="stacktrace">at com.monetise.yodlee.login.Sites$$anonfun$initiateRefresh$1.apply(Sites.scala:98)</pre>
So it appears to be Yodlee is throwing the 405 as an actual HTTP error (rather than the actual site that Yodlee is refreshing which is throwing the error code)
EDIT3: The refresh locator that is being used is defined as below
def refreshService = {
def locator = new RefreshServiceLocator()
val serviceName = locator.getRefreshServiceWSDDServiceName + Settings.sdkVersion
locator.setRefreshServiceEndpointAddress(
Settings.soapURL + "/" + serviceName
)
locator.getRefreshService
}
Configs for the URL's are as follows
export YODLEE_SOAPURL="https://rest.developer.yodlee.com/services/services"
export YODLEE_SDKVERSION="_12_0"
Final URL for the endpoint ends up being https://rest.developer.yodlee.com/services/services/RefreshService_12_0