Select client channel for a remote call.

  • Thread starter Thread starter Bill Davidson
  • Start date Start date
B

Bill Davidson

All:

I have registered several client-side channels, each with a different set of
credentials. When I want to make a remote call, how can I specify which
client-side channel I want to use to make the call?

Thanks,
Bill
 
Hello Bill,

Thanks for your post. Based on my experience, we are able to specify
client-side channel via RemotingConfiguration.RegisterWellKnownClientType
which is used to register an object Type on the client end as a well-known
type (single call or singleton). It has a parameter URI which we can
specify the protocal and port. Suppose that we register two channels, one
is TCP, another is HTTP. If we want to use TCP channel, we can
RegisterWellKnownClientType with URI like below:

"tcp://localhost:8082/HelloServiceApplication/MyUri"

RemotingConfiguration.RegisterWellKnownClientType Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemruntimeremotingremotingconfigurationclassregisterwellknownclientt
ypetopic.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Tim:

Thanks for the reply, but it really doesn't answer my question. I'm not
trying to use two different protocols, I'm creating and registering two sets
of credentials. Recall that one of the properties that can be set on a
channel is the 'credentials' properties which takes an object implementing
the ICredentials interface. I'm using a client proxy based on code produced
by the Soapsuds.exe tool.

Presume I have two channels, ChannelA and ChannelB each using a different
set of credentials. I want to make a remote call to a remoting server
object (hosted by IIS) and I want to be able to explicitly state over which
of the channels I want to make the call. Can I do that?

It appears to me that I (the programmer) have no choice in the matter and
the remoting layer on the client selects a channel for me.

Thanks,
Bill
 
Hello Bill,

Thanks for your response. I now share the following information with you:

1. Based on my experience and research, it is the remoting system that
ensures that the remote object is connected to the right channel when a
client attempts to connect to the object. We can only set the "priority"
property of each channel to indicate a order of channel being chosen.
Please refer to the following MSDN article on "Channel Rules":

Channels
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconchannels.asp?frame=true

2. To work around this problem, I suggest that you can register the
channels of same type in different application domains (because channels
are registered on a per-application-domain basis). If you want to select a
specific channel for a remote call, you can go to its corresponding
appdomain.

Please feel free to let me know if you have any problems.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top