Jul 29, 2009

SharePoint WebService Response and XML Parsing

XML Parsing

XML Returned by WebService Call


XML Parsing

private bool IsGroupExisting(ugWebService.UserGroup ugws, ArrayList grps)
{
bool flag = false;
try
{
if (grps != null & grps.Count != 0)
{
for (int i = 0; i < grps.Count; i++)
{
//Find the groups in the SP Level and if any exists notify
System.Xml.XmlNode ndGroup = ugws.GetGroupCollectionFromWeb();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(ndGroup.InnerXml);
System.Xml.XmlElement root = doc.DocumentElement;
System.Xml.XmlNodeList lst = root.GetElementsByTagName("Group");

foreach (System.Xml.XmlNode n in lst)
{
string name = n.Attributes[1].Value;
EventLogHandler.AddApplicationEventLog("IsGroupExisting Name ..." + name);
if(name.Trim().Equals(grps[i].ToString().Trim()))
{
flag = true;
break;
}//if
}//for each
if (flag)
break;

}//for
}//if
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}

Jul 22, 2009

SharePoint Deplyoment Jobs frozen or stuck

Timer Jobs Status Stuck ..

i.e. when you check in the Centrl Admin under Solution Management, all you see is ...deploying, retracting, ...

Create a batch file and execute the following before and after the solution deployment on each application and web server in the SharePoint farm:

Content of the batch file below:
stsadm.exe -o execadmsvcjobs
sleep 15
net stop SPTimerV3
sleep 5
net stop SPAdmin
sleep 5
net start SPTimerV3
sleep 5
net start SPAdmin
sleep 5
iisreset /noforce


NOTE: Can't find sleep command. Use the external sleep command you can search for Windows Server 2008 Resource Kit or Windows Server 2003 Resource Kit

Pages