We need setup Server project assembly in IIS.
Step 1: Go to the primary web root directory
C:\Inetpub\wwwroot and create a new folder named Server.
Step 2: Inside folder Server, create a new folder named bin.
Now, move to your project Debug directory (IServer\Server\bin\Debug). Copy all
files from here and place them into \wwwroot\Server\bin.
At this point the wwwroot\Server\bin directory may have the following
files:
Figure 1: File structure in \server\bin folder in
web root directory
Step 3: We need a web config to enable the assembly to work
as remote objects. Create a file web.config in the \Server folder. Open
web.config in notepad and add the following content in it.
Listing 3: Content of web.config for server in IIS
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton" type="Server.clsServer,Server"
objectUri="server.soap" />
</service>
<channels>
<channel ref="http" />
<serverProviders>
<formatter href="binary" />
</serverProviders>
</channels>
</application>
</system.runtime.remoting>
</configuration>
Save web.config file. At this point the wwwroot\Server\
directory may look like:
Figure 2: File structure in \server folder in web
root directory
Step 4: We need setup Server folder as a virtual directory
in IIS. Open the IIS window as: Control Panel >> Administrative Tools
>> Internet Information Services.
Expand the node to reach to the folder Server: Local
computer >> Web Sites >> Default Web Site >> Server.
Right click on COMAppASPClient and open the properties
window.
Figure 3: Choosing properties option for the
directory of ASP page
Click "Create" button in the application name tag.
This makes the directory a virtual directory.
Figure 4: Creating the server folder to be a
virtual directory
Click OK to finish with the IIS Server properties window.
Here the remote object is installed. Let us test whether it is successfully
installed. Open an internet explorer window and write the following in URL (use
server name/ip instead of localhost if remote server is installed on other
machine in LAN/WAN).
http://localhost/server/server.soap?wsdl
Opening this link would show information in XML format about
implemented remote methods on the page as given below.
Figure 5: Get the description of remote object
services in XML format
If you get the XML output on the page about the remote
service then you could be sure that remote server object is installed in IIS
correctly. Now we can proceed to create a web client which consumes these
services.