GetListItems not working on Claims site with FBA

Sep 30, 2013 at 9:58 PM
Edited Sep 30, 2013 at 11:52 PM
Hello everyone,

I cannot seem to get SPServices/GetListItems to work on a site that is setup with Claims and Forms Based Authentication. I've veryified that my references are correct by using the below Hello World script:
<script type="text/javascript">
alert ("js on.");
$(document).ready(function() {
alert ('jQuery on.');
var thisSite = $().SPServices.SPGetCurrentSite();
alert ('Hello World! Your site is : ' + thisSite );
});
</script>
I have no problems with GetListItems on all of my other sites which includes a site with Claims but no Forms Based Authentication. Is there anything I can do to trouble shoot what is going on? It may not be that Claims and FBA are what's causing my issue, but at the moment that is the only thing that is different between all of my sites.

Thanks in advance,
Jovix
Oct 1, 2013 at 12:23 AM
What's the problem :)

Can you post your code around the call to GetListItems operation including any errors you may be getting/seeing.

Paul.


--

_________
Paul T

Oct 1, 2013 at 3:17 PM
Edited Oct 1, 2013 at 3:25 PM
Hi Paul,

Thanks for the reply.

My code is working on all my other environments, I also tested with the sample GetListItems code straight from the documentation here on this site. Again, the sample code worked on all of my environments except for the environment that is on Claims with FBA.

Also, I'm not getting any errors, I'm using a CQWP.

Here is the sample code I used.
<script type="text/javascript" src="filelink/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="filelink/jquery.SPServices-0.6.2.min.js"></script>
<script language="javascript" type="text/javascript">

$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Announcements",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
        $("#tasksUL").append(liHtml);
      });
    }
  });
});
</script>
<ul id="tasksUL"/>
Oct 2, 2013 at 4:41 PM
Edited Oct 2, 2013 at 4:41 PM
I got it to work.

For some reason everything worked after adding the webURL parameter into the code. I'm not sure why this was required in this case, maybe someone can shed some light into that for future reference.
webURL: "mywebURL",
listName: "myList",
Jovix
Oct 2, 2013 at 10:20 PM
Glad you got passed it.

Regarding the cause. What version of SPServices? And was this running from the root web collection?

Marc has some bug(s) pending around webURL when SPServices is used from the root site. Maybe that was the cause.

Paul


--

_________
Paul T

Oct 2, 2013 at 11:39 PM
Hi Paul,

I'm using release 2013.01 of SPServices.

And yes, everything in this particular case is on root web. The other sites where everything was working without the webURL parameter are not on the root web.

Thanks,
Jovix
Oct 2, 2013 at 11:42 PM
I'm pretty sure that's the problem them. An the workaround for now is to explicitly set the option on input.


--

_________
Paul T

Coordinator
Oct 4, 2013 at 1:52 PM
Yup, Paul's right about the root web bug. Sorry about that.

Please watch this issue for resolution:
https://spservices.codeplex.com/workitem/10165

M.