简体   繁体   中英

how can i call sharepoint webservice using javascript?

Trying to call sharepoint web service using javascript . it's throwing error not able to call sharepoint service . if i call local XML then working fine . I tried below code for calling sharepoint webservice

    if (window.XMLHttpRequest)

          {// code for IE7+, Firefox, Chrome, Opera, Safari
              xmlhttp=new XMLHttpRequest();
          }

        else
          {// code for IE6, IE5

               alert(xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"));
          }

        xmlhttp.open("GET","http://#######_n/listdata.svc",true,"#####","#####");
         xmlhttp.setRequestHeader( 'Content-Type','application/json');
         xmlhttp.send();
         xmlDoc=xmlhttp.responseXML;

I am passing username and password for Authenticate URL . but not able to get data .

So could you tell me some idea for my problem , how can i access sharepoint webservice . which method is correct for getting all details from .svc . Its very important for me now

Advance thanks :)

Here is a nice walk through: http://weblogs.asp.net/jan/archive/2009/04/09/calling-the-sharepoint-web-services-with-jquery.aspx

I'd also recommend that you also take a look at a tool like Fiddler that can watch the traffic between your browser and the server. This can be a great help in figuring out all sorts of problems that might crop up while you are developing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM