MyPortalSharePointITList.Lists listSvc = new MyPortalSharePointITList.Lists();
listSvc.Url = Util.GetLookupStringValue("DEFECTMGNTLIST", "URL");
System.Net.NetworkCredential cred = new System.Net.NetworkCredential(“User”, “Password”, "Domain");
System.Net.CredentialCache cache = new System.Net.CredentialCache();
cache.Add(new Uri(“http://servername/sites/abc”), “NTLM”, cred);
listSvc.Credentials = cache;
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields","");
XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element,"QueryOptions", "");
ndQueryOptions.InnerXml = "<IncludeAttachmentUrls>TRUE</IncludeAttachmentUrls>";
ndViewFields.InnerXml = "";
ndQuery.InnerXml = "";
XmlNode ndListItems = listSvc.GetListItems("{C0A1585E-176B-46AD-BCE4-35A1F3F63E2E}", null,
ndQuery, ndViewFields, null, ndQueryOptions, null);
txtResult.Text = ndListItems.OuterXml;