Identical GetListItems action works on one page, not another

Sep 14, 2011 at 2:49 PM
Edited Sep 14, 2011 at 3:55 PM

THis is very odd. On a page hosted on a SharePoint, I have a document load with 2 GetListItems calls. One of them works, yet the other one never works. To see if a query was improperly formatted, I copy pasted a query which does work on a different page (along with 3 other getListItem queries). When I paste the duplicate working one in from the other page, it still does not work on the SP page.

Here are my only thoughts as to why it could be behaving different:

  • IIS server vs. SP server, could the SP server be configured to be blocking cross domain SP Service Queries unlike the IIS?
  • Is there anything on an SP master page or default.aspx page that will stop more than one call?

Any thoughts on this would be greatly appreciated. This does not make any sense to me.

 One last thought. When using my Stramit Caml Viewer 2007 app and open this list I get this error: some problems during the ws call ... system.xmlException: 'rules' is an unexpected tokenm. Expecting white space.

This list was migrated from a 3.0 Farm to a MOSS farm. I wonder if the migration corrupted something?

 

Coordinator
Sep 14, 2011 at 2:52 PM

It's hard to say without seeing your code and understanding your environment. Since the execution stops midstream, though, there might be a bug in your script. Try debugging with the Developer Tools or Firebug and/or looking at the Net traffic with Firebug or Fiddler.

M.

Sep 14, 2011 at 8:01 PM

Thanks Marc, here is the code, the one which does not work is the bottom one which I have made bare bones just to get any result.

$(document).ready(function() {
//alert('hi');
    
 $().SPServices({
   operation: "GetListItems",
   // Force sync so that we have the right values for the child column onchange trigger
   async: false,
   webURL: "http://ccc.com/sites/web/",
   listName: "Contact",
   // Filter based on the currently selected parent column's value
   CAMLViewFields: "<ViewFields><FieldRef Name='LinkTitle'/><FieldRef Name='Message'/><FieldRef Name='URL'/><FieldRef Name='Resolved'/><FieldRef Name='Author'/><FieldRef Name='Created'/><FieldRef Name='SME'/><FieldRef Name='WSS_x0020_Request'/><FieldRef Name='Reply'/><FieldRef Name='ContactF' /></ViewFields>",
   CAMLQuery: "<Query><OrderBy><FieldRef Name='ID' /></OrderBy><Where><Eq><FieldRef Name='Resolved' /><Value Type='Text'>Pending</Value></Eq></Where></Query>",
   CAMLRowLimit: "10",
   completefunc: function (xData, status) {
    $(xData.responseXML).find("[nodeName='z:row']").each(function() {
     var Html = "<strong><a href=http://ccc.com/sites/web/Lists/Contact/DispForm.aspx?ID=" + $(this).attr("ows_ID") + ">" + $(this).attr("ows_Author") + "</a></strong><br/>";
     $("#mytab5").append(Html);
     //alert(xData.responseText);

    });
   }
   });//End SPServices Call
    
 
 $().SPServices({
   operation: "GetListItems",
   // Force sync so that we have the right values for the child column onchange trigger
   async: false,
   webURL: "http://ddd.com/sites/TD/SLT/",
   listName: "Tasks",
   // Filter based on the currently selected parent column's value
   //CAMLViewFields: "<ViewFields><FieldRef Name='ContentType' /><FieldRef Name='Title' /><FieldRef Name='Status' /><FieldRef Name='Validated' /><FieldRef Name='DueDate' /></ViewFields>",
   //CAMLQuery: "<Query><OrderBy><FieldRef Name='Modified' Ascending='FALSE' /><FieldRef Name='Priority' /></OrderBy><Where><And><Eq><FieldRef Name='AssignedTo' /><Value Type='Integer'><UserID Type='Integer' /></Value></Eq><Eq><FieldRef Name='Status' /><Value Type='Text'>In Progress</Value></Eq></And></Where></Query>",
   CAMLViewFields: "<ViewFields><FieldRef Name='ID' /></ViewFields>",
   CAMLQuery: "<Query><OrderBy><FieldRef Name='ID' /></OrderBy><Where></Where></Query>",
   CAMLRowLimit: "10",
   completefunc: function (xData, status) {
    $(xData.responseXML).find("[nodeName='z:row']").each(function() {
     var Html = "<strong><a href=http://ddd.com/sites/TD/SLT/Lists/Tasks/DispForm.aspx?ID=" + $(this).attr("ows_ID") + ">" + $(this).attr("ows_ID") + "</a></strong><br/>";
     $("#mytab1").append(Html);
     alert(xData.responseText);

    });
   }
   });//End SPServices Call
       });//End Document Ready Function

Sep 19, 2011 at 5:51 PM

Just an update; the whote space in the xml seems to be caused by the use of the Metalogix migration tool when individual lists or libraries are moved. So beware that this tool could stop your webservices from working using this Library if you intend a migration with Metalogix. We are contacting their support for intervention.

Coordinator
Sep 21, 2011 at 1:22 PM

Interesting. Let us know what you find out.

M.