Re: IIS hosting remote object

From: Sam Santiago (ssantiago_at_n0spam-SoftiTechture.com)
Date: 10/17/04

  • Next message: Sam Santiago: "Re: CAO Factory and Threading"
    Date: Sun, 17 Oct 2004 09:57:01 -0700
    
    

    Check out this article for help on a simple example:

    HOW TO: Host a Remote Object in Microsoft Internet Information Services
    http://support.microsoft.com/default.aspx?scid=312107

    Thanks,

    Sam

    -- 
    _______________________________
    Sam Santiago
    ssantiago@n0spam-SoftiTechture.com
    http://www.SoftiTechture.com
    _______________________________
    "Greg via .NET 247" <anonymous@dotnet247.com> wrote in message
    news:%23hkaRHDtEHA.2788@TK2MSFTNGP09.phx.gbl...
    > I have been successful using TCP protocol and a console exe for a host but
    I can't get an IIS host version to work.
    >
    > I have a common DLL containing interfaces:
    >
    > namespace Common
    > {
    > public interface IClock
    > {
    > string WhatTimeIsIt();
    > }
    > }
    >
    > My remote object implements this interface:
    >
    > public class Clock : MarshalByRefObject, IClock
    > {
    > public Clock()
    > {
    > //
    > // TODO: Add constructor logic here
    > //
    > }
    >
    > #region IClock Members
    >
    > public string WhatTimeIsIt()
    > {
    > try
    > {
    > return DateTime.Now.ToLongTimeString();
    > }
    > catch (Exception e)
    > {
    > EventLog.WriteEntry("RemoteClock", e.Message, EventLogEntryType.Error);
    > }
    >
    > return string.Empty;
    > }
    >
    > I created a folder on my web server C:\Inetpub\wwwroot\RemoteClock and
    copied a config file "web.config" into it:
    > <configuration>
    >     <system.runtime.remoting>
    >         <application>
    >             <channels>
    >                 <channel ref="http" />
    >             </channels>
    >             <service>
    >                 <wellknown mode="SingleCall" type="RemoteClock.Clock,
    RemoteClock"
    >     objectUri="Clock.soap" />
    >             </service>
    >         </application>
    >     </system.runtime.remoting>
    > </configuration>
    >
    > In a bin folder off this root folder I copied my Common.dll and
    RemoteClock.dll. In IIS, I created a virtual directory called "ServerClock"
    which points to the above root directory.
    >
    > My client is a simple console app:
    >
    > class Client
    > {
    > /// <summary>
    > /// The main entry point for the application.
    > /// </summary>
    > [STAThread]
    > static void Main(string[] args)
    > {
    > try
    > {
    > ChannelServices.RegisterChannel(new HttpChannel());
    > IClock clock = (IClock)Activator.GetObject(typeof(IClock),
    "http://WebServer:80/ServerClock/Clock.soap");
    > Console.WriteLine("The current server time is: " + clock.WhatTimeIsIt());
    > }
    > catch (Exception e)
    > {
    > Console.WriteLine("Exception occurred: Source: " + e.Source + "\n\r" +
    e.Message + e.StackTrace);
    > }
    >
    > Console.Read();
    > }
    > }
    >
    > NOTE: I replaced my actual web server name with "WebServer" in the url.
    >
    > When I execute the client app, I get the following exception:
    >
    > Exception occurred: Source: mscorlib
    > Server encountered an internal error. To get more info turn on
    customErrors in t
    > he server's config file.
    >
    > Server stack trace:
    >
    >
    > Exception rethrown at [0]:
    >    at
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
    > Msg, IMessage retMsg)
    >    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
    msgDa
    > ta, Int32 type)
    >    at Common.IClock.WhatTimeIsIt()
    >    at Client.Client.Main(String[] args) in c:\source\client\client.cs:line
    25
    > --------------------------------
    >
    > Any ideas?
    >
    > Thanks!
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>5xYkLSU/80OjtYF0yrB76g==</Id>
    

  • Next message: Sam Santiago: "Re: CAO Factory and Threading"

    Relevant Pages

    • RE: Trouble deploying ASP.NET application
      ... XML files for some bizare reason I thought I could just put the file name ... only when I deployed it to the host. ... > Tried both FTP and frontpage extensions method to the host server. ... An unhandled exception occurred during the execution of the ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: IIS Out-of-Process Component services application crashes
      ... When I host the component in windows 2003 ... But when I host in win 2000 server, ... > The system has called a custom component and that component has failed ... > and generated an exception. ...
      (microsoft.public.inetserver.iis)
    • Re: Unable to send email from local server
      ... But I get an exception back. ... The mail client software was unable to connect to the mail server ... you have a firewall blocking your host from connecting to a remote host on ...
      (comp.lang.java.programmer)
    • gdm hangs
      ... gdm will hang 9 of 10 times when logging out. ... with or without the client having been connected to the Server. ... # Timed login, useful for kiosks. ... Must output the chosen host on stdout, ...
      (Debian-User)
    • problem with sendmail in solaris 9
      ... names that should be exposed as from this host, ... # save Unix-style "From_" lines at top of header? ... # work recipient factor ... # SMTP STARTTLS server options ...
      (SunManagers)