WebScriptServiceHostFactory Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Automatically adds an ASP.NET AJAX endpoint to a service, without requiring configuration, in a managed hosting environment that dynamically activates host instances for the service in response to incoming messages.
public ref class WebScriptServiceHostFactory : System::ServiceModel::Activation::ServiceHostFactory
public class WebScriptServiceHostFactory : System.ServiceModel.Activation.ServiceHostFactory
type WebScriptServiceHostFactory = class
inherit ServiceHostFactory
Public Class WebScriptServiceHostFactory
Inherits ServiceHostFactory
- Inheritance
Specify the WebScriptServiceHostFactory for the value of the Factory
attribute in the @ServiceHost directive to activate an ASP.NET AJAX endpoint for the MyService
service as shown in the following example.
<% @ServiceHost
Service="MyService"
Language="C#"
Debug="true"
Factory="WebScriptServiceHostFactory"
%>
This factory provides a way to add an ASP.NET AJAX endpoint to a service without requiring configuration. The endpoint is added to any other endpoints that are defined in configuration, if any. The managed hosting environments that support this type of dynamic host activation are Internet Information Services (IIS) and Windows Process Activation Services (WAS).
To use this factory, specify the WebScriptServiceHostFactory in the Factory
attribute of the @ServiceHost directive.
The ASP.NET AJAX endpoint created by this factory is configured with the WebHttpBinding and the WebScriptEnablingBehavior, with all the default settings. The endpoint is created at an empty address relative to the .svc file. If service configuration already defines an endpoint at this address, an InvalidOperationException is thrown and the service fails to start.
Web |
Initializes a new instance of the WebScriptServiceHostFactory class. |
Create |
Creates a ServiceHost with specific base addresses and initializes it with specified data. (Inherited from ServiceHostFactory) |
Create |
Creates a derived class of ServiceHost for a specified type of service with a specific base address that can be used to automatically enable ASP.NET AJAX endpoints in certain scenarios. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Product | Versions |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: