IServiceProxyAdministration 接口

用于创建和连接到远程服务应用程序代理服务器的管理支持。

命名空间:  Microsoft.SharePoint.Administration
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<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

备注

在此示例中, SampleWebServiceProxySPIisWebServiceProxy将继承并实现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 成员

Microsoft.SharePoint.Administration 命名空间