HttpSysServerChannel Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for RemObjects SDK for .NET
This page is generated from external data, please do not update

NamespacesInterfacesClassesEnumsImplements

Contents

Overview

This is a simple HTTP server channel. It is based on http.sys and the .NET wrapper classes. http.sys is a kernel level HTTP stack provided by Microsoft, available in Windows starting from XP SP2. It provides the basic HTTP functionality for IIS on these systems, and has several advantages:

  • The bulk of the core HTTP processing is done on kernel level, which makes it faster and more reliable.
  • It allows RO standalone .exe servers to benefit of all the work and finetuning Microsoft puts into this kernel driver, without needing to run (or even install) IIS itself.
  • It lets your RO standalone .exe server share the same port with IIS (or other services using http.sys, such as SQL Server 2005), simply by providing a unique domain name. Similar to how IIS allows you to set up virtual sites on the same ip/port combination by using HTTP/1.1's Host field, RO servers can now participate in this. You can for example have IIS listening on http://www.yourdomain.com, and your standalone RO server on http://services.yourdomain.com on the same IP address. http.sys will automatically direct each request to the proper server application.

To set up the channel, open the Bindings property editor and specify one or more hostname/port combinations. Make sure they do not conflict with any you have set up in IIS (for example, you cannot use the same host and port in both). Also remember that this channel requires XPSP2 or a newer operating system.

In addition to sharing a port/ip combo with IIS or other servers provided by Microsoft, you can of course also use it to run several independent RO servers on different domain names on the same server.


Warning: The application using this server channel must be launched with administrative privileges. Otherwise servicing requests from outside the local host is impossible due to Microsoft's restrictions.

Note: You can use SSL encryption with this channel. For more details, see the RemObjects SDK FAQ.


Location


Constants

DEFAULT_SERVER_NAME   protected     (declared in HttpServerChannel)



Oxygene:   const DEFAULT_SERVER_NAME: String
C#:   const String DEFAULT_SERVER_NAME
VB:   Dim DEFAULT_SERVER_NAME As String


Properties

Active     (declared in ServerChannel)

Toggles whether the server component is active or not. Set it to true (either from code or in the Property Pane) to have your server active and listening for requests from clients or set it to false to prevent new requests from being accepted.



Prism:   property Active: Boolean read write
C#:   Boolean Active { get; set; }
VB:   Property Active As Boolean


Bindings

Collection of HttpSysBinding instances. Each HttpSysBinding defines the domain name/port pair the server channel should listen to.

Note: After a channel is opened, you can still change any available properties of HttpSysBinding instances, but these changes will not take effect until the server channel is reopened.



Prism:   property Bindings: List<HttpSysBinding> read
C#:   List<HttpSysBinding> Bindings { get; }
VB:   Property ReadOnly Bindings As List<HttpSysBinding>


ChannelType     (declared in HttpServerChannel)

Returns 'http'. This property is used by the ZeroConf infrastructure.



Prism:   property ChannelType: String read
C#:   String ChannelType { get; }
VB:   Property ReadOnly ChannelType As String


CustomParameters     (declared in ServerChannel)



Prism:   property CustomParameters: Dictionary<String,String> read
C#:   Dictionary<String,String> CustomParameters { get; }
VB:   Property ReadOnly CustomParameters As Dictionary<String,String>


Dispatchers     (declared in ServerChannel)

Organizes the different Dispatchers configured for the server. Depending on the server type, different dispatchers can be made accessible through different names (for example the HTTP based servers use the Path provided with the HTTP request to determine the dispatcher) or the dispatcher marked as Default will be used. Note: A design time editor for the Dispatcher collection is provided in the IDE, which you can invoke by clicking the ellipsis (...) button in the Properties Pane. You can use this editor to create new MessageDispatcher instances at design time and link them to the specific message components you have dropped onto your form.



Prism:   property Dispatchers: MessageDispatchers read
C#:   MessageDispatchers Dispatchers { get; }
VB:   Property ReadOnly Dispatchers As MessageDispatchers


ExtendedDispatchers     (declared in HttpServerChannel)



Prism:   property ExtendedDispatchers: ExtendedDispatcherList read
C#:   ExtendedDispatcherList ExtendedDispatchers { get; }
VB:   Property ReadOnly ExtendedDispatchers As ExtendedDispatcherList


HasAfterReceiveStream   protected     (declared in Channel)



Prism:   property HasAfterReceiveStream: Boolean read
C#:   Boolean HasAfterReceiveStream { get; }
VB:   Property ReadOnly HasAfterReceiveStream As Boolean


HasBeforeSendStream   protected     (declared in Channel)



