Results 1 to 6 of 6

Thread: Urgent remoting help!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Urgent remoting help!

    I get the exception when running this code
    the exception says "requested service not found"

    VB Code:
    1. Dim test As IRemoting
    2.  
    3.         'Create the actual object
    4.         'NOTE... the client is working with an interface, not an implementation!
    5.         test = CType(Activator.GetObject(GetType(IRemoting), _
    6.                "tcp://localhost:6000/RemotingServer"), IRemoting)

    the server config file looks like this:

    VB Code:
    1. <system.runtime.remoting>
    2.  
    3.   <application name="RemotingService">
    4.    <service>
    5.       <wellknown mode="Singleton" type="RemoteClassLib.RemoteObject,RemoteClassLib" objectUri="RemoteObject"/>
    6.    </service>
    7.       <channels>
    8.  
    9.     <channel ref="tcp" port="6000"/>
    10.    </channels>
    11.   </application>
    12.     <debug loadTypes="true" />
    13.  </system.runtime.remoting>

    and the server code is like this:

    VB Code:
    1. RemotingConfiguration.Configure("RemotingServer.exe.config")
    2.  
    3.             Console.WriteLine("Server configuration loaded!")
    4.             Console.WriteLine(".NET Remoting Server Started!")
    5.             Console.WriteLine("Press any key to end the server...")
    6.             Console.ReadLine()


    So what can be the problem?? the server loads the channes, set the protocol and register the remoteobject class!

    The client create an instance SAO by using the activator object...

    help!
    Henrik

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449
    Hi,

    I actually hate using remoting stuff in app.config, usually I do this programatically...but if I recall correctly, shouldn't "tcp://localhost:6000/RemotingServer" be "tcp://localhost:6000/RemoteObject" after objectUri="RemoteObject"?

    Cheers,
    NTG
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    yeah, the URI was flawed, thanks!

    Im curious.. where do YOU use remoting instead of webservices? and when YOU use remoting... what kind of objects and hosts do you use? And which formatter and channel (binary-tcp) OR (soap-http)???

    We are discussing this at work, and I need all suggestions as I can get since we don't really have any true world experience about this. I know the technology, but where to use it?? And how to use it??

    For example, logging apps and genric database components? remoting or webservices?? If you choose remoting, how should the generic dbcomponent be hosted and how should it be created? (im thinking a CAO using singlecall?)

    kind regards
    Henrik

  4. #4
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449
    Hi,

    Wow, slow down a bit.

    I think that the only difference between remoting and web services is the host - web services are really DLLs exposed through remoting by IIS. Generally speaking, I'd use web services only if I would need interoperability between different systems and/or languages - otherwise I'd use remoting, hands down.

    I'd say that remoting should be used when you feel that some piece of code that a client needs to use would be better placed on a server and not on the client. That encompasses a lot of different things of course, and you can't forge a golden rule so you'll have to make a decision on a per-case basis. Also, you can also distribute the remoted DLL with only the class and method call declarations to the clients and update the full-blown remoted DLL on the server without even bothering to distribute updates to the client (that is until you change class design of course).

    Since there's so many different choices about remoting, I've coded a generic framework that can take a DLL and expose it through remoting but in a configurable way (incorporates sinks for encryption and authentication, custom sinks, single call or singleton, binary or http, etc). Again, you can't come up with a single answer that's correct for all cases. Generally speaking, the only thing that's common throughout remoting solutions I've coded is a preference for binary over http since it's faster - only bad thing about binary is that you can't figure what's going on as easily if you sniff the traffic.

    Cheers,
    NTG
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    Okay, that is interesting.

    What alternatives do I have if I need a remote object that need resources on the client?

    For example, a printing framework. I want the implementation on the server, but I need to make the setup using local values (like local printer enumeration etc etc) Can I make that just by using a CAO, since I obviously need an object with state?

    I have very little practical experience with remoting, and sadly here at work they think webservices are the key to everything and that remoting is too difficult to work with and difficult to host.

    I think they are just lazy, but since im a programmer and not an architect its not up to me.

    I totall agree on what you write about when to use remoting and when to use webservices...

    Thanks
    Henrik

  6. #6
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449
    Originally posted by MrNorth
    I think they are just lazy, but since im a programmer and not an architect its not up to me.
    Although it generally sucks, if that's the case then you should stick to policy and just read additional material only for your own benefit.

    Originally posted by MrNorth
    I have very little practical experience with remoting, and sadly here at work they think webservices are the key to everything and that remoting is too difficult to work with and difficult to host.
    Well, if you're looking at interoperability then web services are great. Remoting is indeed much more difficult to host than web services - a "Hello world" web service takes 5 seconds to code while the respective remoted example would take 5 minutes. However, remoting packs a lot of additional control and flexibility and difficulty is the price to pay for it.

    Originally posted by MrNorth
    What alternatives do I have if I need a remote object that need resources on the client?
    It all comes down to design. Why would a remote object need resources on the client ? If you need a print framework then you should create a level of abstraction on the server and then run the actual printing class that will print on the client, but that would make use of the abstraction provided by the server object to do whatever it needs to do.

    Cheers,
    NTG
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width