Question

My question is Can someone tell me the possible ways, I can get data from a sharepoint 2007 list, which is secured with SSL/Https for a Windows 7 gadget(uses HTML/Java Script),

(I asked my senior developers and they told me that a client first fills in a form, which is validated by ISA server and gives client a cookie, which he uses later on access the sharepoint sites he got access to, which makes me assume that its a forms authentication but then am not sure if its windows authentication as users fill in a form @ IE but if I open up same portal in chrome, a windows pops up and ask for username and password)

I have been looking at different ways, but am not sure which one exactly gonna work on in this scenario.

EDIT:
After research on Windows/Forms Authentication, I came to know we are using windows authentication.

So my question will be changed to something like this,

What are the possible ways to get a SPlist data using SOAP/Webservices, using "_vti_bin/authentication.asmx" and then "_vti_bin/lists.asmx" "GetListItems()". Keeping in mind that I dont wanna use .Net(web reference) as I am developing it for a Windows Vista Gadget which will be built using HTML/Scripting language

Cheers

More Explanation:

I tried given answer code spinets but I didn't got any success, I also came to know that a client is using basic Authentication and then Kerbos authentication somewhere between servers, Now I tried this code, which isn't working either,

    <html>
<head>
<title>Sharepoint List Browser</title>
</head>
<body style="width:400px; height:400px;">
<div id = "abc">
<button id = "btnFindLists" type="button">Click Me!</button>
<div id="mainContent">
   <p>1</p>  <!--  -- that p will be returned -->
  <p>2</p>
</div>

<script type="text/javascript" language="javascript">
  $('document').ready(function () {
    $('#btnFindLists').bind('click', findLists);
  });
  function findLists()
  {
    $.ajax(
    {
        type:'GET',
        url:'https://usa2020.domainabc.com/portal/_vti_bin/Lists.asmx',
        data:"username=domainabc\userabc&password=apassword",
        success: function(data){
        alert('successful');
      }
    });
  }
</script>
</body>
</html>

"alert" function doesn't work in a Gadget.

I tried Falak's Code as this

    <html>
<head>
<title>Sharepoint List Browser</title>
<script type="text/javascript" language="javascript">
  $('document').ready(function () {
    $('#btnFindLists').bind('click', findLists);
  });
  function findLists()
  {
    $.getJSON("https://usa2020.domainabc.com/portal/_vti_bin/Lists.asmx", {
      sucess: function (data, textStatus, xhr) {
        $("#mainContent p").first().html(data);
      }
    });
  }
</script>
</head>
<body style="width:400px; height:400px;">
<div id = "abc">
<button id = "btnFindLists" type="button">Click Me!</button>
<div id="mainContent">
   <p>1</p>  <!--  -- that p will be returned -->
</div>
</body>
</html>

Simply doesn't work like others, possible reason could be windows authentication.

Cheers

EDIT 2: *Another thing I would like to add now, which is I can't get to Webservices until I logon to ISA server, thats another clue i got.*

Was it helpful?

Solution

I am thinking why wouldn't you use ListData.svc instead of Lists.asmx to get the list data. ListData.svc provides a way of getting information from a list (or lists using joins) using REST and you end up with is a nice RSS feed of list data, that you can consume with whatever client you would like.

Also, you don't have to create the Web reference as you mentioned in the question and still make your job done via client side scripting. Here is sample query to ListData.svc using jQuery

<script type="text/javascript" language="javascript">
  $('document').ready(function () {
    $('#btnFindLists').bind('click', findLists);
  });
  function findLists()
  {
    alert('Hello World!');
    $.getJSON("/_vti_bin/ListData.svc", {
      sucess: function (data, textStatus, xhr) {
        $("#mainContent p").first().html(data);
      }
    });
  }
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top