< Day Day Up > |
TechniqueHosting the remote object in IIS, you just have to write code for the remote object, but you don't have to write a custom server. All that you need is to copy the assembly of the remote object class to the bin directory of the Web application and add the remoting configuration to the ASP.NET configuration file web.config to specify the <wellknown> element within the <service> element. Listing 18.3 shows a configuration file that you can use with IIS. Listing 18.3 web.config to Specify a Remoting Object with IIS<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.runtime.remoting> <application> <service> <wellknown mode="SingleCall" type="_1_RemoteObject.RemoteObject, 1_RemoteObject" objectUri="Demo.soap" /> </service> </application> </system.runtime.remoting> </configuration> CommentsIf you use the facility to host remote objects with IIS, you can only use well-known single-call objects. Because the ASP.NET worker process is recycled, you cannot use a stateful client-activated or a stateful singleton object. The channel that is offered automatically is the HTTP channel with the port that is defined with the IIS configuration. The default port number is port 80. You can change the port number with the IIS configuration. The name of the object must use the extension soap or bin , depending on whether you use the SOAP or binary formatters. These extensions are defined with the ASP.NET configurations. |
< Day Day Up > |