error when calling remote component in Web Service

K

keith

I have a remote component hosted in console server and have a web service.

Inside the web service, I have codes to configure the component

System.Runtime.Remoting.RemotingConfiguration.Configure(filename)
IComponent iCom = (IComponent)Activator.GetObject(typeof(Component),
"tcp://localhost:1234/Component.rem");
iCom.Hello();

I have a test app (all these projects are in same solution) that calls a
method in the WS. Then it calls a function in the
remote component. When running it the first time. It worked just fine.
But when running it thereafter, it throw


"System.Runtime.Remoting.RemotingException: Remoting configuration failed
with the exception 'System.Runtime.Remoting.RemotingException: Attempt to
redirect activation of type 'Test.IComponent,TestInterface' which is already
redirected.\r\n at
System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.AddWellKnownClientType(WellKnownClientTypeEntry
entry)\r\n at
System.Runtime.Remoting.RemotingConfigHandler.RegisterWellKnownClientType(WellKnownClientTypeEntry
entry)\r\n at
System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownClientType(WellKnownClientTypeEntry
entry)\r\n at
System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.StoreRemoteAppEntries(RemotingXmlConfigFileData
configData)\r\n at
System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData
configData, Boolean ensureSecurity)'.\r\n at
System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData configData
, Boolean ensureSecurity)\r\n at
System.Runtime.Remoting.RemotingConfigHandler.DoConfiguration(String
filename, Boolean ensureSecurity)\r\n at
System.Runtime.Remoting.RemotingConfiguration.Configure(String filename,
Boolean ensureSecurity)\r\n at
JINDEXMessagingService.DoRemoteProcess(JINDEXDocument jDoc) in
c:\\Inetpub\\wwwroot\\WS1\\App_Code\\Test.cs:line 103"



Can you help?

Thanks

Keith
 
J

John Saunders

keith said:
I have a remote component hosted in console server and have a web service.

Inside the web service, I have codes to configure the component

System.Runtime.Remoting.RemotingConfiguration.Configure(filename)
IComponent iCom = (IComponent)Activator.GetObject(typeof(Component),
"tcp://localhost:1234/Component.rem");
iCom.Hello();

I have a test app (all these projects are in same solution) that calls a
method in the WS. Then it calls a function in the
remote component. When running it the first time. It worked just fine.
But when running it thereafter, it throw


"System.Runtime.Remoting.RemotingException: Remoting configuration failed
with the exception 'System.Runtime.Remoting.RemotingException: Attempt to
redirect activation of type 'Test.IComponent,TestInterface' which is
already
redirected.\r\n at

Did you not understand "Attempt to redirect activation of type
'Test.IComponent,TestInterface' which is already redirected"? Did you
notice which line it failed on?
 
K

keith

I know what happened and solution. It will config multiple times in a web app
or web service which is not allowed.

keith
 
K

keith

John,

Is it good to use remote component in a web service?

Actually, what I want to save data to text file, but I got permission issues.
Even though I set an account have full access on a folder and checked ACL on
it, I still got

Access to the path 'C:\\temp\txt' is denied

when executing the codes in Web Service

System.IO.Stream sm = new System.IO.FileStream(c:\temp\test.txt,
System.IO.FIleMode.Create);


Can you help?

Thanks

Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top