[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Sam Santiago

9/10/2004 4:45:00 PM

You might want to review this article:

Remoting Example: Hosting in IIS
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconremotingexamplehostin...

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"Naeem Hassan Dad" <Naeem Hassan Dad@discussions.microsoft.com> wrote in
message news:E35AD241-B6CE-4FF9-A7F3-D897D31E72EA@microsoft.com...
> Hello
> I am really fed up by the following simple problem. I write a
> interface IPlyer and produce RemotingLibrary.dll. I Implement this
Interface
> using MyRemote class which is also a Remote Object and it produce
> RemoteServer.dll.
> I create a virtual directory named Test and copy these dlls in this
> directory to host remote object on IIS. And An
> Problem is occur when I execute client application. That is when I used
> configuration file for configuration. The Exception occur file not found
but
> file is there after exception occur file deleted from its location.
> Second When i used to configure using
> RemotingConfiguration.RegisterWellKnownClientType(typeof(IPlayer),
"http://localhost:80/Test/MyServer.rem");
> It executed this statment but excption of logon failde occur when reomote
is
> called.
>
> Here is the source of this problem including configuration files. All
these
> files in same virtual directory and this virtual directory has no
Annonymous
> Access .Can some one copy these and compile to reproduce the behavior or
tell
> me where I went wrong.
>
> //RemotingLibrary.cs
> namespace RemotingLibrary
> {
> public interface IPlayer
> {
> string GetCurrentSong();
> }
> }
> --------------------------------------------------------------------------
----------------
> here is Implementation of IPlyer which is also a remote object
> //RemotingServer.css
>
> namespace RemotingServer
> {
> public class MyRemote: MarshalByRefObject, IPlayer
> {
> string song;
>
> public MyRemote(string song)
> {
> this.song = song;
> }
>
> public string GetCurrentSong()
> {
> return song;
> }
> }
> }
> --------------------------------------------------------------------------
-------------------
> And Here is the client Application
> //RemotingClient.cs
> using System;
> using System.Runtime.Remoting;
> using RemotingLibrary;
>
> namespace RemotingClient
> {
> class RemoteClient
> {
> public static void Main()
>
> { /*RemotingConfiguration.RegisterWellKnownClientType(typeof(IPlayer),
"http://localhost:80/Test/MyServer.rem");*/
>
> RemotingConfiguration.Configure("RemotingClient.exe.config");
> IPlayer player = (IPlayer)Activator.GetObject(typeof(IPlayer),
> "http://localhost:80/Test");
>
> try
> {
> string str;
> Console.WriteLine(player.GetCurrentSong());
> }
> catch(Exception ex)
> {
> error = ex.Message;
> }
> }
> }
> }
> --------------------------------------------------------------------------
--------
> //Web.config
> <configuration>
> <system.runtime.remoting>
> <application>
> <service>
> <wellknown mode="SingleCall" type="RemotingServer.MyRemote,
> RemotingServer" objectUri="MyServer.rem" />
>
> </service>
>
> <channels>
> <channel ref="http">
> </channel>
> </channels>
> </application>
> </system.runtime.remoting>
> </configuration>
>
> --------------------------------------------------------------------------
-------------------
> //RemotingClient.exe.config
> <configuration>
> <system.runtime.remoting>
> <application>
> <channels>
> <channel ref="http" useDefaultCredentials="true" port="0">
> <clientProviders>
> <formatter
> ref="binary"
> />
> </clientProviders>
> </channel>
> </channels>
> <client>
> <wellknown
> url="http://localhost:80/Test/Server.rem"
> type="RemotingServer.MyRemote, RemotingServer"
> />
> </client>
> </application>
> </system.runtime.remoting>
> </configuration>
>
>


1 Answer

Naeem Hassan Dad

9/13/2004 6:05:00 AM

0

I already study this example it work fine. But my problem still there cannont
be solved.