How to: Customize Meeting Workspaces Using the Meetings Web Service

Applies to: SharePoint Foundation 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.

Procedures

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

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

    Dim ws As New mywss001.Meetings()
    Dim myCache As New System.Net.CredentialCache()
    
    Private Sub ListMWS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListMWS.Click
     ws.Credentials = myCache.DefaultCredentials()
     ws.Url = ServerURLTextBox.Text
     If (ws.Url.EndsWith("/")) Then
      ws.Url = ws.Url.Remove(ws.Url.Length - 1, 1)
     End If
     ws.Url = ws.Url + "/_vti_bin/meetings.asmx"
     Dim GetMeetingWorkspacesResponse As System.Xml.XmlNode
     If (ws.Url <> "") Then
      GetMeetingWorkspacesResponse = ws.GetMeetingWorkspaces(True)
     End If
     Dim OuterXml As String
     OuterXml = GetMeetingWorkspacesResponse.OuterXml()
     MsgBox("OuterXml")
    End Sub
    
    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

    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.

    Dim ws As New mywss001.Meetings()
    Dim tz As New mywss001.TimeZoneInf()
    Dim myCache As New System.Net.CredentialCache()
    Dim UID As Integer
    Dim Sequence As UInt32
    
    Private Sub CreateWorkspaceButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CreateWorkspaceButton.Click
     ws.Credentials = myCache.DefaultCredentials()
     ws.Url = ServerURLTextBox.Text
     If (ws.Url.EndsWith("/")) Then
      ws.Url = ws.Url.Remove(ws.Url.Length - 1, 1)
     End If
     ws.Url = ws.Url + "/_vti_bin/meetings.asmx"
     Dim CreateWorkspaceResponse As System.Xml.XmlNode
     If (ws.Url <> "") Then
      CreateWorkspaceResponse = ws.CreateWorkspace(MeetingSubjectTextBox.Text, "MPS#0", System.UInt32.Parse("1033"), tz)
     End If
     Dim OuterXml As String
     OuterXml = CreateWorkspaceResponse.OuterXml()
     Dim MWSURL As String
     Dim Start As Integer
     Dim Finish As Integer
     Start = OuterXml.IndexOf("""")
     Finish = OuterXml.IndexOf("""", Start + 1)
     MWSURL = OuterXml.Substring(Start + 1, Finish - Start - 1)
     Dim MyRand As 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
    End Sub
    
    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

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

    Private Sub DeleteWorkspaceButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteWorkspaceButton.Click
     ws.Credentials = myCache.DefaultCredentials()
     ws.Url = MWSURLLink.Text + "/_vti_bin/meetings.asmx"
     ws.DeleteWorkspace()
    End Sub
    
    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

    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 Sub UpdateMeetingButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateMeetingButton.Click
     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)
    End Sub
    
    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);
    }
    

See Also

Reference

[Meetings Web service]

Other Resources

SharePoint Foundation 2010 Web Services