WebPartPagesWebService.GetWebPartPageConnectionInfo Method
Returns connection information for all parts on the same page as well as compatibility results for the provider part with other parts on the same page.
Namespace: [Webpartpages Web service]
Web service reference: http://Site/_vti_bin/Webpartpages.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://microsoft.com/sharepoint/webpartpages/GetWebPartPageConnectionInfo", RequestNamespace := "https://microsoft.com/sharepoint/webpartpages", _
ResponseNamespace := "https://microsoft.com/sharepoint/webpartpages", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetWebPartPageConnectionInfo ( _
sourcePageUrl As String, _
sourcePageContents As String, _
providerPartID As String, _
lcid As String _
) As String
'Usage
Dim instance As WebPartPagesWebService
Dim sourcePageUrl As String
Dim sourcePageContents As String
Dim providerPartID As String
Dim lcid As String
Dim returnValue As String
returnValue = instance.GetWebPartPageConnectionInfo(sourcePageUrl, _
sourcePageContents, providerPartID, _
lcid)
[SoapDocumentMethodAttribute("https://microsoft.com/sharepoint/webpartpages/GetWebPartPageConnectionInfo", RequestNamespace = "https://microsoft.com/sharepoint/webpartpages",
ResponseNamespace = "https://microsoft.com/sharepoint/webpartpages",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string GetWebPartPageConnectionInfo(
string sourcePageUrl,
string sourcePageContents,
string providerPartID,
string lcid
)
Parameters
sourcePageUrl
Type: System.StringThe URL of the source page.
sourcePageContents
Type: System.StringA string containing the source of the .aspx source Web page.
providerPartID
Type: System.StringA string containing the identifier of a part that resides on the source page.
lcid
Type: System.StringA locale identifier for locale-specific properties.
Return Value
Type: System.String
A string that contains the group and interface information for all parts on the same page as well as compatibility results for the provider part with other parts on the same page. This string is an XML data island.
Remarks
Provide a value for only one of the two arguments—sourcePageUrl or sourcePageContents. The providerPartID cannot be a null reference (Nothing in Visual Basic).
For static Web Parts (not in a Web Part zone), it is possible that the part has an ID (an HTML ID) only, and not a WebPartID (a GUID). In this case, the user can provide the ID as a string to providerPartID. If the static part has only a WebPartID, or both an ID and a WebPartID, then the user must send the WebPartID to the Web Service.
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 GetWebPartPageConnectionInfo method that takes a GUID of a Web Part as an argument and obtains connection and compatibility information of the Web Part by calling the GetWebPartPageConnectionInfo method of the Web Part Pages service through a proxy. It then displays the connection and compatibility information. This code example and the proxy are part of a larger example provided for the Web Part Pages service.
Private Sub GetWebPartPageConnectionInfo(partId As String)
' 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 pageUrl As String = "http://MyServer/Shared%20Documents/SampleStart.aspx"
Dim locId As String = "1033" 'english locale ID
Dim result As String = svc.GetWebPartPageConnectionInfo(pageUrl, "", partId, locId)
Console.WriteLine("Result is: " + ControlChars.Lf + " {0}" + ControlChars.Lf, result)
Console.WriteLine("-----Hit enter-----")
Console.ReadLine()
End Sub 'GetWebPartPageConnectionInfo
' result looks like:
'
' <XML id='MSOConn_Compatibility'>
' <ConnDesign>
' <ConnectionInfo>
' <WebPart WebPartID="01d5caa2-0f7d-4780-88a8-dc09ec6e6518" ConnectionID="00000000-0000-0000-0000-000000000000">
' <InterfaceGroups>
' <InterfaceGroup GroupName="ListViewRowProvider_WPQ_" GroupMenuLabel="Provide Current Row To" Description="Provides the currently selected row to another Web
' Part." MaxConnections="-1" RunAt="Server" AllowCrossPageConnection="True">
' <Interfaces>
' <Interface Match="True" InterfaceName="ListViewRowProvider_WPQ_" Type="IRowProvider" MenuLabel="Provide Current Row To" Description="Provides the currently
' selected row to another Web Part.">
' <InitEventArgs>
' <RowProviderInitEventArgs>
' <Field FieldName="EventDate" FieldDisplayName="Begin" />
' <Field FieldName="LinkTitleNoMenu" FieldDisplayName="Title" />
' <Field FieldName="Description" FieldDisplayName="Description" />
' <Field FieldName="Attachments" FieldDisplayName="Attachments" />
' <Field FieldName="fRecurrence" FieldDisplayName="Recurrence" />
' <Field FieldName="ID" FieldDisplayName="ID" />
' </RowProviderInitEventArgs>
' </InitEventArgs>
' </Interface>
' </Interfaces>
' </InterfaceGroup>
' ...
'
'
private void GetWebPartPageConnectionInfo(string partId)
{
// 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 pageUrl = "http://MyServer/Shared%20Documents/SampleStart.aspx";
string locId = "1033"; //english locale ID
string result = svc.GetWebPartPageConnectionInfo(pageUrl, "", partId, locId);
Console.WriteLine("Result is: \n {0}\n",result);
Console.WriteLine("-----Hit enter-----");
Console.ReadLine();
/* result looks like:
<XML id='MSOConn_Compatibility'>
<ConnDesign>
<ConnectionInfo>
<WebPart WebPartID="01d5caa2-0f7d-4780-88a8-dc09ec6e6518" ConnectionID="00000000-0000-0000-0000-000000000000">
<InterfaceGroups>
<InterfaceGroup GroupName="ListViewRowProvider_WPQ_" GroupMenuLabel="Provide Current Row To" Description="Provides
the currently selected row to another Web Part." MaxConnections="-1" RunAt="Server" AllowCrossPageConnection="True">
<Interfaces>
<Interface Match="True" InterfaceName="ListViewRowProvider_WPQ_" Type="IRowProvider" MenuLabel="Provide Current Row To" Description="Provides the currently selected row to another Web Part.">
<InitEventArgs>
<RowProviderInitEventArgs>
<Field FieldName="EventDate" FieldDisplayName="Begin" />
<Field FieldName="LinkTitleNoMenu" FieldDisplayName="Title" />
<Field FieldName="Description" FieldDisplayName="Description" />
<Field FieldName="Attachments" FieldDisplayName="Attachments" />
<Field FieldName="fRecurrence" FieldDisplayName="Recurrence" />
<Field FieldName="ID" FieldDisplayName="ID" />
</RowProviderInitEventArgs>
</InitEventArgs>
</Interface>
</Interfaces>
</InterfaceGroup>
...
*/
}