Finally got round to upgrading to 8.3 and am struggling to understand the changes to the client components mentioned in the 8.2 change log.
Is there documentation anywhere which actually explains these changes fully. All I can find at the moment is the examples which I’m forced to try to reverse-engineer to work out what’s changed.
Firstly, when I recompiled my app using the new components, I found it wasn’t functioning properly. This turned out to be because, in some cases, I was casting a TRORemoteService component to the interface I required but this no longer seems to work. It looks like, previously, I was able to cast a TRORemoteService to any service interface I required, irrespective of the value of its ServiceName property and this would work. With the new components this doesn’t work and I get an error that the function I’m calling can’t be found in the service dictated by the ServiceName property. Possibly this was just a bug which I was inadvertently exploiting and I shouldn’t have been doing that at all.
Secondly, the examples appear to use nothing other than a TDARemoteDataAdapter component. My data adapters are linked to the aforementioned TRORemoteService components via the RemoteService property but this doesn’t seem to be the case with the examples, where this property is empty. This raises two questions - one is how do these standalone data adapters link to the required service (is it via the DataServiceName property). Assuming this is the case an I can remove the TRORemoteService components and instead populate the data adapter’s DataServiceName property, how do I then call remote functions on the server, which I’m currently doing using the method (RemoteService as IMyService).MyFunction? I can’t figure out how to do this when no TRORemoteService component exists.
Thirdly, I’m using additional TROSynapseSuperTCPChannel and TROBinMessage components which again don’t appear to be present in the examples. I notice that the TargetURL property of the data adapters is populated which presumably means they are able to connect without the aid of a separate channel component but, assuming this is the case, how does it determine what type of channel to use?
Basically my app seems to function as before using the existing components but I’m interested to see how the new system works with only data adapter components but I can’t wrap my head around the issues above, hence why I was wondering whether there was some documentation on the new methods, aside from the examples. The documentation pages don’t appear to have been updated to reflect these changes as some of the above new properties don’t exist.
yes, it was a bug. if you want to use old behavior, just uncomment this line in RemObjects.Inc:
// uncomment this line if you have errors like 'Unknown method XXXX for interface YYYY'
// after upgrading from RO8.1- to RO8.2+
{.$DEFINE TROPROXY_IGNORES_REMOTESERVICE_SERVICENAME}
Direct access properties of RDA were introduced as an additional way to simplify creating of simple DA clients.
old behavior with RDA+RemoteService+Message+Channel still works, so you don’t need to change working code.
as you could detect, setting of new RDA properties clears RDA.RemoteService and vice versa so they are incompatible.
Note: you can create IMyService instance via CoMyService.Create instead of calling (RemoteService as IMyService)
by default, indy channels are used, so for ‘supertcp://’ will be used TROSuperTCPChannel in your case.
For advanced configuration, like using synapse channels, you need to use old behavior with RemoteService where you can specify what exactly channel should be used.
as a result, this components set will work without any changes:
I notice there’s an Attributes button and editor against each service in the builder which I don’t think was present before - what’s this for exactly? Just curious.