soapsuds -ia:RemotingServer -nowp -oa:ClientMetaData.dll
Where RemotingServer is your server class name.
ClientMetaData.dll is the DLL name by which you will want to create the metadll.
Server code will change as follows :-
ChannelServices.RegisterChannel(objHttpChannel)
RemotingConfiguration.ApplicationName = “RemoteObject”
RemotingConfiguration.RegisterActivatedServiceType(GetType(InterFaceRemoting.InterFaceRemoting))
Note :- We have to provide applicationname and register the object as ActivatedServiceType.
On client side we have to reference the generated ClientMetaData.dll from SOAPSUDS utility. Below are changes which are needed to be incorporated at the Remoting Client :-
RemotingConfiguration.RegisterActivatedClientType(typeof(RemoteObject),“http://localhost:1234/MyServer”)
Dim objRemoteObject as new RemoteObject().
RemoteObject is class which is obtained from ClientMetaData.dll which we created using SOAPSUDS utility. Now you can reference the object as normal object.
What is fundamental of published or precreated objects in Remoting ?
In scenarios of singleton or single call the objects are created dynamically. But in situations where you want to precreate object and publish it you will use published object scenarios.
Dim obj as new objRemote
obj.Initvalue = 100
RemotingServices.Marshal(obj,”RemoteObject”)
As shown in last post following changes will be needed on server side. RemotingConfiguration.RegisterWellKnownServiceType is replaced by RemotingServices.Marshal(obj,”RemoteObject”) where “obj” is the precreated objected on the server whose value is initialized to 100.
What are the ways in which client can create object on server in CAO model ?
There are two ways by which you can create Client objects on remoting server :-
- Activator.CreateInstance().
- By Keyword “New”.
Are CAO stateful in nature ?
Yes. In CAO remoting model client creates a instance on server and instance variable set by client on server can be retrieved again with correct value.
No comments:
Post a Comment