posts - 250,  comments - 58,  trackbacks - 5053

I've been searching for a decent bug tracker for a while looking mainly at open source options.  I found a few but none of them were great.  After installing Windows Server 2003 Small Business Edition I knew I had sharepoint, but just didn't have any time to look at it.  Well tonight I took a quick peek and found that it works great for a bug tracker.  The only issue I wasn't sure about was how to deliver at least a read only version to clients.  A quick search on the web gave me the results I needed.  Sharepoint exposes several web services, and for this problem specificaly they expose a service called lists.asmx.  Do a search on the MSDN library and you'll find lots of info. I pulled most of what I needed from there. The asmx will be at http://website/_vti_bin/Lists.asmx. Here's a quick and dirty example:

         
            SharepointIssueService.Lists lists = new SharepointIssueService.Lists();
            lists.Credentials = new System.Net.NetworkCredential(username, password, domain);
            XmlDocument xmlDoc = new System.Xml.XmlDocument();
            XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element,"ViewFields","");
            ndViewFields.InnerXml = "<FieldRef Name='LinkTitle'/><FieldRef Name='AssignedTo'/><FieldRef Name='Comment'/>";
            try
            {
                XmlNode node = lists.GetListItems("Catapult Issue List", string.Empty ,null, ndViewFields, string.Empty, null );
                XmlTextReader xr = new XmlTextReader(node.OuterXml, XmlNodeType.Element, null);
                DataSet ds = new DataSet();
                ds.ReadXml(xr);
                DataTable table = ds.Tables["row"];
                foreach(DataRow row in table.Rows)
                {
                    foreach(DataColumn column in row.Table.Columns)
                    {
                        Response.Write(column.ColumnName + ":" + row[column] + "<br>");
                    }
                    Response.Write("<hr>");
                }
            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                Response.Write("Message:\n" + ex.Message + "\nDetail:\n" + ex.Detail.InnerText +
                    "\nStackTrace:\n" + ex.StackTrace);
            }
  
posted on Wednesday, March 15, 2006 12:44 AM
Post a new comment about this topic
Title  
Name  
Url

Comments   

Enter the code you see: