Hi all, I am new to SharePoint development and stuck with the problem in which i need to run SSharePoint internal web service 'List'. When ever I call the GetList('MyListName') method of this web service I got following exception
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.
Followin is the Code that I am using
----------------------------------------------------------------
ListWS.Lists list = new ListWS.Lists();
string strUserId = "administrator";
string strPassword = "123456";
System.Net.NetworkCredential credential = new System.Net.NetworkCredential(strUserId, strPassword, "techerz-01");
list.Credentials = credential;
list.Timeout = System.Threading.Timeout.Infinite;
XmlNode listResponse = list.GetList("Sites");
----------------------------------------------------------------
Any Idea how to get this issue resolve?
Loading
Bijayani BaijayantiPosted Jun 23, 2010, 3:36 AM
Then we will use the ConnectionProvider and ConnectionConsumer attribute to make the connection between the two webpart.
EXAMPLE:
1. Interface :
public interface Test
{
string Name { get; set; }
}
Hope you find this tips useful.
Thanks,
Bijayani
Learn about SharePoint Migration.
John WiesePosted May 17, 2010, 5:10 PM
using (SPSite site = new SPSite("http://localhost/sites/sitecollection"))
{
using (SPWeb web = site.OpenWeb("sitecollection/subsite"))
{
string listUrl = "/sites/sitecollection/subsite/Lists/Announcements";
SPList list = web.GetList(listUrl);
Console.WriteLine("List URL: {0}", list.RootFolder.ServerRelativeUrl);
}
}
Since you are running in a webpart on the local server you should be able to use similar code replacing the Console.WriteLine() with appropriate code.