Dws.RenameDws Method
Changes the title of the current Document Workspace site.
Namespace: [DWS Web service]
Web service reference: http://Site/_vti_bin/DWS.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/dws/RenameDws", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/dws/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/dws/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function RenameDws ( _
title As String _
) As String
'Usage
Dim instance As Dws
Dim title As String
Dim returnValue As String
returnValue = instance.RenameDws(title)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/dws/RenameDws", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/dws/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/dws/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string RenameDws(
string title
)
Parameters
title
Type: System.StringThe new title for the Document Workspace site.
Return Value
Type: System.String
A string that returns an empty <Result/> tag when successful.
Exceptions
Exception | Condition |
---|---|
[DWSError.NoAccess(3)] | The user does not have sufficient rights. |
Remarks
The RenameDws method renames the current Document Workspace site by changing its title. This operation does not affect the URL of the Document Workspace site.
Examples
The following code example uses the RenameDws method to change the title of the current Document Workspace site. 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.RenameDws("new_title")
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
MessageBox.Show _
("The document workspace was successfully renamed.", _
"Rename DWS", MessageBoxButtons.OK, _
MessageBoxIcon.Information)
End If
Catch exc As Exception
MessageBox.Show("An exception occurred." & vbCrLf & _
"Description: " & exc.Message, _
"Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
Label1.Text = Me.GetCurrentWeb()
End Try
try
{
string strResult = "";
strResult = dwsWebService.RenameDws("new_title");
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
{
MessageBox.Show
("The document workspace was successfully renamed.",
"Rename DWS", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}
catch (Exception exc)
{
MessageBox.Show("An exception occurred.\r\n" +
"Description: " + exc.Message,
"Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}