The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Remoting Client-Side

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
David Cumps

Posts: 319
Nickname: cumpsd
Registered: Feb, 2004

David Cumps is a Belgian Student learning .NET
Remoting Client-Side Posted: Apr 5, 2005 1:55 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by David Cumps.
Original Post: Remoting Client-Side
Feed Title: David Cumps
Feed URL: http://weblogs.asp.net/cumpsd/rss?containerid=12
Feed Description: A Student .Net Blog :p
Latest .NET Buzz Posts
Latest .NET Buzz Posts by David Cumps
Latest Posts From David Cumps

Advertisement
After everything was done on the server-side of the Remoting implementation, inside the Windows Service, it was time to add the consumer side. In the case of this project, the consumer was an ASP.NET Webservice running on the same machine.

This required little effort. First, System.Runtime.Remoting had to be referenced, together with the assembly containing the interface used for the controller object. After this it was possible retrieve the controller object with the following code:

 

private IPlayerServiceController GetPlayerServiceController() {

  return (IPlayerServiceController)Activator.GetObject(

            typeof(IPlayerServiceController),

          String.Format("tcp://{0}:{1}/MediaServicePlayerController",

          this.configData.RemotingHost,

          this.configData.RemotingPort));

} /* GetPlayerServiceController */

 

In this solution, the webservice does not need to reference the assembly containing the real controller, but only an assembly that contains the interface. The real implementation is running on the server-side, as an instantiated, marshalled object.

When the instance got returned, it was possible to use it very simple, like this code:

 

[WebMethod(Description="Stop playing the queue.")]

public void Stop() {

  this.GetPlayerServiceController().StopPlaying();

} /* Stop */

Read: Remoting Client-Side

Topic: First Photo of Extrasolar Planet Previous Topic   Next Topic Topic: Add one: nGallery

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use