Prism:   property HasBeforeSendStream: Boolean read
C#:   Boolean HasBeforeSendStream { get; }
VB:   Property ReadOnly HasBeforeSendStream As Boolean


Initializing   protected     (declared in ServerChannel)



Prism:   property Initializing: Boolean read
C#:   Boolean Initializing { get; }
VB:   Property ReadOnly Initializing As Boolean


Listener

The underlying HttpListener object that is used by server channel. You can use this property to finetune HttpListener properties.



Prism:   property Listener: HttpListener read
C#:   HttpListener Listener { get; }
VB:   Property ReadOnly Listener As HttpListener


Messages     (declared in ServerChannel)



Prism:   property Messages: List<String> read
C#:   List<String> Messages { get; }
VB:   Property ReadOnly Messages As List<String>


SecurityOptions     (declared in HttpServerChannel)

Gives access to server security options of this server channel instance. Using this property, you can set up MaxRequestSize, MaxRequestTime etc.



Prism:   property SecurityOptions: ServerSecurityOptions read
C#:   ServerSecurityOptions SecurityOptions { get; }
VB:   Property ReadOnly SecurityOptions As ServerSecurityOptions


SendClientAccessPolicyXml     (declared in HttpServerChannel)

Determines how the server channel should handle requests for clientaccesspolicy.xml (security policy file used by Silverlight). Can be set to:

  • AllowNone (deny all requests).
  • AllowAll (allow all requests).
  • Custom (provides a custom security policy file via OnCustomClientAccessPolicy event handler).



Prism:   property SendClientAccessPolicyXml: ClientAccessPolicyType read write
C#:   ClientAccessPolicyType SendClientAccessPolicyXml { get; set; }
VB:   Property SendClientAccessPolicyXml As ClientAccessPolicyType


SendCrossOriginHeader     (declared in HttpServerChannel)



Prism:   property SendCrossOriginHeader: Boolean read write
C#:   Boolean SendCrossOriginHeader { get; set; }
VB:   Property SendCrossOriginHeader As Boolean


SendExceptionsAs500     (declared in HttpServerChannel)

If set to true, messages about exceptions occurred on the server will be sent with a HTTP Error 500 header set (standard HTTP header for internal server errors).



Prism:   property SendExceptionsAs500: Boolean read write
C#:   Boolean SendExceptionsAs500 { get; set; }
VB:   Property SendExceptionsAs500 As Boolean


ServeInfoPage     (declared in HttpServerChannel)

Determines if the server info page should be served or not

HtmlServerInfoPage.png



Prism:   property ServeInfoPage: Boolean read write
C#:   Boolean ServeInfoPage { get; set; }
VB:   Property ServeInfoPage As Boolean


ServerName

The server name, which is exposed via HTTP response's header properties.



Prism:   property ServerName: String read write
C#:   String ServerName { get; set; }
VB:   Property ServerName As String


ServeRodl     (declared in ServerChannel)

Toggles whether clients can request the RODL file for this server via IRodlAccess or channel-specific means (such as by submitting a HTTP GET request to an HTTP server). By default, this option is turned on; set this property to false if you want to prevent clients from retrieving the RODL file from the server.



Prism:   property ServeRodl: Boolean read write
C#:   Boolean ServeRodl { get; set; }
VB:   Property ServeRodl As Boolean


Instance Methods

constructor ()

Creates a new instance of the HttpSysServerChannel class.


Oxygene:   constructor
C#:   constructor()
VB:   Sub New


constructor (Boolean)   protected     (declared in HttpServerChannel)



Oxygene:   constructor(allowMultipleDispatchers: Boolean)
C#:   constructor(Boolean allowMultipleDispatchers)
VB:   Sub New (allowMultipleDispatchers As Boolean)


Parameters:

  • allowMultipleDispatchers:


constructor (IContainer)



Oxygene:   constructor(container: IContainer)
C#:   constructor(IContainer container)
VB:   Sub New (container As IContainer)


Parameters:

  • container:


Activate     (declared in ServerChannel)

Alias for the Open method.


Oxygene:   method Activate
C#:   void Activate()
VB:   Sub Activate


Close     (declared in ServerChannel)

Closes the ServerChannel component and stops it from accepting any more incoming requests.


Oxygene:   method Close
C#:   void Close()
VB:   Sub Close


CopyProperties   protected     (declared in Channel)



Oxygene:   method CopyProperties(source: Channel)
C#:   void CopyProperties(Channel source)
VB:   Sub CopyProperties(source As Channel)


Parameters:

  • source:


Deactivate     (declared in ServerChannel)

Alias for the Close method.


