13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

typeof(ServiceSalesProvider),"tcp://192.345.34.1:8082");You can also direct the caller application to read setup <strong>in</strong><strong>for</strong>mation from a configurationfile located <strong>in</strong> the same path as the executable. In this case, the convention is to givethe file the same name as the executable plus a .config extension. You then pass thefile name to the Configure method, as shown here:Remot<strong>in</strong>gConfiguration.Configure("MyClient.exe.config");The follow<strong>in</strong>g script shows the layout of a client configurationfile:As you can see, the differences between the client and the server-side configurationfiles are m<strong>in</strong>imal and are all related to the use of the tag <strong>in</strong>stead of .The server object publishes the list of supported channels, and based on that list, theclient can decide which channel to use. Note that servers must register at least onechannel. Clients are not required to <strong>in</strong>dicate a channel. If a client doesn't <strong>in</strong>dicate achannel, the .<strong>NET</strong> Remot<strong>in</strong>g system uses one of the default channels. On the otherhand, a client that plans to use a given channel must first register with it. Theapplication can run the channel registration procedure personally or let it run by defaultunder the control of the Remot<strong>in</strong>gConfiguration object.Channels are registered on a per-AppDoma<strong>in</strong> basis and must have unique names <strong>in</strong>that context. On physical mach<strong>in</strong>es, however, only one channel can listen to a givenport. In other words, at any time you can't have more than one channel registered towork on a given port on a given mach<strong>in</strong>e.A client enabled to make remote calls on a remote object simply creates an <strong>in</strong>stance ofthe desired class us<strong>in</strong>g the language-specific operator <strong>for</strong> <strong>in</strong>stantiation—new <strong>in</strong> C# andVisual Basic. Alternatively, the client can use the System.Activator object—a managedcounterpart of the VBScript CreateObject and GetObject functions.448

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!