Problems with Activated and Well-known objects
- From: "enigman" <rafa.schez@xxxxxxxxx>
- Date: 20 Jun 2006 05:50:56 -0700
Hi group and excuse for my english:
This is the situation: I have a class which I want to access remotely.
The code of the class is as follows:
public class clsClass:MarshalByRefObject
{
public clsClass() {}
public clsClass(string strParam): this() {}
public string strTime () {
return DateTime.Now.ToString();
}
}
If I define a client.config in this way:
<client url="http://header"> ("header" defined at the DNS)
<activated type="Classes.myClass, Classes" />
</client>
And the web.config is:
<service>
<activated type="Classes.myClass, Classes" />
<wellknown mode="Singleton" type="Classes.myClass,Classes"
objectUri="myClass.rem" />
</service>
And I try to access to a method of this class:
Classes.myClass objClass = new Classes.myClase();
Classes.myClass objClase2 = new Clases.clsClase("Prueba");
textBox1.Text = objClase.strTime();
When I try to access to the "strTime" method, the server sends an error
"Server encountered an internal error. To get more info turn on
customErrors in the server's config file."
I've tried to solve this error by changing the client.config in this
way:
<client url="http://header"> ("header" defined at the DNS)
<wellknown mode="Singleton" type="Classes.myClass,Classes"
url="http://header/myClass.rem"/>
</client>
Now, I can access to the class methods but, in this case, the problem
comes from the constructor with parameters. I've seen that "It's by
design Well-known(server activated) objects are instantialized by
default constructor only"
That's my problem, anyone could tell me what I'm doing wrong?
Thank you all in advance!
.
- Prev by Date: Re: With or without host headers
- Next by Date: Re: Cannot create channel sink
- Previous by thread: GenuineChannels
- Next by thread: Authorizaing users in server C# 2.0
- Index(es):
Relevant Pages
|