To get the best of both worlds—that is, cross-platform compatibility and performance—you can access web services from .NET remoting. Imagine a scenario in which a service is not only provided to the world at large, but internally—within the company providing it. There is no reason why the internal clients should suffer from potential performance problems and implementation limitations because the objects they need are web services.
Achieving this compatibility takes little effort. Just add an additional attribute to the web method to let it know that RPC-encoding is needed. The attribute is called SoapRpcMethodAttribute, and it is applied like this:
<SoapRpcMethod( ), _ WebService(Namespace:="http://www.mydomainhere.com/")> _ Public Class ZipService : Inherits MarshalByRefObject
Additionally, the class needs to derive from MarshalByRefObject. If not, SoapSuds generates the wrong type of proxy.
A Web.config file must be provided for the web service (placed into the ZipService virtual directory) to register any channels that might be needed and to define well-known object entries. In Example 10-4, a TCP channel is configured to listen on port 1969 and a Singleton that is accessible at ZipService.soap is specified for ZipService.
<configuration> <system.runtime.remoting> <application> <channels> <channel ref="tcp" port="1969" /> </channels> <service> <wellknown mode="Singleton" ...