I have a console application in my local computer which I like to use
remoting in it,to instanciate an object (MyClass.dll) in a web
application(its bin folder) in a completely seperated box(in the same domain
thought) .I have two questions:
1)Is my case covered in "Remoting objects hosted in IIS" topic?Are they
same?
2) How should I authenticate to IIS from my console application? Do I really
need to authenticate to IIS before instantiating the object?
Thanks for your help. 14 1427
> 1)Is my case covered in "Remoting objects hosted in IIS" topic?Are they same?
Not sure -- your description of the setup is a little unclear. Hosting remoting
objects out of IIS and ASP.NET means you've delpoyed your MarshalByRefObject-derived
classes to an assembly in the ~/bin and you've configured web.config to serve
those up as .rem or .soap endpoints. I'm not sure how your console app fits
into this picture unless it's the remoting client application.
2) How should I authenticate to IIS from my console application? Do I really need to authenticate to IIS before instantiating the object?
Ah, so the console app is the client. So then on the transparent proxy you
can set the credentials via ((Thx to Mike Woodring for this tip)):
// assuming tp is your transparent proxy
IDictionary chanProps = ChannelServices.GetChannelSinkProperties(tp);
// this uses your client app's credentials
chanProps["credentials"] = CredentialCache.DefaultCredentials;
// or this sets them explicitlly if you have plaintext password
chanProps["credentials"] = new NetworkCredential(userName, password);
Ick. Super ick. Ick Ick Ick.
-Brock
DevelopMentor http://staff.develop.com/ballen
> Not sure -- your description of the setup is a little unclear. Hosting remoting objects out of IIS and ASP.NET means you've delpoyed your MarshalByRefObject-derived classes to an assembly in the ~/bin and you've configured web.config to serve those up as .rem or .soap endpoints. I'm not sure how your console app fits into this picture unless it's the remoting client application.
Yes,The class I want to uuse within the dll file is derived from
MarshalByRefObject and the assembly is in the bin folder of the web
application.The console application is an application which is going to
instantiate that class and uses one of its method to do something.The object
is hosting by IIS.I think having said this ,it means that console
application is remoting client app and IIS hosts the remote object.
Is that right? You mentioned web.config in your reply.which web config are
you refering to?
Let's assume all this done.I would always see the latest version of remote
object in my console app,right? and I do not need to reference it explicity
or be worried about compiling my client app whenevr they compile the
remoting object ,right?
Thanks for your reply.
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:64**********************@msnews.microsoft.com ... 1)Is my case covered in "Remoting objects hosted in IIS" topic?Are they same?
Not sure -- your description of the setup is a little unclear. Hosting remoting objects out of IIS and ASP.NET means you've delpoyed your MarshalByRefObject-derived classes to an assembly in the ~/bin and you've configured web.config to serve those up as .rem or .soap endpoints. I'm not sure how your console app fits into this picture unless it's the remoting client application.
2) How should I authenticate to IIS from my console application? Do I really need to authenticate to IIS before instantiating the object?
Ah, so the console app is the client. So then on the transparent proxy you can set the credentials via ((Thx to Mike Woodring for this tip)):
// assuming tp is your transparent proxy IDictionary chanProps = ChannelServices.GetChannelSinkProperties(tp); // this uses your client app's credentials chanProps["credentials"] = CredentialCache.DefaultCredentials; // or this sets them explicitlly if you have plaintext password chanProps["credentials"] = new NetworkCredential(userName, password);
Ick. Super ick. Ick Ick Ick.
-Brock DevelopMentor http://staff.develop.com/ballen
> Let's assume all this done.I would always see the latest version of remote object in my console app,right? and I do not need to reference it explicity or be worried about compiling my client app whenevr they compile the remoting object ,right?
As long as the client and server share some common metadata format, then
yes, this will work. The recommended approach is to use an interface as the
common metadata format. IOW, that's the shared API between the client and
server. This then will basically mean that your MBRO should be configured
as a WellKnown Object type. It's up to you whether you decide to configure
it as SingleCall or Singleton. Mind you, singleton is a misnomer. It just
means there's only evenr one instance at any one time, but it could be a
different instance over time.
-Brock
DevelopMentor http://staff.develop.com/ballen
> As long as the client and server share some common metadata format, then yes, this will work
By this you mean the name of the method I'd like to call and also the
signature of it ,right?
I guess my other question is that ,you said "Bin folder" in your reply.I was
reading this article
( http://msdn.microsoft.com/library/de...ervicesiis.asp)
that I noticed the actual place for the remote objects needs to be in the
bin folder of the WWW root and those server side settings needs to be
inserted into the web.config file of IIS (wwwroot).Here is my problem:
Web portion of our application is in IIS and the object I'd like to remotely
call is always in the Bin folder of our application.I'd like to call that
object and I don;t want any body put the new version of that object to the
Bin folder of IIS whenever it gets changed.Is it possible to do that>
Thanks
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:64**********************@msnews.microsoft.com ... Let's assume all this done.I would always see the latest version of remote object in my console app,right? and I do not need to reference it explicity or be worried about compiling my client app whenevr they compile the remoting object ,right?
As long as the client and server share some common metadata format, then yes, this will work. The recommended approach is to use an interface as the common metadata format. IOW, that's the shared API between the client and server. This then will basically mean that your MBRO should be configured as a WellKnown Object type. It's up to you whether you decide to configure it as SingleCall or Singleton. Mind you, singleton is a misnomer. It just means there's only evenr one instance at any one time, but it could be a different instance over time.
-Brock DevelopMentor http://staff.develop.com/ballen
> By this you mean the name of the method I'd like to call and also the signature of it ,right?
Well, yeah, to compile your client you need to know what it is you're calling.
So the interface based approach is usually the best. Your client references
the assembly that has the interface definition (which is a seperate assembly
from the server itself) and then you get a proxy via RemotingServices.Connect
and cast it to your interface type.
I guess my other question is that ,you said "Bin folder" in your reply.I was reading this article (http://msdn.microsoft.com/library/de...ary/en-us/cpgu ide/html/cpconhostingremoteobjectsininternetinformationserv icesiis.asp ) that I noticed the actual place for the remote objects needs to be in the bin folder of the WWW root and those server side settings needs to be inserted into the web.config file of IIS (wwwroot).Here is my problem:
Web portion of our application is in IIS and the object I'd like to remotely call is always in the Bin folder of our application.
The ~/bin folder is the bin folder under the root directory of your application
as configured in IIS as a virtual directory. You don't need to deploy it
at the root of the website (but you can).
I'd like to call that object and I don;t want any body put the new version of that object to the Bin folder of IIS whenever it gets changed.Is it possible to do that>
To control what code is deployed into your web application you need to rely
upon standard NT security for that. Make it such that only admins can write
to the ~/bin folder.
-Brock
DevelopMentor http://staff.develop.com/ballen
Brock,
Thanks for the nice reply.Your help is really appreciated.
The Bin folder that the actual remoting object resides is the bin folder of
a web application.This web application has a reference to a business logic
layer (which is a dll file ,I'd like to istantiate one of its class memebers
remotely).When they update the business logic layer ,they have to recompile
the Web application and automatically the Business logic layer dll file is
going to be written into the bin folder(the latest version) and by this
mechanism I always make sure that I'm using the latest version of remoting
object in my remoting client application.Dose it make sense?
By the way ,our web application is using NTLM(integrated windows) so I can
use what you wrote to authenticate to the remoting object and then I'm sure
no body else from outside world has access to the remote object.Am I right
here?
Thanks again
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:64**********************@msnews.microsoft.com ... By this you mean the name of the method I'd like to call and also the signature of it ,right?
Well, yeah, to compile your client you need to know what it is you're calling. So the interface based approach is usually the best. Your client references the assembly that has the interface definition (which is a seperate assembly from the server itself) and then you get a proxy via RemotingServices.Connect and cast it to your interface type.
I guess my other question is that ,you said "Bin folder" in your reply.I was reading this article (http://msdn.microsoft.com/library/de...ary/en-us/cpgu ide/html/cpconhostingremoteobjectsininternetinformationserv icesiis.asp ) that I noticed the actual place for the remote objects needs to be in the bin folder of the WWW root and those server side settings needs to be inserted into the web.config file of IIS (wwwroot).Here is my problem:
Web portion of our application is in IIS and the object I'd like to remotely call is always in the Bin folder of our application.
The ~/bin folder is the bin folder under the root directory of your application as configured in IIS as a virtual directory. You don't need to deploy it at the root of the website (but you can).
I'd like to call that object and I don;t want any body put the new version of that object to the Bin folder of IIS whenever it gets changed.Is it possible to do that>
To control what code is deployed into your web application you need to rely upon standard NT security for that. Make it such that only admins can write to the ~/bin folder.
-Brock DevelopMentor http://staff.develop.com/ballen
I know that for remoting application,I always need to have remote object dll
in the client side for the compilation to extract metadata of the object
,but I don;t know what you meant by interface -based approach.You mean that
I have to create an interface of the object in the server and implement it
in the remoting object to make sure they always adhere that interface and
the logic might be only changed.Is that what you meant?
Thanks
"Ray5531" <Ra****@microsft.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Brock, Thanks for the nice reply.Your help is really appreciated.
The Bin folder that the actual remoting object resides is the bin folder of a web application.This web application has a reference to a business logic layer (which is a dll file ,I'd like to istantiate one of its class memebers remotely).When they update the business logic layer ,they have to recompile the Web application and automatically the Business logic layer dll file is going to be written into the bin folder(the latest version) and by this mechanism I always make sure that I'm using the latest version of remoting object in my remoting client application.Dose it make sense?
By the way ,our web application is using NTLM(integrated windows) so I can use what you wrote to authenticate to the remoting object and then I'm sure no body else from outside world has access to the remote object.Am I right here?
Thanks again "Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:64**********************@msnews.microsoft.com ... By this you mean the name of the method I'd like to call and also the signature of it ,right?
Well, yeah, to compile your client you need to know what it is you're calling. So the interface based approach is usually the best. Your client references the assembly that has the interface definition (which is a seperate assembly from the server itself) and then you get a proxy via RemotingServices.Connect and cast it to your interface type.
I guess my other question is that ,you said "Bin folder" in your reply.I was reading this article (http://msdn.microsoft.com/library/de...ary/en-us/cpgu ide/html/cpconhostingremoteobjectsininternetinformationserv icesiis.asp ) that I noticed the actual place for the remote objects needs to be in the bin folder of the WWW root and those server side settings needs to be inserted into the web.config file of IIS (wwwroot).Here is my problem:
Web portion of our application is in IIS and the object I'd like to remotely call is always in the Bin folder of our application.
The ~/bin folder is the bin folder under the root directory of your application as configured in IIS as a virtual directory. You don't need to deploy it at the root of the website (but you can).
I'd like to call that object and I don;t want any body put the new version of that object to the Bin folder of IIS whenever it gets changed.Is it possible to do that>
To control what code is deployed into your web application you need to rely upon standard NT security for that. Make it such that only admins can write to the ~/bin folder.
-Brock DevelopMentor http://staff.develop.com/ballen
> The Bin folder that the actual remoting object resides is the bin folder of a web application.This web application has a reference to a business logic layer (which is a dll file ,I'd like to istantiate one of its class memebers remotely).When they update the business logic layer ,they have to recompile the Web application and automatically the Business logic layer dll file is going to be written into the bin folder(the latest version) and by this mechanism I always make sure that I'm using the latest version of remoting object in my remoting client application.Dose it make sense?
Ok, sure. IOW, whenever they recompile evenrything and redeploy they're overwriting
what was there before. I can't tell if you're happy about that or not...
BTW, your MBRO doesn't need to be in the project where all of your ASPX pages
are (I assume you have some of those). It can be in its own assembly that
just has the remoting class. That organization is up to you.
By the way ,our web application is using NTLM(integrated windows) so I can use what you wrote to authenticate to the remoting object and then I'm sure no body else from outside world has access to the remote object.Am I right here?
Just like any other web app, people from the outside world can try to get
to it. But barring some catastrophic security leak or hole, it sounds like
you're going to get the security you're looking for. But in order to to ensure
you've taken all the precautions you need I'd also suggest doing more research
beyond listening to some schmo on a newsgroup :)
-Brock
DevelopMentor http://staff.develop.com/ballen
> I know that for remoting application,I always need to have remote object dll in the client side for the compilation to extract metadata of the object ,but I don;t know what you meant by interface -based approach.You mean that I have to create an interface of the object in the server and implement it in the remoting object to make sure they always adhere that interface and the logic might be only changed.Is that what you meant?
Your app needn't be designed that way. It sort of defeats the purpose to
require a copy of the server assembly at the client location. The interface
based approach is very similar, actually, because all the models require
metadata on the client so the runtime can instantiate a transparent proxy.
The interface based approach factors out into a seperate assembly all the
necessary information the client needs at compile time (and runtime). This
is then deployed to the client and that's used to compile. To connect, then,
RemotingServices.Connect(typeof(IInterfaceName), "protocol://server:port/app/endpoint")
is called to get a proxy that implements the interface. The server, of course,
must provide a class that implements the interface and is registered appropriately.
Like I said, it's not too different, but it's a bit cleaner, IMO, as it's
more explicit.
-Brock
DevelopMentor http://staff.develop.com/ballen The interface based approach factors out into a seperate assembly all the necessary information the client needs at compile time (and runtime). This is then deployed to the client and that's used to compile. To connect, then, RemotingServices.Connect(typeof(IInterfaceName), "protocol://server:port/app/endpoint") is called to get a proxy that implements the interface. The server, of course, must provide a class that implements the interface and is registered appropriately.
I think we are both saying the same thing about the interface-based
approach.If you look at this http://msdn.microsoft.com/library/de...stingInIIS.asp,
it is using almost the same idea.There is an IService interface which
defines everything.
You mean that I should make a seperate project (class Library) which
contains an interface of what I expect from the remote object and use that
deploy that interface to the client instead of Actual assembly ??? yes you
are right in that case, I don't need to have the actual assembly in the
client (As it is big assembly which is also the subject of daily changes)
and I only deploy the assembly which contains the interface,but having one
extra project for only one interface sucks in a way.Dosen't it? they have
put everything in Business Logic Layer.
Thanks
> I think we are both saying the same thing about the interface-based approach.If you look at this http://msdn.microsoft.com/library/de...ry/en-us/cpgui de/html/cpconRemotingExampleHostingInIIS.asp, it is using almost the same idea.There is an IService interface which defines everything.
Yeah, this is close. Except I don't advocate the use of "new" for remoting
objects. It leads to "sloppy thinking" for those who don't know that they're
working with remote objects.
You mean that I should make a seperate project (class Library) which contains an interface of what I expect from the remote object and use that deploy that interface to the client instead of Actual assembly ??? yes you are right in that case, I don't need to have the actual assembly in the client (As it is big assembly which is also the subject of daily changes) and I only deploy the assembly which contains the interface,but having one extra project for only one interface sucks in a way.Dosen't it? they have put everything in Business Logic Layer.
Yes, I think a seperate project (assembly) is better as it's more explict.
Trying to take an existing library and "just remote it" leads to disaster,
as the library (set of classes and APIs) weren't designed for the remote
scenario. It's important to design for the task at hand. The business library
should do its thing, and the remoting layer should do another. It's very
hard to get both of those merged into a single API that works really well
for both masters (so to speak).
-Brock
DevelopMentor http://staff.develop.com/ballen Yeah, this is close. Except I don't advocate the use of "new" for remoting objects. It leads to "sloppy thinking" for those who don't know that they're working with remote objects.
This is what you advocate ? -->
RemotingServices.Connect(typeof(IInterfaceName),
"protocol://server:port/app/endpoint")
Thanks
> This is what you advocate ? --> RemotingServices.Connect(typeof(IInterfaceName), "protocol://server:port/app/endpoint")
Yes, except of course you'd want to substiture your interface name and the
URI for your particular server. And also you'd probabaly want to store the
URI in your client's config file and load it via ConfigurationSettings.AppSettings,
but other than that, yes. Mind you, this is the API for WellKnownObject configuration
and won't work with ClientActivatedObjects.
Is there something unappealing about this to you?
-Brock
DevelopMentor http://staff.develop.com/ballen
Brock ,
Your explanations where awesome and I learnt a lot.Thanks for your patience
and help.
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:64**********************@msnews.microsoft.com ... This is what you advocate ? --> RemotingServices.Connect(typeof(IInterfaceName), "protocol://server:port/app/endpoint")
Yes, except of course you'd want to substiture your interface name and the URI for your particular server. And also you'd probabaly want to store the URI in your client's config file and load it via ConfigurationSettings.AppSettings, but other than that, yes. Mind you, this is the API for WellKnownObject configuration and won't work with ClientActivatedObjects.
Is there something unappealing about this to you?
-Brock DevelopMentor http://staff.develop.com/ballen This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Martin Lucas-Smith |
last post by:
Perhaps I'm using the wrong terminology, but is object delegation (as
opposed to inheritance) possible?, i.e. the line
$this->registration->displayStatus;
in the example below.
E.g. if...
|
by: Frank Millman |
last post by:
Hi all
I have a question regarding inheritance. I have come up with a
solution, but it is not very elegant - I am sure there is a more
pythonic approach. Assume the following class definitions....
|
by: Carel Lotz |
last post by:
H
We have ported our VB 6 application into VB .NET but are still integrating with a few COM + applications written in VB6 running on our application server (Win 2000 Server). We have the proxies...
|
by: jason |
last post by:
i have classic ASP code that is calling a C# class library, which is
wrapped for COM interop, and registered in the COM+ MMC.
i have written 3 objects for the class library so far, and all three...
|
by: J-T |
last post by:
I can instantiate my object in my *ASP.NET* application in two ways:
A)
public sealed class RSSingleton
{
private static ReportingServiceProxy m_RsProxy=null;
static RSSingleton()
{...
|
by: Wayne Smith |
last post by:
I've come up against a major headache that I can't seem to find a solution
for but I'm sure there must be a workaround and I would really be grateful
of any help.
I'm currently building a web...
|
by: Steven W. Orr |
last post by:
This is all an intro learning experience for me, so please feel free to
explain why what I'm trying to do is not a good idea.
In the Cookbook, they have a recipe for how to create global...
|
by: =?Utf-8?B?Q2hyaXM=?= |
last post by:
Hi,
I have a user with lots of protected documents in a folder. Is it possible
to create a small app which can be used to unprotect all the files in a
folder on one click and then after all...
|
by: Peted |
last post by:
I have an application with mdi parent form, and mutliple child forms.
In the mdi parent form i want to instantiate a device class for
comunicating to a peice of hardware via serial port.
its...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |