共用方式為


IServiceProxyAdministration interface

系統管理支援建立及連線至遠端服務應用程式的 proxy。

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Interface IServiceProxyAdministration
'用途
Dim instance As IServiceProxyAdministration
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public interface IServiceProxyAdministration

備註

在這個範例中, SampleWebServiceProxy繼承自SPIisWebServiceProxy ,並實作IServiceProxyAdministration介面。

    using Microsoft.SharePoint.Administration;

    [Guid("470DC8EA-77FB-4623-87F7-3237E2B21B02")]
    [SupportedServiceApplication("1D14CB15-2DB1-4395-B187-70355C829630", "1.0.0.0", typeof(SampleWebServiceApplicationProxy))]
    internal sealed class SampleWebServiceProxy : SPIisWebServiceProxy, IServiceProxyAdministration
    {
    Imports Microsoft.SharePoint.Administration

    <Guid("470DC8EA-77FB-4623-87F7-3237E2B21B02"), SupportedServiceApplication("1D14CB15-2DB1-4395-B187-70355C829630", "1.0.0.0", GetType(SampleWebServiceApplicationProxy))> _
    Friend NotInheritable Class SampleWebServiceProxy
        Inherits SPIisWebServiceProxy
        Implements IServiceProxyAdministration

實作IServiceProxyAdministration以支援使用 「 連線 」 按鈕在功能區的 [服務應用程式管理] 頁面上的遠端伺服器陣列中的服務應用程式的連線。

IServiceProxyAdministration需要GetProxyTypes、 GetProxyDescription和CreateProxy方法來實作。

        #region IServiceProxyAdministration Members
        public Type[] GetProxyTypes()
        {
            return new Type[] { typeof(SampleWebServiceApplicationProxy) };
        }
        public SPPersistedTypeDescription GetProxyTypeDescription(
            Type serviceApplicationProxyType)
        {
            return new SPPersistedTypeDescription(
                "Sample Web Service Proxy",
                "Connects to the Sample Web Service.");
        }
        public SPServiceApplicationProxy CreateProxy(
            Type serviceApplicationProxyType,
            string name,
            Uri serviceApplicationUri,
            SPServiceProvisioningContext provisioningContext)
        {
            // Create a proxy for the specified (typically remote) service application
            return new SampleWebServiceApplicationProxy(
                name,
                this,
                serviceApplicationUri);
        }
        #endregion
                #Region "IServiceProxyAdministration Members"
                Public Function GetProxyTypes() As Type()
                        Return New Type() { GetType(SampleWebServiceApplicationProxy) }
                End Function
                Public Function GetProxyTypeDescription(ByVal serviceApplicationProxyType As Type) As SPPersistedTypeDescription
                        Return New SPPersistedTypeDescription("Sample Web Service Proxy", "Connects to the Sample Web Service.")
                End Function
                Public Function CreateProxy(ByVal serviceApplicationProxyType As Type, ByVal name As String, ByVal serviceApplicationUri As Uri, ByVal provisioningContext As SPServiceProvisioningContext) As SPServiceApplicationProxy
                        ' Create a proxy for the specified (typically remote) service application
                        Return New SampleWebServiceApplicationProxy(name, Me, serviceApplicationUri)
                End Function
                #End Region

請參閱

參照

IServiceProxyAdministration members

Microsoft.SharePoint.Administration namespace