Oxygene:   method Deactivate
C#:   void Deactivate()
VB:   Sub Deactivate


Dispatch   protected     (declared in ServerChannel)



Oxygene:   method Dispatch(message: IMessage; channelInfo: IServerChannelInfo)
C#:   void Dispatch(IMessage message, IServerChannelInfo channelInfo)
VB:   Sub Dispatch(message As IMessage, channelInfo As IServerChannelInfo)


Parameters:

  • message:
  • channelInfo:


Dispose   protected     (declared in HttpServerChannel)



Oxygene:   method Dispose(disposing: Boolean)
C#:   void Dispose(Boolean disposing)
VB:   Sub Dispose(disposing As Boolean)


Parameters:

  • disposing:


DoClose   protected

This method cannot be called directly.

This method is called when the channel is closed. It performs cleanup actions for the server channel.


Oxygene:   method DoClose
C#:   void DoClose()
VB:   Sub DoClose


DoEndInit   protected     (declared in ServerChannel)



Oxygene:   method DoEndInit
C#:   void DoEndInit()
VB:   Sub DoEndInit


DoOpen   protected

This method cannot be called directly.

It is called when the server channel is open and performs initialization actions for the server channel.


Oxygene:   method DoOpen
C#:   void DoOpen()
VB:   Sub DoOpen


Open     (declared in ServerChannel)

Opens the ServerChannel component and starts accepting incoming requests. Depending on the server type, this usually involves starting to listen on a network socket or polling some source for waiting messages.


Oxygene:   method Open
C#:   void Open()
VB:   Sub Open


ProcessRequest

This is basically the core of the entire server channel. This method processes incoming HTTP requests and performs requested actions (service method call, RODL request etc).


Oxygene:   method ProcessRequest(context: HttpListenerContext)
C#:   void ProcessRequest(HttpListenerContext context)
VB:   Sub ProcessRequest(context As HttpListenerContext)


Parameters:

  • context:


Register     (declared in HttpServerChannel)



Oxygene:   method Register(dispatcher: IHttpDispatcher)
C#:   void Register(IHttpDispatcher dispatcher)
VB:   Sub Register(dispatcher As IHttpDispatcher)


Parameters:

  • dispatcher:


StartListening     (declared in ServerChannel)

Alias for the Open method.


Oxygene:   method StartListening
C#:   void StartListening()
VB:   Sub StartListening


StopListening     (declared in ServerChannel)

Alias for the Close method.


Oxygene:   method StopListening
C#:   void StopListening()
VB:   Sub StopListening


TriggerAfterClose   protected     (declared in ServerChannel)



Oxygene:   method TriggerAfterClose
C#:   void TriggerAfterClose()
VB:   Sub TriggerAfterClose


TriggerAfterOpen   protected     (declared in ServerChannel)



Oxygene:   method TriggerAfterOpen
C#:   void TriggerAfterOpen()
VB:   Sub TriggerAfterOpen


TriggerAfterReceiveStream   protected     (declared in Channel)



Oxygene:   method TriggerAfterReceiveStream(var stream: Stream)
C#:   void TriggerAfterReceiveStream(ref Stream stream)
VB:   Sub TriggerAfterReceiveStream(ByRef stream As Stream)


Parameters:

  • stream:


TriggerBeforeClose   protected     (declared in ServerChannel)



Oxygene:   method TriggerBeforeClose
C#:   void TriggerBeforeClose()
VB:   Sub TriggerBeforeClose


TriggerBeforeOpen   protected     (declared in ServerChannel)



Oxygene:   method TriggerBeforeOpen
C#:   void TriggerBeforeOpen()
VB:   Sub TriggerBeforeOpen


TriggerBeforeSendStream   protected     (declared in Channel)



Oxygene:   method TriggerBeforeSendStream(var stream: Stream)
C#:   void TriggerBeforeSendStream(ref Stream stream)
VB:   Sub TriggerBeforeSendStream(ByRef stream As Stream)


Parameters:

  • stream:


TriggerOnAdjustConvertedRodl   protected

Calls the OnAdjustConvertedRodl event handler (see below) with provided aContext and aRodlStream.

Note: This method sets the position within the provided RODL stream to the beginning.


Oxygene:   method TriggerOnAdjustConvertedRodl(context: HttpListenerContext; var rodlStream: Stream)
C#:   void TriggerOnAdjustConvertedRodl(HttpListenerContext context, ref Stream rodlStream)
VB:   Sub TriggerOnAdjustConvertedRodl(context As HttpListenerContext, ByRef rodlStream As Stream)


Parameters:

  • context:
  • rodlStream:


TriggerOnAdjustRodl   protected

