Export (0) Print
Expand All

How to: Customize Meeting Workspaces Using the Meetings Web Service

Published: May 2010

The Meetings Web service helps you to create and manage Meeting Workspace sites. This topic describes how you can use the Web services to perform the following tasks:

  • Identify existing Meeting Workspace sites.

  • Create new Meeting Workspace sites and add meetings.

  • Delete Meeting Workspace sites.

  • Update meeting information on a Meeting Workspace site.

Before you begin, create a Windows Forms application in Microsoft Visual Studio. For information about setting a Web reference to a Microsoft SharePoint Foundation Web service, see Web Service Guidelines.

To identify existing Meeting Workspace sites

  • The following code example lists the Meeting Workspace sites that exist on the server.

    Note Note

    The example assumes that ServerURLTextBox is an interface element that has been added to a form in the project.

    mywss001.Meetings ws = new mywss001.Meetings();
    System.Net.CredentialCache myCache = new System.Net.CredentialCache();
    
    private void ListMWS_Click(System.Object sender, System.EventArgs e)
    {
        ws.Credentials = myCache.DefaultCredentials();
        ws.Url = ServerURLTextBox.Text;
        if ((ws.Url.EndsWith("/"))) {
            ws.Url = ws.Url.Remove(ws.Url.Length - 1, 1);
        }
        ws.Url = ws.Url + "/_vti_bin/meetings.asmx";
        System.Xml.XmlNode GetMeetingWorkspacesResponse = default(System.Xml.XmlNode);
        if ((!string.IsNullOrEmpty(ws.Url))) {
            GetMeetingWorkspacesResponse = ws.GetMeetingWorkspaces(true);
        }
        string OuterXml = null;
        OuterXml = GetMeetingWorkspacesResponse.OuterXml();
        Interaction.MsgBox("OuterXml");
    }
    

To create a new Meeting Workspace site and add a meeting to the site

  • The following code example creates a Meeting Workspace site and adds a meeting to it.

    Note Note

    The example assumes that ServerURLTextBox, MeetingSubjectTextBox, MeetingLocationTextBox, DTSTARTTextBox, DTENDTextBox, and CreateWorkspaceButton are all interface elements that have been added to a form in the project.

    mywss001.Meetings ws = new mywss001.Meetings();
    mywss001.TimeZoneInf tz = new mywss001.TimeZoneInf();
    System.Net.CredentialCache myCache = new System.Net.CredentialCache();
    int UID;
    UInt32 Sequence;
    
    private void CreateWorkspaceButton_Click(System.Object sender, System.EventArgs e)
    {
        ws.Credentials = myCache.DefaultCredentials();
        ws.Url = ServerURLTextBox.Text;
        if ((ws.Url.EndsWith("/"))) {
            ws.Url = ws.Url.Remove(ws.Url.Length - 1, 1);
        }
        ws.Url = ws.Url + "/_vti_bin/meetings.asmx";
        System.Xml.XmlNode CreateWorkspaceResponse = default(System.Xml.XmlNode);
        if ((!string.IsNullOrEmpty(ws.Url))) {
            CreateWorkspaceResponse = ws.CreateWorkspace(MeetingSubjectTextBox.Text, "MPS#0", System.UInt32.Parse("1033"), tz);
        }
        string OuterXml = null;
        OuterXml = CreateWorkspaceResponse.OuterXml();
        string MWSURL = null;
        int Start = 0;
        int Finish = 0;
        Start = OuterXml.IndexOf("\"");
        Finish = OuterXml.IndexOf("\"", Start + 1);
        MWSURL = OuterXml.Substring(Start + 1, Finish - Start - 1);
        System.Random MyRand = new System.Random();
        UID = MyRand.Next(100, 10000);
        Sequence.ToString("0");
        ws.Url = MWSURL + "/_vti_bin/meetings.asmx";
        ws.AddMeeting("", UID.ToString, Sequence, "2003-03-27T15:00:00-08:00", MeetingSubjectTextBox.Text, MeetingLocationTextBox.Text, DTSTARTTextBox.Text, DTENDTextBox.Text, false);
        MWSURLLink.Text = MWSURL;
    }
    

To delete a Meeting Workspace site

  • The following code example deletes a specified Meeting Workspace site.

    Note Note

    The example assumes that MWSURLLink contains the URL of the Meeting Workspace site.

    private void DeleteWorkspaceButton_Click(System.Object sender, System.EventArgs e)
    {
        ws.Credentials = myCache.DefaultCredentials();
        ws.Url = MWSURLLink.Text + "/_vti_bin/meetings.asmx";
        ws.DeleteWorkspace();
    }
    

To update meeting information on a Meeting Workspace site

  • The following code example updates a meeting that exists on a Meeting Workspace site.

    Note Note

    The example assumes that MWSURLLink, MeetingSubjectTextBox, MeetingLocationTextBox, DTSTARTTextBox, DTENDTextBox, and CreateWorkspaceButton are all interface elements that have been added to a form in the project.

    private void UpdateMeetingButton_Click(System.Object sender, System.EventArgs e)
    {
        ws.Credentials = myCache.DefaultCredentials();
        ws.Url = MWSURLLink.Text + "/_vti_bin/meetings.asmx";
        Sequence.ToString("0");
        ws.UpdateMeeting(UID, Sequence, "2003-03-27T15:00:00-08:00", MeetingSubjectTextBox.Text, MeetingLocationTextBox.Text, DTSTARTTextBox.Text, DTENDTextBox.Text, false);
    }
    

Community Additions

ADD
Show:
© 2014 Microsoft