Exam 70-554 - Create and configure a server application.

Section 1

Create and configure a server application.

  • Create a server application domain.
  • Configure a server application programmatically.
  • Configure a server application by using configuration files.
  • Compile and build a server application.

Summary

Basically an application domain is the isolated space where an application exists. Its storage and memory allocation are completely separated from other applications. The problem with distributed applications is that because of this isolation it becomes difficult for applications to pass information between application domains. Web Services and remoting are two of the answers to this problem. With remoting, you are passing special Remoting Types between app domains so that two applications can talk to each other. In this relationship one of the applications must serve as the remoting server and the other as the remoting client. The application boundaries can be on the same machine, on different machines, even in different networks.

To create the server environment to support remoting you must do two things: Choose and Register a channel, which is either a tcp port with binary formatting or http with SOAP formatting, and Register your type with the .Net Remoting system. Server or Listner Applications can be any type of application: a form app, a web app or a windows service. The application must be running in order to receive requests.

The server environment can be configured either programmatically or through configuration.

To register the remoting type and channel programmatically, you must register a channel and then the type.The following sample code from msdn for registering a type and a channel from msdn is below:

TcpChannel chan = new TcpChannel(8085);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType
(Type.GetType("RemotingSamples.HelloServer,object"),
"SayHello", WellKnownObjectMode.SingleCall);

To register the remoting type and channel through configuration simply call the RemotingConfiguration.Configure method passing in the name/path to the configuration file. A sample configuration file from msdn is below:

<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="Singleton"
type="RemotableType, RemotableType"
objectUri="RemotableType.rem"
/>
</service>
<channels>
<channel ref="http" port="8989"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

Other Resources & Links:

.Net Remoting Overview
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconnetremotingoverview.asp

Application Domains Overview
http://msdn2.microsoft.com/en-us/library(d=robot)/2bh4z9hs.aspx

Building a Host Application
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconbuildinghostapplication.asp

An Introduction to Microsoft .Net Remoting Framework
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/introremoting.asp

Exam 70-554 - Create a client application to access a remote object.

Exam 70-554 - Configuring and Customizing a Web Service Application Configure SOAP messages.