K2 Rest service returns result intermittent

  • 16 February 2015
  • 6 replies
  • 3 views

Userlevel 3
Badge +9

Scenario

To retrive the count of tasks assigned to current login user in sharepoint

 

Implementaion

using below code in sharepont content editor webpart

 

function GetMyTasksCount() {
$.ajax({
url: 'http://k2dev.abc.com/K2Services/REST.svc/Worklist/Items?$format=json&filterXml=<Criteria xmlns="http://schemas.k2.com/worklist/d1"><Filter Field="ProcessName" Comparison="Equal" ValueType="String">Test Wokflow</Filter></Criteria>',
method: 'GET',
crossDomain: false,
error: function (data, error, status) {
$("#MyTaskCount").empty();
$("#MyTaskCount").append("<p>Failed to retirve tasks</p>");
},
success: function (data) {
tasks = data;
ShowMyTasksCount();
}
});
}

 

Issue

sometimes it works and sometimes it returns result as unknown.


6 replies

Userlevel 3
Badge +9

Any Idea on this?

Badge +10

Strange Issue. Is this environment load balanced?

Userlevel 3
Badge +9

Its not load balanced and we have only 1 K2 server in environemnt

Userlevel 5
Badge +18

1.  How many Sharepoint WFEs?


- perhaps using a "hosts" file entry on a local machine, point the sharepoint url/fqdn to each of the WFE's IP address, to see if perhaps there is a WFE that is configured differently than the other, possibly resulting in intermittently issues.


- does the intermittent behavior occur during certain times of the days; perhaps during morning when web applicaton have not warmed up yet?

Badge +3

Your sharepoint have the same server name as k2 server?  

 

I try to work with K2 Rest Service, but fail baciuse of crossDomain security issue. Maybe it is your case. 

Userlevel 3
Badge +9

I am not sure what was the issue but now its fixed.. may be due to some network activity... not sure about it...

Reply