Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
Sharepoint soap envelope query in Custom Web Parts- Examples of Microsoft sharepoint
2886 Views
Introduction 
Soap Env query used to access the list items in sharepoint by the help of ajax call.Here in this codes i get the list item field value for my purpose.
Code


	$(document).ready(function(){
	/* Write the SoapEnv query according to your condition*/
	var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><GetListItems 
	xmlns='http://schemas.microsoft.com/sharepoint/soap/'>";
	           soapEnv += "<listName>List_name</listName>";
	           soapEnv += "<ViewFields><FieldRef Name='Title'/></ViewFields>";
	           soapEnv += "<view><Query><Where><Eq><FieldRef Name='checked' /><Value Type='Boolean'>TRUE</Value></Eq></Where></Query></view>";
	           soapEnv += "</GetListItems></soapenv:Body></soapenv:Envelope>";
	           initialiseAjaxc(soapEnv);
	
	function initialiseAjaxc(soapEnv)
	{
	/* By ajax call access the list by Soap Env query*/
	           $.ajax({
	               url: "http://abcde.abc.com/_vti_bin/Lists.asmx" ,
	               type: "POST",
	               dataType: "xml",
	               data: soapEnv,
	               complete: processResultc,
	               contentType: "text/xml; charset=\"utf-8\""
	           });
	}
	function processResultc(xData, status)
	{
	var count=0;
	if (window.DOMParser)
	{
	 parser=new DOMParser();
	 xmlDoc=parser.parseFromString(xData.responseText,"text/xml");
	 }
	else
	 {
	 xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	 xmlDoc.async=false;
	 xmlDoc.loadXML(xData.responseText);
	  }
	 $(xmlDoc).find("z\\:row, row").each(function() {
	 var value=$(this).attr('ows_checked');
	 /* Getting field values from the Url here */
	 });
	}
	});
Best Lessons of "Microsoft sharepoint"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details