WebPartPagesWebService.GetWebPartPageDocument Method
Returns the Web Part Page, complete with the Web Parts and the properties included within each Web Part zone.
Namespace: [Webpartpages Web service]
Web service reference: http://Site/_vti_bin/Webpartpages.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://microsoft.com/sharepoint/webpartpages/GetWebPartPageDocument", RequestNamespace := "https://microsoft.com/sharepoint/webpartpages", _
ResponseNamespace := "https://microsoft.com/sharepoint/webpartpages", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetWebPartPageDocument ( _
documentName As String _
) As String
'Usage
Dim instance As WebPartPagesWebService
Dim documentName As String
Dim returnValue As String
returnValue = instance.GetWebPartPageDocument(documentName)
[SoapDocumentMethodAttribute("https://microsoft.com/sharepoint/webpartpages/GetWebPartPageDocument", RequestNamespace = "https://microsoft.com/sharepoint/webpartpages",
ResponseNamespace = "https://microsoft.com/sharepoint/webpartpages",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string GetWebPartPageDocument(
string documentName
)
Parameters
documentName
Type: System.StringThe name of the Web Part Page.
Return Value
Type: System.String
A string that contains the Web Part Page and associated Web Parts and properties.
Remarks
The GetWebPartPageDocument method always returns the shared view of the Web Part Page.
To access the WebPartPagesWebService service and its methods, set a Web reference to http://Virtual_Server_Name:Port_Number/_vti_adm/WebPartPages.asmx.
Examples
The following code example shows a locally defined GetWebPartPageDocument method that obtains a Web Part Page by calling the GetWebPartPageDocument method of the Web Part Pages service through a proxy. It then displays the Web Part Page, the Web Parts on the page, their properties, and their property values. This code example and the proxy are part of a larger example provided for the Web Part Pages service.
Private Sub GetWebPartPageDocument()
' NOTE: The Web Service we are using is defined on MyServer/_vti_bin
' Declare and initialize a variable for the WebPartPages Web Service.
Dim svc = New Microsoft.Samples.WebPartPagesSvcClient.WebpartpagesSvc.WebPartPagesWebService()
' Authenticate the current user by passing their default
' credentials to the Web Service from the system credential cache.
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim result As String = ""
' docName accepts full HTTP urls or relative paths under root
Dim docName As String = "http://MyServer/Shared%20Documents/SampleStart.aspx"
result = svc.GetWebPartPageDocument(docName)
Console.WriteLine("Result is: " + ControlChars.Lf + " {0}" + ControlChars.Lf, result)
Console.WriteLine("-----Hit enter-----")
Console.ReadLine()
End Sub 'GetWebPartPageDocument
private void GetWebPartPageDocument()
{
// NOTE: The Web Service we are using is defined on MyServer/_vti_bin
// Declare and initialize a variable for the WebPartPages Web Service.
WebpartpagesSvc.WebPartPagesWebService svc = new Microsoft.Samples.WebPartPagesSvcClient.WebpartpagesSvc.WebPartPagesWebService();
// Authenticate the current user by passing their default
// credentials to the Web Service from the system credential cache.
svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
string result = "";
// docName accepts full HTTP urls or relative paths under root
string docName = "http://MyServer/Shared%20Documents/SampleStart.aspx";
result = svc.GetWebPartPageDocument(docName);
Console.WriteLine("Result is: \n {0}\n",result);
Console.WriteLine("-----Hit enter-----");
Console.ReadLine();
}