Calls the OnAdjustRodl event handler (see below) with provided aContext and aRodlStream.

Note: This method sets the position within the provided RODL stream to the beginning.


Oxygene:   method TriggerOnAdjustRodl(context: HttpListenerContext; var rodlStream: Stream)
C#:   void TriggerOnAdjustRodl(HttpListenerContext context, ref Stream rodlStream)
VB:   Sub TriggerOnAdjustRodl(context As HttpListenerContext, ByRef rodlStream As Stream)


Parameters:

  • context:
  • rodlStream:


TriggerOnCustomClientAccessPolicy   protected     (declared in HttpServerChannel)

Fires the OnCustomClientAccessPolicy event and returns the security policy file generated by its handler (via aPolicyContent parameter). Can be called only from the ancestor class.


Oxygene:   method TriggerOnCustomClientAccessPolicy(var policyContent: String)
C#:   void TriggerOnCustomClientAccessPolicy(ref String policyContent)
VB:   Sub TriggerOnCustomClientAccessPolicy(ByRef policyContent As String)


Parameters:

  • policyContent:


TriggerOnCustomCrossOrigin   protected     (declared in HttpServerChannel)



Oxygene:   method TriggerOnCustomCrossOrigin(e: CustomCrossOriginEventArgs)
C#:   void TriggerOnCustomCrossOrigin(CustomCrossOriginEventArgs e)
VB:   Sub TriggerOnCustomCrossOrigin(e As CustomCrossOriginEventArgs)


Parameters:

  • e:


TriggerOnGetRodl   protected

Calls the OnGetRodl event handler (see below) with provided aContext and aRodlStream.


Oxygene:   method TriggerOnGetRodl(context: HttpListenerContext; var rodlStream: Stream)
C#:   void TriggerOnGetRodl(HttpListenerContext context, ref Stream rodlStream)
VB:   Sub TriggerOnGetRodl(context As HttpListenerContext, ByRef rodlStream As Stream)


Parameters:

  • context:
  • rodlStream:


Unregister     (declared in HttpServerChannel)



Oxygene:   method Unregister(dispatcher: IHttpDispatcher)
C#:   void Unregister(IHttpDispatcher dispatcher)
VB:   Sub Unregister(dispatcher As IHttpDispatcher)


Parameters:

  • dispatcher:


Events

AfterClose     (declared in ServerChannel)



Oxygene:   event AfterClose: EventHandler
C#:   event EventHandler AfterClose
VB:   Event AfterClose As EventHandler


AfterOpen     (declared in ServerChannel)



Oxygene:   event AfterOpen: EventHandler
C#:   event EventHandler AfterOpen
VB:   Event AfterOpen As EventHandler


AfterReceiveStream     (declared in Channel)

This event is triggered by client and server channels directly after a request or response stream has been received and before the stream gets parsed into a message. User code can assign handlers to this event to process, inspect or modify incoming messages, before they get handled by the RemObjects SDK framework. The passed Stream is a MemoryStream and may be modified.

If no handlers are assigned to the AfterReceiveStream event, the message will load the data directly from the incoming medium (usually the network stream); assigning event handlers to AfterReceiveStream will induce a slight overhead as the data will first be copied into a local memory buffer for the event handler. This should not have any noticeably effect except for very large messages or on resource-limited systems such as Compact Framework Clients, but if utmost performance is important, take this note into consideration.



Oxygene:   event AfterReceiveStream: StreamEventHandler
delegate: method Invoke(sender: Object; e: StreamEventArgs)

C#:   event StreamEventHandler AfterReceiveStream
delegate: void Invoke(Object sender, StreamEventArgs e)

VB:   Event AfterReceiveStream As StreamEventHandler
delegate: Sub Invoke(sender As Object, e As StreamEventArgs)


BeforeClose     (declared in ServerChannel)



Oxygene:   event BeforeClose: EventHandler
C#:   event EventHandler BeforeClose
VB:   Event BeforeClose As EventHandler


BeforeOpen     (declared in ServerChannel)



Oxygene:   event BeforeOpen: EventHandler
C#:   event EventHandler BeforeOpen
VB:   Event BeforeOpen As EventHandler


BeforeSendStream     (declared in Channel)

This event is triggered by client and server channels directly before a request or response stream will be sent over the network. User code can assign handlers to this event to process, inspect or modify incoming messages before they get sent out to the remote system.

The passed Stream is a MemoryStream and may be modified.



Oxygene:   event BeforeSendStream: StreamEventHandler
delegate: method Invoke(sender: Object; e: StreamEventArgs)

C#:   event StreamEventHandler BeforeSendStream
delegate: void Invoke(Object sender, StreamEventArgs e)

