Share The Code Concept

309days since
Republic Day

SharePoint Utility

Create a sharepoint Utility to make the webservice deployment eazier.

Sharepoint

Contents

    No headings.

    Server Template Numbers

    Using Lists.asmx

    posted ‎‎Oct 23, 2008 12:07 AM‎‎ by Praveen Krishna R

    public static void GetListData()
            {
                Lists.Lists listService = new FileUpload.Lists.Lists();
                listService.Url = "http://localhost/sites/Test/_vti_bin/lists.asmx";

                listService.Credentials = System.Net.CredentialCache.DefaultCredentials;

                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 = "<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>" +
                "<DateInUtc>TRUE</DateInUtc>";
                ndViewFields.InnerXml = "<FieldRef Name='Title' /><FieldRef Name='FileLeafRef'/>";
                ndQuery.InnerXml = "<Where><And><Gt><FieldRef Name='ID'/>" +
                "<Value Type='Counter'>0</Value></Gt><Gt><FieldRef Name='Created'/>" +
                "<Value Type='DateTime'>2003-07-03T00:00:00</Value></Gt></And></Where>";
                try
                {
                    XmlNode ndListItems =
                    listService.GetListItems("Document Library", null, ndQuery,
                    ndViewFields, null, ndQueryOptions, null);
                    MessageBox.Show(ndListItems.OuterXml);
                }

                catch (System.Web.Services.Protocols.SoapException ex)
                {
                    MessageBox.Show("Message:\n" + ex.Message + "\nDetail:\n" +
                    ex.Detail.InnerText +
                    "\nStackTrace:\n" + ex.StackTrace);
                }
            }

    Get File Versions from Document Libraries using Lists.asmx

    posted ‎‎Oct 22, 2008 11:03 PM‎‎ by Praveen Krishna R

    public static XmlNode GetLibFilesVersions(string URL, string FileName)
            {
                // proxy object to call the Versions Web service
                Versions.Versions VersionService = new Versions.Versions();
                // the user credentials to use
                VersionService.Credentials = System.Net.CredentialCache.DefaultCredentials;
                VersionService.Url = URL + "/_vti_bin/Versions.asmx";
                // gets the file versions
                XmlNode Result = VersionService.GetVersions(FileName);
                // dispose the Web service object
                VersionService.Dispose();
                return Result;
            }

    Server Template Numbers

    posted ‎‎Aug 25, 2008 5:33 AM‎‎ by Praveen Krishna R   [ updated ‎‎Oct 15, 2008 6:43 AM‎‎ ]

    100Generic list
    101Document library
    102Survey
    103Links list
    104Announcements list
    105Contacts list
    106Events list
    107Tasks list
    108Discussion board
    109Picture library
    110Data sources
    111Site template gallery
    112User Information list
    113Web Part gallery
    114List template gallery
    115XML Form library
    116Master pages gallery
    117No-Code Workflows
    118Custom Workflow Process
    119Wiki Page library
    120Custom grid for a list
    130Data Connection library
    140Workflow History
    150Gantt Tasks list
    200Meeting Series list
    201Meeting Agenda list
    202Meeting Attendees list
    204Meeting Decisions list
    207Meeting Objectives list
    210Meeting text box
    211Meeting Things To Bring list
    212Meeting Workspace Pages list
    300Portal Sites list
    301Blog Posts list
    302Blog Comments list
    303Blog Categories list
    850Page Library
    1100Issue tracking
    1200Administrator tasks list
    2002Personal document library
    2003Private document library

    ‹ Prev    1-3 of 3    Next ›