0

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

mdedetrich
  • 1,899
  • 1
  • 18
  • 29
  • You should use startSiteRefresh only and are you getting 405 as Http error code or Yodlee's error code in response? If you are getting in Yodlee's response then could you please check if you are calling stopSiteRefresh then please don't use that as it will result in 405(User aborted refresh). – Apoorv Awasthi May 23 '14 at 09:50
  • The error code is not happening in Yodlee's response, its a general HTTP error that Yodlee is throwing (which cascades through the SOAP API via Axis), see the edit for more info The code which is initiating the refresh is exactly as shown, it is also being done relatively shortly after various `addSite` calls are done, however according to the documentation it should work regardlesss – mdedetrich May 24 '14 at 04:36

1 Answers1

0

Could you please check if you are using correct Service Name?

Though I am providing some Java Code for your help, this may help.

RefreshServiceLocator locator = new RefreshServiceLocator();
String serviceName = locator.getRefreshServiceWSDDServiceName();
serviceName = serviceName + getSDKVersion(); //SDKversion which you are using
locator.setRefreshServiceEndpointAddress(System.getProperty("com.yodlee.soap.services.url")
+ "/" + serviceName1);
refresh = locator.getRefreshService();

Apart from this could you also please check that all your config is correct? Here is another thread which could help (not related to Yodlee but 405 in general).

Community
  • 1
  • 1
Apoorv Awasthi
  • 1,397
  • 1
  • 12
  • 20
  • Made an edit to the original post, the code for getting the locator is the same code being used for every other locator, so unless there is something specific in regards to `RefreshServiceLocator` I don't think that is the cause, will try messing around with it though – mdedetrich May 26 '14 at 06:45
  • I think you are missing to append SDKVersion at the end of your serviceName, that is mandatory. Please check that part. – Apoorv Awasthi May 26 '14 at 06:47
  • Appending the SDK Version made no difference, still getting the same error – mdedetrich May 26 '14 at 07:05
  • For final reference, the string for the final endpoint address for the refresh service ends up being `https://rest.developer.yodlee.com/services/services/RefreshService_12_0` – mdedetrich May 26 '14 at 07:11
  • It seems like you are using same Locator for refreshService which you have already used for siteAccountManagement. Here- Locators.refreshService.startSiteRefresh(userContext,id,refreshParameters) while you have created a different locator for refreshService. Please check. – Apoorv Awasthi May 26 '14 at 07:48
  • There are 2 locators being used `Locators.siteAccountManagement` returns a SiteAccountManagement locator and `Locators.refreshService` returns a RefreshService locator `val toRefresh = Locators.siteAccountManagement.getAllSiteAccounts(userContext).list.collect{` Gets all of the sites that we want to refresh (hence why `SiteAccountManagement` is being used) and `Locators.refreshService.startSiteRefresh(userContext,id,refreshParameters)` is doing the actual refresh of the site (hence its using the `Refresh` locator). Also the code would not compile if I used an incorrect locator – mdedetrich May 26 '14 at 07:53