VB:   Event BeforeSendStream As StreamEventHandler
delegate: Sub Invoke(sender As Object, e As StreamEventArgs)


OnAdjustConvertedRodl

This event is fired only if a RODL is requested via MessageDispathes which supports IRodlConverter (f.e. SoapMessage). It is fired after the RODL is converted via the IRodlConverter interface (in case of SoapMessage this means after the RODL was converted to the corresponding WSDL).



Oxygene:   event OnAdjustConvertedRodl: OnHttpSysAdjustRodlHandler
delegate: method Invoke(sender: Object; context: HttpListenerContext; var rodlStream: Stream)

C#:   event OnHttpSysAdjustRodlHandler OnAdjustConvertedRodl
delegate: void Invoke(Object sender, HttpListenerContext context, ref Stream rodlStream)

VB:   Event OnAdjustConvertedRodl As OnHttpSysAdjustRodlHandler
delegate: Sub Invoke(sender As Object, context As HttpListenerContext, ByRef rodlStream As Stream)


OnAdjustRodl

This event is fired after the service RODL is acquired. It can be used to adjust the acquired RODL.



Oxygene:   event OnAdjustRodl: OnHttpSysAdjustRodlHandler
delegate: method Invoke(sender: Object; context: HttpListenerContext; var rodlStream: Stream)

C#:   event OnHttpSysAdjustRodlHandler OnAdjustRodl
delegate: void Invoke(Object sender, HttpListenerContext context, ref Stream rodlStream)

VB:   Event OnAdjustRodl As OnHttpSysAdjustRodlHandler
delegate: Sub Invoke(sender As Object, context As HttpListenerContext, ByRef rodlStream As Stream)


OnCustomClientAccessPolicy     (declared in HttpServerChannel)

This event is fired when SendClientAccessPolicyXml is set to Custom. Allows more precise management of client access policies.

The handler of this event generates a valid ClientAccessPolicy.xml and puts it to the aPolicyContent parameter.



Oxygene:   event OnCustomClientAccessPolicy: OnCustomClientAccessPolicyHandler
delegate: method Invoke(sender: Object; var policyContent: String)

C#:   event OnCustomClientAccessPolicyHandler OnCustomClientAccessPolicy
delegate: void Invoke(Object sender, ref String policyContent)

VB:   Event OnCustomClientAccessPolicy As OnCustomClientAccessPolicyHandler
delegate: Sub Invoke(sender As Object, ByRef policyContent As String)


OnCustomCrossOrigin     (declared in HttpServerChannel)



Oxygene:   event OnCustomCrossOrigin: EventHandler<CustomCrossOriginEventArgs>
C#:   event EventHandler<CustomCrossOriginEventArgs> OnCustomCrossOrigin
VB:   Event OnCustomCrossOrigin As EventHandler<CustomCrossOriginEventArgs>


OnGetRodl

This event is fired when a service RODL is requested. It can be used to provide different RODL based on internal server logic, provided HttpListenerContext etc.

If aRodlStream is not null after the event handler finishes its work, it is used as service RODL.



Oxygene:   event OnGetRodl: OnHttpSysAdjustRodlHandler
delegate: method Invoke(sender: Object; context: HttpListenerContext; var rodlStream: Stream)

C#:   event OnHttpSysAdjustRodlHandler OnGetRodl
delegate: void Invoke(Object sender, HttpListenerContext context, ref Stream rodlStream)

VB:   Event OnGetRodl As OnHttpSysAdjustRodlHandler
delegate: Sub Invoke(sender As Object, context As HttpListenerContext, ByRef rodlStream As Stream)


OnHttpRequest

This event is fired when any HTTP request is received by the server, f.e. for ClientAccessPolicy.xml, RODL or the ServerInfo page. The Relativity server, for example, uses this event to server custom ServerInfo page.

Note: If a handler is assigned to this event, it will be used to handle all HTTP requests instead of requesting a handling method implemented in the HttpSysServerChannel class.



Oxygene:   event OnHttpRequest: OnHttpSysHttpRequestHandler
delegate: method Invoke(sender: Object; context: HttpListenerContext)

C#:   event OnHttpSysHttpRequestHandler OnHttpRequest
delegate: void Invoke(Object sender, HttpListenerContext context)

VB:   Event OnHttpRequest As OnHttpSysHttpRequestHandler
delegate: Sub Invoke(sender As Object, context As HttpListenerContext)


See Also


Product: RemObjects SDK
Available Editions: RemObjects SDK for .NET, Xcode, Delphi, Java and JavaScript

GlossaryArticlesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox