Compartilhar via


Dws.GetDwsData 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/GetDwsData", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/dws/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/dws/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetDwsData ( _
    document As String, _
    lastUpdate As String _
) As String
'Usage
Dim instance As Dws
Dim document As String
Dim lastUpdate As String
Dim returnValue As String

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

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 Documents list returned by the GetDwsData method.

  • lastUpdate
    Type: System.String

    String. The LastUpdate value returned in the results of a previous call to the GetDwsData or GetDwsMetadata method, or an empty string. If a list in the Document Workspace site has not changed since lastUpdate, the GetDwsData method returns "no changes" in place of list data for performance reasons.

Return Value

Type: System.String

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

  • Title

  • LastUpdate

  • User

  • Members

  • Assignees

  • Lists (Tasks, Documents, Links)

Exceptions

Exception Condition
[DWSError.NoAccess(3)]

May be returned by the GetDwsMetaData method. Indicates the user does not have sufficient rights.

[DWSError.NoAccess(3)]

May be returned by the GetDwsData method within the results it returns pertaining to the lists in the Document Workspace site. Indicates the user does not have sufficient rights.

[DwsError.ListNotFound(7)]

May be returned by the GetDwsData method within the results it returns pertaining to the lists in the Document Workspace site. Indicates the specified list does not exist.

[DwsError.TooManyItems(8)]

May be returned by the GetDwsData method within the results it returns pertaining to the lists in the Document Workspace site. Indicates the specified list contains more than 99 items.

Remarks

The GetDwsData method returns general information about the Document Workspace site, as well as its members, documents, links, and tasks.

Examples

The following code example returns information from a Document Workspace site by using the GetDwsData method. 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.GetDwsData("Shared 
        Documents/document_name.doc", "")
    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:\GetDwsData.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.GetDwsData("Shared 
        Documents/document_name.doc", "");
    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:\\GetDwsData.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