18.7 Hosting Remotable Types with IIS

 <  Day Day Up  >  

You want to use IIS as a hosting server for the remoting objects.


Technique

Hosting 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> 

Comments

If 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  >  


Microsoft Visual C# .Net 2003
Microsoft Visual C *. NET 2003 development skills Daquan
ISBN: 7508427505
EAN: 2147483647
Year: 2003
Pages: 440

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net