Click here to Skip to main content
16,007,760 members
Home / Discussions / C#
   

C#

 
GeneralDealing with shortcuts Pin
Christian Graus1-Mar-05 15:15
protectorChristian Graus1-Mar-05 15:15 
GeneralRe: Dealing with shortcuts Pin
Christian Graus1-Mar-05 18:07
protectorChristian Graus1-Mar-05 18:07 
GeneralRe: Dealing with shortcuts Pin
Radgar1-Mar-05 22:04
Radgar1-Mar-05 22:04 
Generalpix Pin
wael_waw1-Mar-05 14:33
wael_waw1-Mar-05 14:33 
GeneralRe: pix Pin
Christian Graus1-Mar-05 15:13
protectorChristian Graus1-Mar-05 15:13 
GeneralSimple example ZIP of Windows Service with remoting Pin
a_edwill1-Mar-05 14:28
a_edwill1-Mar-05 14:28 
GeneralRe: Simple example ZIP of Windows Service with remoting Pin
Scott Serl1-Mar-05 19:02
Scott Serl1-Mar-05 19:02 
GeneralRe: Simple example ZIP of Windows Service with remoting Pin
a_edwill2-Mar-05 7:36
a_edwill2-Mar-05 7:36 
The problem is in the remoting portion of the service itself.

The service looks like:

    <br />
    public class MyService : System.ServiceProcess.ServiceBase<br />
    {<br />
       private m_sString = "hello";<br />
       ...<br />
       protected override void OnStart(string[] args)<br />
       {<br />
          RemotingConfiguration.Configure("RemotingServer.Config");<br />
       }<br />
       ...<br />
       public string StringFunction()<br />
       {<br />
          return m_sString;<br />
       }<br />
       ...<br />
    }<br />



And uses the following RemotingServer.config:
    <br />
    <configuration><br />
       <system.runtime.remoting><br />
          <application><br />
             <service><br />
                <wellknown <br />
                   mode="SingleCall" <br />
                   type="MyService,Tools.MyService" <br />
                   objectUri="MyService.rem"<br />
                /><br />
             </service><br />
             <channels><br />
                <channel ref="http" port="8500"/><br />
             </channels><br />
          </application><br />
       </system.runtime.remoting><br />
    </configuration><br />



The client looks like this:

    <br />
    MyService remoteObject = (MyService) Activator.GetObject(typeof(MyService), "http://localhost:8500/RemotingClient.rem");<br />
    string sRetVal = remoteObject.StringFunction();<br />



The client RemotingClient.rem file looks like:
    <br />
    <configuration><br />
       <system.runtime.remoting><br />
          <application><br />
             <client><br />
                <wellknown <br />
                   type="MyService, Tools.MyService"<br />
                   url="http://localhost:8500/MyService.rem"<br />
                /><br />
             </client><br />
          </application><br />
       </system.runtime.remoting><br />
    </configuration><br />


The error I receive is:
    <br />
    An unhandled exception of type 'System.Net.WebException' occurred in mscorlib.dll<br />
    <br />
    Additional information: The underlying connection was closed: Unable to connect to the remote server.<br />

The client code is sitting in an console app.

The service starts and reports it is running correctly. It is compiled as a DLL.
GeneralRe: Simple example ZIP of Windows Service with remoting Pin
Scott Serl4-Mar-05 8:28
Scott Serl4-Mar-05 8:28 
GeneralMDI and moveable (custom) control painting Pin
pacharakeng1-Mar-05 12:13
pacharakeng1-Mar-05 12:13 
GeneralRe: MDI and moveable (custom) control painting Pin
Dave Kreskowiak3-Mar-05 0:39
mveDave Kreskowiak3-Mar-05 0:39 
Questionimport registry files? Pin
Anthony Mushrow1-Mar-05 12:02
professionalAnthony Mushrow1-Mar-05 12:02 
AnswerNeed some help! Pin
Anthony Mushrow1-Mar-05 22:50
professionalAnthony Mushrow1-Mar-05 22:50 
GeneralNeed help accessing a textbox from another class... Pin
ericfgarcia1-Mar-05 10:56
ericfgarcia1-Mar-05 10:56 
GeneralRe: Need help accessing a textbox from another class... Pin
Judah Gabriel Himango1-Mar-05 11:46
sponsorJudah Gabriel Himango1-Mar-05 11:46 
GeneralRe: Need help accessing a textbox from another class... Pin
ericfgarcia2-Mar-05 3:44
ericfgarcia2-Mar-05 3:44 
GeneralRe: Need help accessing a textbox from another class... Pin
Judah Gabriel Himango2-Mar-05 5:14
sponsorJudah Gabriel Himango2-Mar-05 5:14 
GeneralGetAttribute Returning Null Sometimes Pin
DemonBob1-Mar-05 10:37
DemonBob1-Mar-05 10:37 
GeneralRegex question Pin
ektoras1-Mar-05 10:02
ektoras1-Mar-05 10:02 
GeneralRe: Regex question Pin
Dave Kreskowiak1-Mar-05 10:18
mveDave Kreskowiak1-Mar-05 10:18 
GeneralRe: Regex question Pin
leppie1-Mar-05 11:10
leppie1-Mar-05 11:10 
GeneralOleDB Insert into MS Access Pin
Vodstok1-Mar-05 9:54
Vodstok1-Mar-05 9:54 
GeneralRe: OleDB Insert into MS Access Pin
Dave Kreskowiak1-Mar-05 10:16
mveDave Kreskowiak1-Mar-05 10:16 
GeneralRe: OleDB Insert into MS Access Pin
Vodstok1-Mar-05 10:26
Vodstok1-Mar-05 10:26 
GeneralRe: OleDB Insert into MS Access Pin
Anonymous1-Mar-05 10:42
Anonymous1-Mar-05 10:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.