Hi;
I'm doing an example program from a book regarding .NET Remoting.
Both the Client and Server are C# Console Applications.
Server Code is
using System;
using System.Runtime. Remoting;
using System.Runtime. Remoting.Channe ls;
using System.Runtime. Remoting.Channe ls.Tcp;
namespace Wrox.Samples
{
class SimpleServer
{
[STAThread]
static void Main(string[] args)
{
//Create and register the Server Channel
TcpServerChanne l channel=new TcpServerChanne l(9000);
ChannelServices .RegisterChanne l(channel);
RemotingConfigu ration.Applicat ionName="Simple Server";
ActivatedServic eTypeEntry remObj=new
ActivatedServic eTypeEntry(type of(MyRemoteObje ct));
RemotingConfigu ration.Register ActivatedServic eType(remObj);
Console.WriteLi ne("Press Return To Exit");
Console.ReadLin e();
}
}
}
And the Remote Object Class in the Wrox.Samples Project is
using System;
namespace Wrox.Samples
{
public class MyRemoteObject: System.MarshalB yRefObject
{
public MyRemoteObject( )
{
Console.WriteLi ne("Constructo r Called");
}
public string Hello()
{
Console.WriteLi ne("Hello Called");
return "Hello, .NET Client!";
}
}
}
And my Client Code is
using System;
using System.Runtime. Remoting;
using System.Runtime. Remoting.Channe ls;
using System.Runtime. Remoting.Channe ls.Tcp;
using Wrox.Samples;
using System.Runtime. Remoting.Activa tion;
namespace WS
{
class SimpleClient
{
[STAThread]
static void Main(string[] args)
{
//Create and Register the Client Channel
TcpClientChanne l channel=new TcpClientChanne l();
ChannelServices .RegisterChanne l(channel);
ActivatedClient TypeEntry entry=new
ActivatedClient TypeEntry(typeo f(MyRemoteObjec t),"tcp://localhost:9000/");
RemotingConfigu ration.Register ActivatedClient Type(entry);
MyRemoteObject obj=new MyRemoteObject( );//###Exception Occures
here
for (int i=0; i<5; i++)
{
Console.WriteLi ne(obj.Hello()) ;
} Console.ReadLin e();
}
}
}
My Problem is When I Run the Server and the Client in the Client where
I'm Instantiating the New MyRemoteObject the Following Error Comes.
An unhandled exception of type
'System.Runtime .Remoting.Remot ingException' occurred in mscorlib.dll
Additional information: Permission denied for activating type
Wrox.Samples.My RemoteObject, MyRemoteObject, Version=0.0.0.0 ,
Culture=neutral , PublicKeyToken= null.
But for WellKnown and Singleton RemoteObjects it Works Fine.
The error Comes only for CAO Scenario.
Help regarding this problem is highly appreciated.
Thanks
Deepal 3 4691
Hi Deepal,
Are you presently using a soapsuds.exe generated proxy
reference on the client side for 'MyRemoteObject ' .
I think there is an issue with soapsuds generated
proxies for this particular case with CAO objects. Can you try referencing
the same server side assembly that contains 'MyRemoteObject ' in
the client side and see if the issue goes away
Regards,
Aravind C
"Deepal" <de*****@sabret ch.com> wrote in message
news:ed******** *************** ***@posting.goo gle.com... Hi; I'm doing an example program from a book regarding .NET Remoting. Both the Client and Server are C# Console Applications.
Server Code is
using System; using System.Runtime. Remoting; using System.Runtime. Remoting.Channe ls; using System.Runtime. Remoting.Channe ls.Tcp;
namespace Wrox.Samples { class SimpleServer { [STAThread] static void Main(string[] args) { //Create and register the Server Channel TcpServerChanne l channel=new TcpServerChanne l(9000); ChannelServices .RegisterChanne l(channel);
RemotingConfigu ration.Applicat ionName="Simple Server";
ActivatedServic eTypeEntry remObj=new ActivatedServic eTypeEntry(type of(MyRemoteObje ct)); RemotingConfigu ration.Register ActivatedServic eType(remObj);
Console.WriteLi ne("Press Return To Exit"); Console.ReadLin e();
} } }
And the Remote Object Class in the Wrox.Samples Project is using System;
namespace Wrox.Samples { public class MyRemoteObject: System.MarshalB yRefObject { public MyRemoteObject( ) { Console.WriteLi ne("Constructo r Called"); }
public string Hello() { Console.WriteLi ne("Hello Called"); return "Hello, .NET Client!"; } } }
And my Client Code is
using System; using System.Runtime. Remoting; using System.Runtime. Remoting.Channe ls; using System.Runtime. Remoting.Channe ls.Tcp; using Wrox.Samples; using System.Runtime. Remoting.Activa tion;
namespace WS { class SimpleClient { [STAThread] static void Main(string[] args) { //Create and Register the Client Channel TcpClientChanne l channel=new TcpClientChanne l(); ChannelServices .RegisterChanne l(channel);
ActivatedClient TypeEntry entry=new ActivatedClient TypeEntry(typeo f(MyRemoteObjec t),"tcp://localhost:9000/"); RemotingConfigu ration.Register ActivatedClient Type(entry);
MyRemoteObject obj=new MyRemoteObject( );//###Exception Occures here
for (int i=0; i<5; i++) { Console.WriteLi ne(obj.Hello()) ; } Console.ReadLin e(); } } }
My Problem is When I Run the Server and the Client in the Client where I'm Instantiating the New MyRemoteObject the Following Error Comes.
An unhandled exception of type 'System.Runtime .Remoting.Remot ingException' occurred in mscorlib.dll
Additional information: Permission denied for activating type Wrox.Samples.My RemoteObject, MyRemoteObject, Version=0.0.0.0 , Culture=neutral , PublicKeyToken= null.
But for WellKnown and Singleton RemoteObjects it Works Fine. The error Comes only for CAO Scenario.
Help regarding this problem is highly appreciated.
Thanks Deepal
Hi Aravind,
What i have done is i Compiled the MyRemoteObject. cs into a
MyRemoteObject. dll in the Command Prompt
csc /target:library /out:MyRemoteObj ect.dll MyRemoteObject. cs
Then In the Client Project I added the Project reference to
MyRemoteObject. dll.
That's all i did.
What's wrong in that? Is there anything that i have missed or something
to do with soapsuds?
Thanks
Deepal
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Hi Deepal,
Actually, I originally assumed that the client's project had
a reference to MyRemoteObject. dll that was generated using soapsuds.exe.
But now since you are referencing the same assembly (and not using the
soapsuds generated one), I think you could disregard my earlier post.
I will check and let you know.
Regards,
Aravind C
"Deepal Kanchana" <de*****@sabret ch.com> wrote in message
news:OV******** ******@TK2MSFTN GP10.phx.gbl...
Hi Aravind, What i have done is i Compiled the MyRemoteObject. cs into a MyRemoteObject. dll in the Command Prompt
csc /target:library /out:MyRemoteObj ect.dll MyRemoteObject. cs
Then In the Client Project I added the Project reference to MyRemoteObject. dll.
That's all i did.
What's wrong in that? Is there anything that i have missed or something to do with soapsuds? Thanks Deepal
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Deepal |
last post by:
Hi;
I'm doing an example program from a book regarding .NET Remoting.
Both the Client and Server are C# Console Applications.
Server Code is
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
|
by: Mark Broadbent |
last post by:
Could someone clear this up for me a bit. I am a little bit uncertain about
this but this is my understanding. Please correct where wrong or bits
missing.
There are two types of remoting :-
Marshal-by-reference
Server Activated objects (SAO). Object instanciated on the
server. Default constructor. Creation delayed till first method call.
Lifetime controlled by server
|
by: Mark Broadbent |
last post by:
Could someone clear this up for me a bit. I am a little bit uncertain about
this but this is my understanding. Please correct where wrong or bits
missing.
There are two types of remoting :-
<Marshal-by-reference>
<SAO Properties = "Object instanciated on the server. Default
constructor. Creation delayed till first method call. Lifetime controlled by
server">
|
by: Z D |
last post by:
Hello,
Is it true that I need to push the DLL for my entire class if I wish to use
CAO remoting???
Can't I just use an Interface to the class on the client side and
instantiate the object in a similar fashion to using SAO Singleton with an
interface? ie:
Dim MyPerson As IPerson
|
by: Hankman |
last post by:
Hello,
I'm having a problem with a remoting CAO. The CAO creates an instance of a
VB6.0 ActiveX.exe which talks to an old application though DDE. Everything
works fine when the client is a Winforms or console app. Then I try to make
an ASP.NET web page the client it fails. At first It would not create the
instance because of security, but I added the ASPNET to the Admin of the
machine and added full trust to the assembly, now it creates...
| |
by: Rich |
last post by:
Can anyone suggest a good (current) tutorial on how to do basic
remoting with C# (2005 express edition)?
|
by: Dave Evans |
last post by:
I have a number of remotable DLLs, which are hosted by a Windows Service. The Windows Service simply registers the remotable DLLs using RemotingConfiguration.Configure. The configuration file is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="UniConnect">
<service>
<wellknown mode="SingleCall" type="Northgate.HRS.UniConnect.UCRegistry, ZUCRegistry"...
|
by: chandu |
last post by:
any body give exact explanation on how CAO and SAO can be used in remoting
application
|
by: abhijit4229 |
last post by:
Hello,
I have strange situation on hand , I have remotely exposed an object through Windows serice. I am using Client Activated Objects(CAO) . Now whenever I try to create an proxy object on the client, I get an Target Innvocation exception, this is when the service is running . Everything works great when I stop the service and start the .exe for the service. I initially thought this can be authentication issue.
I tried...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |