[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Remoting Error - Requested Service Not Found

Robin Prosch via .NET 247

7/3/2004 2:56:00 PM

Hi

I am trying to connect to a remote assembly published via a windows service. I am not using the WellKnownClient style of connection as I want to connect to the same assembly on a number of different machines. The code, below, just returns the Service Not Found error. Can someonen point me in the right direction?

Client Code:
oProvider.TypeFilterLevel = Formatters.TypeFilterLevel.Full
Dim hProps As New Hashtable
hProps.Add("port", 0)
hProps.Add("name", String.Empty)
oChannel = New Channels.Tcp.TcpChannel(hProps, Nothing, oProvider)
'
ChannelServices.RegisterChannel(oChannel)
Dim URL As String = "tcp://localhost:8080/FOSObjectFactory.rem"
Dim oURLAttr As New Activation.UrlAttribute(URL)
Dim ActAttr As Object() = {oURLAttr}
'
Dim oFactoryHandle As ObjectHandle = Activator.CreateInstance("Rabobank.Sky.FOSObjectFactory", "Rabobank.Sky.FOSObjectFactory.IFOSObjectFactory", True, Reflection.BindingFlags.CreateInstance Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.Public, Nothing, Nothing, Nothing, ActAttr, Nothing)
oPiFactory = DirectCast(oFactoryHandle.Unwrap, IFOSObjectFactory)


Service Code:
oProvider.TypeFilterLevel = Formatters.TypeFilterLevel.Full
Dim hProps As New Hashtable
hProps.Add("port", 8080)
hProps.Add("name", "SkyTCPServer")
oChannel = New Channels.Tcp.TcpChannel(hProps, Nothing, oProvider)
'
ChannelServices.RegisterChannel(oChannel)
Dim remoteType As New WellKnownServiceTypeEntry(GetType(IFOSObjectFactory), "FOSObjectFactory.rem", WellKnownObjectMode.Singleton)
RemotingConfiguration.RegisterWellKnownServiceType(remoteType)


Remote Class:
Public Class IFOSObjectFactory : Inherits MarshalByRefObject
'
Shared Sub New()
End Sub


Thanks in advance

--------------------------------
From: Malcolm Cudworth

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>VIh35Fxk9E+Q+FizcEyWpA==</Id>
1 Answer

Sunny

7/6/2004 2:48:00 PM

0

Hi,
use Activator.GetObject(type, url)

Sunny