VirtualPathExtension VirtualPathExtension VirtualPathExtension VirtualPathExtension Class

Definición

Contiene la ruta de acceso virtual del servicio cuando el servicio se hospeda en IIS (Servicios de Internet Information Server) o WAS (Servicio de activación de procesos de Windows).Contains the service's virtual path when the service is hosted in Internet Information Services (IIS) or Windows Process Activation Service (WAS).

public ref class VirtualPathExtension sealed : System::ServiceModel::IExtension<System::ServiceModel::ServiceHostBase ^>
public sealed class VirtualPathExtension : System.ServiceModel.IExtension<System.ServiceModel.ServiceHostBase>
type VirtualPathExtension = class
    interface IExtension<ServiceHostBase>
Public NotInheritable Class VirtualPathExtension
Implements IExtension(Of ServiceHostBase)
Herencia
VirtualPathExtensionVirtualPathExtensionVirtualPathExtensionVirtualPathExtension
Implementaciones

Ejemplos

El ejemplo siguiente muestra cómo recuperar el VirtualPathExtension del host de servicio y devolver un valor que se hospede en IIS o WAS.The following example shows how to recover the VirtualPathExtension from the service host and return a value that it is hosted in IIS or WAS.

bool isHosted = false;  
ServiceHostBase host = OperationContext.Current.Host;  
VirtualPathExtension vpe = host.Extentions.Find<VirtualPathExtension>();  
  
if( vpe != null )  
Console.WriteLine("The virtualPath of the hosted Service is  {0}", vpe.VirtualPath);  

Comentarios

Esta extensión solo aparece en los servicios alojados en IIS o WAS.This extension is present only for services hosted in IIS or WAS. Los servicios pueden determinar si se hospedan en IIS o WAS recuperando esta extensión de su ServiceHostBase, como se muestra en el ejemplo siguiente.Services can determine whether they are hosted in IIS or WAS by retrieving this extension from their ServiceHostBase, as shown in the following example.

Propiedades

ApplicationVirtualPath ApplicationVirtualPath ApplicationVirtualPath ApplicationVirtualPath

Obtiene la ruta de acceso virtual de la aplicación IIS o WAS que hospeda el servicio de WCF.Gets the virtual path of the IIS or WAS application that hosts the WCF service.

SiteName SiteName SiteName SiteName

Obtiene el nombre del sitio de la aplicación IIS o WAS que hospeda el servicio de WCF.Gets the site name of the IIS or WAS application that hosts the WCF service.

VirtualPath VirtualPath VirtualPath VirtualPath

Obtiene la ruta de acceso virtual usada por un servicio.Gets the virtual path used by a service.

Métodos

Attach(ServiceHostBase) Attach(ServiceHostBase) Attach(ServiceHostBase) Attach(ServiceHostBase)

Este método se proporciona para admitir la infraestructura Windows Communication Foundation (WCF).This method is provided to support the Windows Communication Foundation (WCF) infrastructure.

Detach(ServiceHostBase) Detach(ServiceHostBase) Detach(ServiceHostBase) Detach(ServiceHostBase)

Este método se proporciona para admitir la infraestructura de WCF.This method is provided to support the WCF infrastructure.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a