Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with RESTDataSource

    I am having a RESTDataSource binded to a listgrid, which fetches data from a Server in JSON format, i have a siteminder app between client and server that intercepts request to check if the user is looged in or not.
    When user session times out in siteminder and user clicks on the gui the RESTDatasource call the server for data but is intercepted by siteminder thus get a redirct to a login page(Resp status 200 ), the datasource doesnt understnd the HTML response and hangs, i tried to check this condition in transformResponse method but its not getting called.
    how can i handle this, i want to detect this in transformResponse method and warn the user about session time out and redirct to login page

    #2
    See the QuickStart, Data Integration chapter, Relogin section.

    Comment


      #3
      Thanks for quick reply,

      Seems like this "Relogin" functionality works with RPCManager, is there any way we can have the same functionality with RestDataSource.

      Warm regards,
      Abhinandan

      Comment


        #4
        All of the data sources use RPCManager so relogin works with all of them.

        Comment


          #5
          Hello,
          Below is my code that is using loginRequired functionality

          RPCManager.sendRequest(
          {
          bypassCache : true,
          httpMethod : "POST",
          callback: "callBackNextPage(data,'"+action+"')",
          loginRequired: function (transactionNum, rpcRequest, rpcResponse) {
          alert("login is required");
          window.location = context+"/public/home.jsp";
          },
          actionURL:context+"/public/backEnd"
          }
          );
          I have added loginRequired marker in my response html page, which I am sending when session is timed out.
          But loginRequired function is not at all called.

          More detailed response is much appreciated.

          Thanks,
          Abhinandan

          Comment


            #6
            loginRequired is a class-level method on the RPCManager not on the RPCRequest.

            Code:
            RPCManager.loginRequired : function(transactionNum, rpcRequest, rpcResponse) {
            // handle login required here.
            }
            
            RPCManager.sendRequest(...);

            Comment

            Working...
            X