Download presentation
Presentation is loading. Please wait.
Published byAmberly Catherine Wade Modified over 9 years ago
1
.NET Remoting in Delphi and C# Alain “Lino” Tadros President & CEO Falafel Software Inc. ComponentScience Inc. BORCON 2004
2
Agenda.NET Distributed Applications Using Remoting Providing objects Configuring Cross platform Performance Extensibility
3
.NET Remoting And SOAP SoapFormatter and HttpChannel do the hard work Complete SOAP 1.1 implementation Primitives (int, float, string, etc) Single and multi dimensional arrays of Simple types and Objects. Objects and References to Objects (also covers Structs / Value types), Trees of Objects, Graphs of Objects Enumerations, SOAP Faults
4
.NET Distributed Applications ASP.NET Web Services XML Schema compliance SOAP 1.2 compliance Great tool support Better documentation.NET Remoting Full object fidelity Flexibility in formatting Flexibility in transport Singletons Custom hosting Client-activated
5
.NET Remoting Terminology Channel: protocol used to carry a message (HTTP, TCP) Formatter: strategy used to create a message (SOAP, binary) Marshalling: moving an object from one AppDomain to another (Marshal by Reference, Marshal by Value)
6
Building Remoteable Objects Marshal by Reference Inherit from MarshalByRefObject (or a child) Marshal by Value Implement ISerializable Mark class with SerializableAttribute
7
Hosting objects Internet Information Services (IIS) Custom Hosts Manually Configuring Text-based Configuration Windows 2003 Server COM+ Services
8
Host Configuration files <wellknown mode="SingleCall" type="Hello.HelloService, Hello" objectUri="HelloService.soap“/> In web.Config or host config file Wellknown objects can be SingleCall or Singleton Type must be typename, assembly ObjectUri must end with.soap or.rem
9
Hosting in XP COM+ Services Turn a COM+ Application of COM+ Components into Web Services Just click in the COM+ Admin Tool Application Activation Tab Configures the COM components for.NET Remoting Automatically Creates IIS Virtual Directory Generates web.config Generates metadata Ships in Windows XP / Windows Server 2003 Uses.NET Remoting Framework HTTP, SOAP and WSDL
10
Using Activator Use Activator.GetObject to get instance Doesn’t use new operator Type type = typeof(HelloService); String url = "http://localhost/RemotingHello/HelloService.soap"; HelloService helloService = (HelloService) Activator.GetObject(type, url);
11
Accessing objects Server activated objects Single Call Singleton Client activated objects Accessing Via code With configuration files Windows XP moniker
12
SoapSuds Clients need metadata at compile time What about metadata for remote object? Soapsuds utility ships with.NET SDK Create Assemblies, Schema, or C# code from WSDL soapsuds -url:http://localhost/RemotingHello/HelloService.soap?WSDL -oa:Hello.dll
13
Accessing through code No Config File necessary Requires recompile to change uri After registering type, just use new Type type = typeof(HelloService); String url = “http://localhost/RemotingHello/HelloService.soap"; ChannelServices.RegisterChannel( new TcpChannel() ); RemotingConfiguration.RegisterWellKnownClientType( type, url ); HelloService helloService = new HelloService();
14
Using Client Config Files Easy and Flexible Configuration Can be changed without recompile Select channel and formatter After loading config file, just use new … RemotingConfiguration.Configure(configFilename); HelloService helloService = new HelloService(); <wellknown type="Hello.HelloService, Hello" url="http://localhost/RemotingHello/HelloService.soap" />
15
Accessing from XP COM COM SOAP Moniker Make SOAP calls from COM to Web Services GetObject(“soap:wsdl=http://url_to_wsdl”) Downloads WSDL Uses Remoting Metadata Proxy Generation engine to turn WSDL into TLB – saved to disk Returns a Remoting Proxy to COM caller Calls on Proxy sent over HTTP SOAP using Remoting
16
Object Lifetime Leased based lifetime Singletons Client-Activated Sponsors
17
Interoperability SOAP Builders www.xmethods.net/ilab www.xmethods.net/ilab Microsoft, IBM, Borland, ActiveState, HP, Glue, SOAP::Lite (perl), PockeSOAP, many, many others
18
Performance Intra-Remoting Comparing formatters, channels Versus ASP.NET Web Services Versus DCOM Your mileage will vary
19
.NET Remoting Architecture X = Add(5, 2) Int Add(int x, int y) Formatter SOAP BinaryBinary ProxyDispatcher Channel HTTPTCPYourChannel
20
Extensibility Custom Formatters Replace SOAP, Binary formatters Custom Channels Replace HTTP, TCP channel Channel Sinks Extend existing channels Message Sinks Extend existing formatters
21
Channel Sink Allow you to extend or modify communication Plugs into existing communication channel Tracing, encryption, security, …
22
Summary Use.NET Remoting when: You need to get a message between AppDomains You need flexibility in message formatting or transport Resources: www.dotnetremoting.cc
23
Questions? http://www.falafelsoft.com/Flogs
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.