Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Dot Net Technologies Interviews:.Net Architecture.Net Database.Net Deployment.NET web servicesADO.NETADO.NET 2.0ASP ProgrammingASP.NetASP.NET 2.0ASP.NET CachingASP.Net MVCBizTalkC# (Sharp) Programming LanguageCOM+Crystal ReportsDataGrid (Grid view)Dot NetDot Net AssemblyDot Net Code SecurityDot NET crystal reportsDot Net FrameworkDot Net RemotingDot Net WindowsFormsEntity FrameworkMicrosoft .Net MobileMicrosoft BasicsMicrosoft.NETMicrosoft.NET 2.0Mixed MicrosoftMono FrameworkMOSSMSFMTSReporting ServicesSenior .Net DeveloperVB .NetVB .Net DeveloperVB.NET FrameworkWCF (Windows Communication Foundation)WCF Data ServicesWeb Forms
Copyright © 2018. All Rights Reserved
MOSS Interview Question:
How to return SharePoint List items using SharePoint web services?
Submitted by: AdministratorCreate a reference to the SharePoint Lists.asmx web service by appending “/_vti_bin/Lists.asmx” to the end of a site name. One can use this url to add a service reference in Visual studio there onwards. This will query the WSDL for the Lists.asmx service.
Next step is to configure the security to be able to call the service methods. You can do this by altering the bindingConfiguration to indicate the transport uses NTLM authentication, which is the default.
We can then iterate through all the lists.
e.g:
ServiceReference1.ListsSoapClient proxy = new ServiceReference1.ListsSoapClient();
proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential();
XmlNode node = proxy.GetListCollection();
XPathNavigator nav = node.CreateNavigator();
XPathNodeIterator iter = nav.SelectDescendants("List", "http://schemas.microsoft.com/sharepoint/soap/", false);
while (iter.MoveNext())
{
string title = iter.Current.GetAttribute("Title", string.Empty);
string id = iter.Current.GetAttribute("ID", string.Empty);
Messagebox.Show ("title:" + title + “ and id:” + id);
}
writer.Flush();
Submitted by: Administrator
Next step is to configure the security to be able to call the service methods. You can do this by altering the bindingConfiguration to indicate the transport uses NTLM authentication, which is the default.
We can then iterate through all the lists.
e.g:
ServiceReference1.ListsSoapClient proxy = new ServiceReference1.ListsSoapClient();
proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential();
XmlNode node = proxy.GetListCollection();
XPathNavigator nav = node.CreateNavigator();
XPathNodeIterator iter = nav.SelectDescendants("List", "http://schemas.microsoft.com/sharepoint/soap/", false);
while (iter.MoveNext())
{
string title = iter.Current.GetAttribute("Title", string.Empty);
string id = iter.Current.GetAttribute("ID", string.Empty);
Messagebox.Show ("title:" + title + “ and id:” + id);
}
writer.Flush();
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.