Compartilhar via


Dws.GetDwsMetaData Method

Returns information about a Document Workspace site and the lists it contains.

Namespace:  [DWS Web service]
Web service reference: http://Site/_vti_bin/DWS.asmx

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/dws/GetDwsMetaData", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/dws/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/dws/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetDwsMetaData ( _
    document As String, _
    id As String, _
    minimal As Boolean _
) As String
'Usage
Dim instance As Dws
Dim document As String
Dim id As String
Dim minimal As Boolean
Dim returnValue As String

returnValue = instance.GetDwsMetaData(document, _
    id, minimal)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/dws/GetDwsMetaData", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/dws/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/dws/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string GetDwsMetaData(
    string document,
    string id,
    bool minimal
)

Parameters

  • document
    Type: System.String

    String. The site-based URL of a document in a document library in the Document Workspace site; for example, "Shared Documents/document_name.doc." This argument provides context for the document information returned by the GetDwsMetaData method.

  • id
    Type: System.String

    String. An optional document globally unique identifier (GUID). The id argument is used by Microsoft Office Outlook to retrieve the full document URL when a user opens a shared attachment.

  • minimal
    Type: System.Boolean

    Boolean. Determines whether the output includes information about the schemas, lists, documents, links, and tasks lists of a Document Workspace site.

Return Value

Type: System.String

A string that is an XML document fragment that contains the following information:

  • SubscribeUrl

  • MtgInstance (meeting instance, if applicable)

  • SettingsUrl (site settings URL)

  • PermsUrl (edit permissions url)

  • UserInfoUrl (user information url)

  • Roles

  • [Schema items] (if Minimal is FALSE)

  • [ListInfo items] (if Minimal is FALSE)

  • Permissions

  • HasUniquePerm (true/false)

  • WorkspaceType ("DWS", "MWS", "SPS", "")

  • IsADMode (true/false)

  • DocUrl

  • Minimal (true/false)

  • Results (data returned by the GetDwsData method)

Exceptions

Exception Condition
[HTTPerrorcode401]

The user does not have sufficient rights.

Remarks

The GetDwsMetaData method returns more information about a Document Workspace site than the GetDwsData method. When Minimal is FALSE, the GetDwsMetaData method includes additional information about the schemas, lists, documents, links, and tasks lists of a Document Workspace site.

When the user does not have sufficient rights, the HTTP error response throws an exception.

Examples

The following code example returns information from a Document Workspace site by using the GetDwsMetaData method with the Minimal argument set to FALSE. The example specifies a shared document as context for the Documents list and launches Internet Explorer to view the formatted XML results. For more information about the full text of the helper functions used in this example, see the CanCreateDwsUrl method.

Try
    Dim strResult As String
    strResult = dwsWebService.GetDwsMetaData("Shared 
        Documents/document_name.doc", "", False)
    If IsDwsErrorResult(strResult) Then
        Dim intErrorID As Integer
        Dim strErrorMsg As String
        Call ParseDwsErrorResult(strResult, intErrorID, strErrorMsg)
        MessageBox.Show _
            ("A document workspace error occurred." & vbCrLf & _
            "Error number: " & intErrorID.ToString & vbCrLf & _
            "Error description:" & strErrorMsg, _
            "DWS Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    Else
        Dim strOutputFile As String = "C:\GetDwsMetaData.xml"
        Dim tw As System.IO.TextWriter
        tw = System.IO.File.CreateText(strOutputFile)
        tw.WriteLine(strResult)
        tw.Close()
        Dim ieXMLViewer As System.Diagnostics.Process
        ieXMLViewer = New System.Diagnostics.Process()
        ieXMLViewer.Start("iexplore.exe", "file://" & strOutputFile)
    End If
Catch exc As Exception
    MessageBox.Show("An exception occurred." & vbCrLf & _
        "Description: " & exc.Message, _
        "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
try
{
    string strResult = "";
    strResult = dwsWebService.GetDwsMetaData("Shared 
        Documents/document_name.doc", "", false);
    if (IsDwsErrorResult(strResult))
    {
        int intErrorID  = 0;
        string strErrorMsg = "";
        ParseDwsErrorResult(strResult, out intErrorID, 
            out strErrorMsg);
        MessageBox.Show
            ("A document workspace error occurred.\r\n" +
            "Error number: " + intErrorID.ToString() + "\r\n" +
            "Error description: " + strErrorMsg,
            "DWS Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
    else
    {
        string strOutputFile = "C:\\GetDwsMetaData.xml";
        System.IO.TextWriter tw = 
            System.IO.File.CreateText(strOutputFile);
        tw.WriteLine(strResult);
        tw.Close();
        System.Diagnostics.Process.Start("iexplore.exe", "file://" + 
            strOutputFile);
    }
}
catch (Exception exc)
{
    MessageBox.Show("An exception occurred.\r\n" +
        "Description: " + exc.Message,
        "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

See Also

Reference

Dws Class

Dws Members

DWS Web Service