73
Web Services Web Services Giuseppe Attardi Giuseppe Attardi Università di Pisa Università di Pisa

Web Services Web Services Giuseppe Attardi Università di Pisa

  • View
    217

  • Download
    1

Embed Size (px)

Citation preview

Web ServicesWeb Services

Giuseppe AttardiGiuseppe Attardi

Università di PisaUniversità di Pisa

OverviewOverview

From COMponents to .NETFrom COMponents to .NETWeb Services ArchitectureWeb Services ArchitectureDemoDemoReflection and MetadataReflection and Metadata2-Way Web2-Way WebOpen IssuesOpen Issues

Software ComponentsSoftware Components

COM class: body of source code that COM class: body of source code that implements COM interfacesimplements COM interfaces

provides real functions in any supported provides real functions in any supported programming language for each interface programming language for each interface method it supportsmethod it supports

each COM class has a unique identifier each COM class has a unique identifier (CLSID)(CLSID)

client asks COM to create an object and client asks COM to create an object and return interface pointerreturn interface pointer

client applications interact with COM client applications interact with COM objects through interface pointersobjects through interface pointers

COM Classes and ServersCOM Classes and Servers

client not dependent on implementation details of client not dependent on implementation details of COM COM

COM servers:COM servers:– in-process server: DLL loaded into client in-process server: DLL loaded into client

process calls go directly to object created in process calls go directly to object created in the client's processthe client's process

– out-of-process server: separate executable, out-of-process server: separate executable, either on same machine as a client or on either on same machine as a client or on remote machine; calls go first to an in-process remote machine; calls go first to an in-process proxy which uses RPC; in the server, stub proxy which uses RPC; in the server, stub object receives each incoming call and object receives each incoming call and dispatches to appropriate COM objectdispatches to appropriate COM object

ActiveX control is in-process COM server objectActiveX control is in-process COM server object

ClassFactory

COM

2. Find the server3. Load DLL or launch EXE4. Retrieve Class Factory5. Ask Factory to create

6. Invoke request directly

Server

1. Create an object

ObjectClient

Object CreationObject Creation

EngineFactory

Engine_2

ClassesInterfaces

IEngine

IUnknownEngine_1

IEngine

IUnknown

IEngine

Start()Stop()AddFuel()GetType()ChangeSpeed()

Implements

IUnknown

QueryInterface()AddRef()Release()

Inheritsfrom

Engine Class

IUnknownimpl.

IEngineImpl.

Objects

Interfaces, Classes and FactoriesInterfaces, Classes and Factories

COM interface defines behavior or COM interface defines behavior or capabilities of software component capabilities of software component as a set of methods and propertiesas a set of methods and properties

interface is contract that guarantees interface is contract that guarantees consistent semanticsconsistent semantics

each COM object must support at each COM object must support at least one interface (IUnknown)least one interface (IUnknown)

COM InterfacesCOM Interfaces

COM pros/consCOM pros/cons

PROsPROs– Access to OS functionality– Faster and easier to write apps– Third-party COM components

CONsCONs– Requires infrastructure and tools– Client/server kept separate (e.g.

different strings implementations)– DLL hell

History of Distributed Object ModelsHistory of Distributed Object Models

Communication Protocol Models:Communication Protocol Models:– Message passing/queueing (DCE)– Request/response (RPC)

19801980model based on network model based on network layer (NFS, DCE RPC)layer (NFS, DCE RPC)

19901990object-oriented RPC, to link object-oriented RPC, to link objectsobjects

CLIENT

client stub

wire protocol

server stub

wire protocol

Network

SERVERoperation()

reply

Middle layer

Bottom layer

Top layer

Remote Procedure CallRemote Procedure Call

ORPCORPC

ORPC codify mappings between objects at ORPC codify mappings between objects at language levellanguage level

Server-side middlewareServer-side middleware locate and locate and instantiate object in target processinstantiate object in target process

Microsoft DCOM and CORBA IIOP were Microsoft DCOM and CORBA IIOP were dominating ORPC protocolsdominating ORPC protocols

CORBACORBA

OMG’s specification for OMG’s specification for interoperability between distributed interoperability between distributed computing nodescomputing nodes

Goal: heterogeneous environments Goal: heterogeneous environments communicating at the object level, communicating at the object level, regardless of implementation of regardless of implementation of endpointsendpoints

ORB: middleware that establishes ORB: middleware that establishes requestor-provider relationshiprequestor-provider relationship

ORBORB

Receives invocation message to Receives invocation message to invoke specified method for invoke specified method for registered objectregistered object

Finds object, unmarshals Finds object, unmarshals parameters, invokes method, parameters, invokes method, marshals and returns resultsmarshals and returns results

Requester needs not to be aware of Requester needs not to be aware of location, language or OS of objectlocation, language or OS of object

CORB ArchitectureCORB Architecture

Interface Definition LanguageInterface Definition Language

Language neutral specificationLanguage neutral specification

interface Polynomial : MathObject {sequence<Monomial> monomials;int rank;Polynomial add(in Polynomial p);

};

Mappings to several languagesMappings to several languages Tools (compilers) generate stubs and Tools (compilers) generate stubs and

skeletons in various languagesskeletons in various languages

Note. No way to know at run-time which Note. No way to know at run-time which interfaces an objects provides: IDL gets interfaces an objects provides: IDL gets compiled awaycompiled away

DCOM distributed extension to COMDCOM distributed extension to COMbuilds an ORPC layer on top of DCE builds an ORPC layer on top of DCE

RPCRPCCOM server can create object COM server can create object

instances of multiple object classesinstances of multiple object classesCOM object supports multiple COM object supports multiple

interfaces, representing different interfaces, representing different view or behavior of the objectview or behavior of the object

interface consists of a set of interface consists of a set of functionally related methodsfunctionally related methods

DCOMDCOM

interfaces described using MIDLinterfaces described using MIDLMIDL compiler generates proxy and MIDL compiler generates proxy and

stub code in C or C++ from interface stub code in C or C++ from interface definitiondefinition

generated proxy code provides generated proxy code provides client-side APIclient-side API

stub objects decode incoming client stub objects decode incoming client requests and deliver to appropriate requests and deliver to appropriate object in the serverobject in the server

DCOM InterfacesDCOM Interfaces

COM client interacts with COM object by COM client interacts with COM object by acquiring a pointer to an object's interface acquiring a pointer to an object's interface and invoking methods through that and invoking methods through that pointer, as if the object resides in the pointer, as if the object resides in the client's address spaceclient's address space

interfaces follow standard memory layout, interfaces follow standard memory layout, same as C++ vtablesame as C++ vtable

specification at binary levelspecification at binary level integration of binary components in integration of binary components in

different languages (C++, Java, Visual different languages (C++, Java, Visual Basic)Basic)

DCOM ArchitectureDCOM Architecture

proxy and stub code interact with appropriate proxy and stub code interact with appropriate runtime libraries to exchange requests and runtime libraries to exchange requests and responsesresponses

each interface has UUIDeach interface has UUID QueryInterface method of IUnknownQueryInterface method of IUnknown QueryInterface returns an interface pointerQueryInterface returns an interface pointer interface pointer points to COM binary data interface pointer points to COM binary data

structurestructure client application must know CLSID and IID for an client application must know CLSID and IID for an

interfaceinterface standard dictates interface functions calling standard dictates interface functions calling

conventionsconventions

DCOM OverviewDCOM Overview

CORBA / COM interoperabilityCORBA / COM interoperability

Naming of communication Naming of communication endpoints:endpoints:– CORBA: Interoperable Object Reference– DCOM: OBJREFs (include reference

counting)Support for multiple interfaces (only Support for multiple interfaces (only

in DCOM)in DCOM)Format of payload parameter values:Format of payload parameter values:

– DCOM: Network Data Representation– CORBA: Common Data Representation

ActiveXCOM client

OLEAutomation

OSA

COM

The object bridge

COMOSA

CORBAOSA

CORBA object

CORBA IIOPCORBA

Translate call

Machine 1 Machine 2

COM-CORBA InteroperationCOM-CORBA Interoperation

CORBA and DCOM limitationsCORBA and DCOM limitations

DCOM platform limitationDCOM platform limitationCORBA, subtle incompatibilities CORBA, subtle incompatibilities

require ORB from same vendorrequire ORB from same vendorReliance on closely administered Reliance on closely administered

environmentsenvironments– IIOP must cross firewalls

Programming difficulties in data Programming difficulties in data alignment and data typesalignment and data types

Quest for Net ObjectsQuest for Net Objects

19931993 COMCOM19961996 JavaJava19971997 Mary Kirtland’s articles in Mary Kirtland’s articles in

MS MS System Journal present System Journal present first first sketch (COM+)sketch (COM+)

19971997 Sun vs Microsoft over Java Sun vs Microsoft over Java licensinglicensing

19991999 Java 1.2Java 1.220002000 MS announces .NET, CLR, MS announces .NET, CLR,

C#C#

Web ComputingWeb Computing

Programming with distributed Programming with distributed components on the Web:components on the Web:– Heterogeneous– Distributed– Multi-language

Beyond browsingBeyond browsing

Access and act on informationAccess and act on informationMore control, better decision-making More control, better decision-making

and easier collaborationand easier collaborationOptimal support for different devicesOptimal support for different devicesOpen to partners: each can build its Open to partners: each can build its

portion of the applicationportion of the application

Classes of UseClasses of Use

Web ServicesWeb Services2-way Web2-way Web

– Full interactive capabilities of desktop applications

Web ServicesWeb Services

Web Service: DefinitionsWeb Service: Definitions

Component for Web ProgrammingComponent for Web ProgrammingSelf-contained, self-describing, Self-contained, self-describing,

modular component that can be modular component that can be published, located, and invoked published, located, and invoked across the Webacross the Web

Web Services: PropertiesWeb Services: Properties

can be used either internally or can be used either internally or exposed externally over the Internetexposed externally over the Internet

accessible through a standard accessible through a standard interfaceinterface

allows heterogeneous systems to allows heterogeneous systems to work together as a single web of work together as a single web of computation computation

PropertiesProperties

Loosely coupledLoosely coupledUbiquitous communicationUbiquitous communicationUniversal data formatUniversal data format

Service-Oriented ArchitectureService-Oriented Architecture

ServiceBroker

ServiceUser

ServiceProvider

Find

Pub

lish B

ind

Web Service ScenarioWeb Service Scenario

Provider builds and defines the Provider builds and defines the service in WSDLservice in WSDL

Provider registers the service in Provider registers the service in UDDIUDDI

User finds the service by searching User finds the service by searching UDDI registryUDDI registry

User application binds to the Web User application binds to the Web service and invokes its operations service and invokes its operations via SOAPvia SOAP

Web Service ArchitectureWeb Service Architecture

ServiceBroker

ServiceUser

ServiceProvider

UDDI/WSDLFind

Pub

lish

UD

DI

Bind

SO

AP

Communication: HTTP

Data: XML

Interactions: SOAP

DiscoveryDiscovery

Let me talk to you (SOAP)Let me talk to you (SOAP)

Web Services ProtocolsWeb Services Protocols

How do we talk? (WSDL)How do we talk? (WSDL)

Web Web ServiceService

WebWebService Service

ConsumerConsumer

WebWebService Service

ConsumerConsumer

UDDIUDDI

Find a ServiceFind a Service

return service response (XML)return service response (XML)return service response (XML)return service response (XML)

http://yourservice.com/svc1http://yourservice.com/svc1

return service descriptions (XML)return service descriptions (XML)return service descriptions (XML)return service descriptions (XML)

http://yourservice.com/?WSDLhttp://yourservice.com/?WSDL

HTML with link to WSDLHTML with link to WSDLHTML with link to WSDLHTML with link to WSDL

http://yourservice.comhttp://yourservice.com

http://www.uddi.orghttp://www.uddi.org

Link to discovery documentLink to discovery documentLink to discovery documentLink to discovery document

Infrastructure ElementsInfrastructure Elements

DirectoriesDirectoriescentral location to locate Web Services central location to locate Web Services provided by other organizations (e.g. provided by other organizations (e.g. UDDI UDDI registry)registry)

DiscoveryDiscoverylocating WSDL for a particular Web locating WSDL for a particular Web

ServiceServiceDescriptionDescription

defines what interactions the Web defines what interactions the Web Service supportsService supports

Wire FormatsWire Formatsenable universal communication (e.g. enable universal communication (e.g.

SOAP)SOAP)

SOAPSOAP

Wire-protocol based on XML and HTTP Wire-protocol based on XML and HTTP that consists of:that consists of:– an envelope for describing what is in a

message and how to process it– a set of encoding rules for expressing

instances of application-defined data types

– a convention for representing remote procedure calls and responses

Sample SOAP requestSample SOAP request

POST /CurrencyServer/CurrencyExchange.asmx HTTP/1.1POST /CurrencyServer/CurrencyExchange.asmx HTTP/1.1Host: theseusHost: theseusContent-Type: text/xml; charset=utf-8Content-Type: text/xml; charset=utf-8Content-Length: lengthContent-Length: lengthSOAPAction: SOAPAction: http://di.unipi.it/webservices/Eurohttp://di.unipi.it/webservices/Euro

<?<?xml version="1.0" encoding="utf-8"?xml version="1.0" encoding="utf-8"?>> <<soap:Envelopesoap:Envelope xmlns:xsi=xmlns:xsi=http://www.w3.org/2001/XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instance xmlns:xsd=xmlns:xsd=http://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchema xmlns:soap=xmlns:soap=http://http://schemas.xmlsoap.orgschemas.xmlsoap.org/soap/envelope/soap/envelope>> <<soap:Bodysoap:Body>> <<Euro xmlns=Euro xmlns=http://http://di.unipi.it/webservicesdi.unipi.it/webservices>> <<currencycurrency>>stringstring</</currencycurrency>> </</EuroEuro>> </</soap:Bodysoap:Body>></</soap:Envelopesoap:Envelope>>

Sample SOAP replySample SOAP reply

HTTP/1.1 200 OKHTTP/1.1 200 OKContent-Type: text/xml; charset=utf-8Content-Type: text/xml; charset=utf-8Content-Length: lengthContent-Length: length<?<?xml version="1.0" encoding="utf-8"xml version="1.0" encoding="utf-8"?>?>

<<soap:Envelopesoap:Envelope xmlns:xsi=xmlns:xsi=http://www.w3.org/2001/XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instance xmlns:xsd=xmlns:xsd=http://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchema xmlns:soap=xmlns:soap=http://http://schemas.xmlsoap.orgschemas.xmlsoap.org/soap/envelope/soap/envelope>> <<soap:Bodysoap:Body>> <<EuroResponse xmlns=http://di.unipi.it/webservicesEuroResponse xmlns=http://di.unipi.it/webservices>> <<EuroResultEuroResult>>doubledouble</</EuroResultEuroResult>> </</EuroResponseEuroResponse>> </</soap:Bodysoap:Body>></</soap:Envelopesoap:Envelope>>

Other .NET Wire-ProtocolsOther .NET Wire-Protocols

HTTP GETHTTP GETHTTP POSTHTTP POSTSMTPSMTP… … customizedcustomized

Web Service Description LanguageWeb Service Description Language

WSDL StructureWSDL Structure

TypesTypes Data type definitionsData type definitions

MessageMessage Signature of request and Signature of request and reply for each method (reply for each method (≈≈ IDL) IDL)

Port TypePort Type <service, protocol> <service, protocol> operationsoperations

OperationOperation method method messages messages

BindingBinding Protocol and data-format Protocol and data-format specificationspecification

ServiceService { Port { Port binding } binding }

PortPort Address (≈ Address (≈ URL)URL)

WSDL exampleWSDL example

Currency Exchange ServiceCurrency Exchange ServiceMethodsMethods

double Rate(String From, String To)double Euro(String Currency)

Service URLService URLhttp://theseus/CurrencyServer/CurrencyExchange.asmx

WSDL exampleWSDL example

<message name="RateSoapIn"><message name="RateSoapIn">    <part name="parameters" element="s0:Rate" /> <part name="parameters" element="s0:Rate" />     </message></message> <message name="RateSoapOut"><message name="RateSoapOut">    <part name="parameters" element="s0:RateResponse" /> <part name="parameters" element="s0:RateResponse" />     </message></message> <message name="EuroSoapIn"><message name="EuroSoapIn">    <part name="parameters" element="s0:Euro" /> <part name="parameters" element="s0:Euro" /> </message></message><message name="EuroSoapOut"><message name="EuroSoapOut">    <part name="parameters" element="s0:EuroResponse" /> <part name="parameters" element="s0:EuroResponse" />     </message></message> <message name="RateHttpGetIn"><message name="RateHttpGetIn">    <part name="from" type="s:string" /> <part name="from" type="s:string" />     <part name="to" type="s:string" /> <part name="to" type="s:string" />     </message></message> <message name="RateHttpGetOut"><message name="RateHttpGetOut">    <part name="Body" element="s0:double" /> <part name="Body" element="s0:double" /> </message></message><message name="EuroHttpGetIn"><message name="EuroHttpGetIn">    <part name="currency" type="s:string" /> <part name="currency" type="s:string" /> </message></message><message name="EuroHttpGetOut"><message name="EuroHttpGetOut">    <part name="Body" element="s0:double" /> <part name="Body" element="s0:double" /> </message></message><message name="RateHttpPostIn"><message name="RateHttpPostIn">    <part name="from" type="s:string" /> <part name="from" type="s:string" />     <part name="to" type="s:string" /> <part name="to" type="s:string" /> </message></message><message name="RateHttpPostOut"><message name="RateHttpPostOut"> <part name="Body" element="s0:double" /> <part name="Body" element="s0:double" /> </message></message><message name="EuroHttpPostIn"><message name="EuroHttpPostIn">    <part name="currency" type="s:string" /> <part name="currency" type="s:string" /> </message></message><message name="EuroHttpPostOut"><message name="EuroHttpPostOut">    <part name="Body" element="s0:double" /> <part name="Body" element="s0:double" /> </message></message>

……

Building A ServerBuilding A Server

SimplicitySimplicity– Source file (plain text = notepad

accessible) – Compiled at run-time similar to ASP.NET

pages– Just hit save

– File extension is .asmx File can be inline or in separate File can be inline or in separate

assemblyassembly

Building TRUSTBuilding TRUST

CLR exposes its elementsCLR exposes its elementsUsers can create elements directlyUsers can create elements directlyEven when using tools, you can look Even when using tools, you can look

at their output and change itat their output and change it

<%@ WebService class=“[class]" %><%@ WebService class=“[class]" %>– Names the class and/or language used

usingusing System.Web.Services; System.Web.Services; – Required namespace

[WebMethod][WebMethod] – Method is ‘web callable’

Optional: WebService base classOptional: WebService base class– Access ASP.NET intrinsics

Building A ServerBuilding A Server

Creating Web Service ClientsCreating Web Service Clients

1.1. Grab WSDL from Web ServiceGrab WSDL from Web Service

2.2. Create proxy from WSDLCreate proxy from WSDL

3.3. Execute methods against proxy, Execute methods against proxy, passing input parameterspassing input parameters

Proxy calls Web Service on your behalf Web Service returns results to proxy

4.4. Retrieve results from proxyRetrieve results from proxy

5.5. Display resultsDisplay results

ASP.NET ClientASP.NET Client

Uses proxy and SOAP protocol to Uses proxy and SOAP protocol to communicate with Web Servicecommunicate with Web Service

Steps:Steps:1. Use wsdl utility to create local proxy

2. Compile proxy using vbc or csc Place compiled proxy assembly in bin folder

of Web

3. Create client Import proxy namespace, code to proxy’s

properties and methods

Using SOAP toolkit (no .NET)Using SOAP toolkit (no .NET)

// allocate a new SoapClient pointer// allocate a new SoapClient pointer m_pClient = new ISOAPClient;m_pClient = new ISOAPClient;

// create the SoapClient pointer// create the SoapClient pointerm_pClient->CreateDispatch("MSSOAP.SoapClient")m_pClient->CreateDispatch("MSSOAP.SoapClient")

// // initialize itinitialize itm_pClient->mssoapinit("http://www.MyService.com/Calc.wsdl", m_pClient->mssoapinit("http://www.MyService.com/Calc.wsdl",

"Calc", "CalcPortType", NULL);"Calc", "CalcPortType", NULL);

// // perform additionperform additiondouble ISOAPClient::Add(double dblA, double dblB, DISPID double ISOAPClient::Add(double dblA, double dblB, DISPID

dispid)dispid) {{

double result;double result;static BYTE parms[] = VTS_R8 VTS_R8;static BYTE parms[] = VTS_R8 VTS_R8;InvokeHelper(dispid, DISPATCH_METHOD, VT_R8, InvokeHelper(dispid, DISPATCH_METHOD, VT_R8, (void*)&result, parms, dblA, dblB);(void*)&result, parms, dblA, dblB);return result;return result;

} }

Client Side?Client Side?

Use HTTP GETUse HTTP GET– handle XML yourself

Use wsdl.exe, generate client-side Use wsdl.exe, generate client-side program, invoke it through Jscriptprogram, invoke it through Jscript

Use ActiveX or JavaUse ActiveX or Java

Microsoft .NETMicrosoft .NET

A software platform for XML Web A software platform for XML Web ServicesServices

Personal RemarksPersonal Remarks

.NET provides plumbing for interesting .NET provides plumbing for interesting new developmentsnew developments

Opportunity for experimenting with new Opportunity for experimenting with new programming languagesprogramming languages

We can start asking questions:We can start asking questions:– what new higher-level facilities can be

designed– how can we contribute: improvements,

extensions, applications Not PDC Questions:Not PDC Questions:

– when it will be available?– Will it have this feature?

Commercial OfferingsCommercial Offerings

.NET.NET http://microsoft.com/nethttp://microsoft.com/net

WebSphereWebSpherehttp://www.ibm.com/webspherehttp://www.ibm.com/websphere

J2EEJ2EE http://java.sun.com/j2eehttp://java.sun.com/j2ee

Role of CLRRole of CLR

RobustnessRobustness– more and more programs run on server– avoid memory leaks

Simplifies programmingSimplifies programming– Avoid burden of reference counting

Reduce incompatibilitiesReduce incompatibilities– Objects are remotely accessible– More easily reproduced if built on same

basic elements

ReflectionReflection

Avoids IDLAvoids IDL– Slight incompatibilities in CORBA

Avoids type librariesAvoids type librariesProvides for dynamic invocationProvides for dynamic invocationAllows customizationAllows customization

– e.g. serialization

Processing inside SOAP ClientProcessing inside SOAP Client

WSDL WSML

WSDLReaderload()

WSDLOperation objectGetOperationParts()

Num. 3Num. 4

Num. 7

Add(3, 4)

Sum

Serializer

Reader

SOAPConnector

SOAP request

SOAP reply

Server-side SOAPServer-side SOAP

WSDL WSML

WSDLReaderParseRequest | load()

WSDLOperation objectExecuteOperation | GetOperationParts()

Num. 3Num. 4

Num. 7Add(3, 4)

SumSerializer

SOAP request

SOAP reply

SoapReaderload()

Reflection in Web ServicesReflection in Web Services

SOAP proxy performs:SOAP proxy performs:– Invoke(m, new object[] {arg1, arg2});

SOAP message dispatcher:SOAP message dispatcher:– parses request– creates parameter objects– determines object requested– instantiates object– gets requested method– invokes method with built parameters

Reflection: Apache SOAPReflection: Apache SOAP

SOAP requests addressed to:SOAP requests addressed to:server:8080//soap/servlet/rpcrouter/server:8080//soap/servlet/rpcrouter/methodmethod

Servlet performs:Servlet performs:– Call c = extractCallFromEnvelope(ServiceManager sm, Envelope e, SOAPContext ctx);

– Response invoke(DeploymentDescriptor dd, Call c, Object o, SOAPContext reqCtx, SOAPContext resCtx) { …m = MethodUtils.getMethod(o, call.getMethodName(), argTypes);

return new Bean(m.getReturnType(), m.invoke(o, args));

}

Meta DataMeta Data

Reflection extracts metadata (no Reflection extracts metadata (no need for separate type library)need for separate type library)

Attributes: turned into metadata Attributes: turned into metadata stored within ILstored within IL

Metadata accessible at runtimeMetadata accessible at runtimeNew attributes can be defined, for New attributes can be defined, for

program useprogram use

int (*fun)(int, char);int (*fun)(int, char);

fun f = someFunction;fun f = someFunction;

f(3,’a’);f(3,’a’);someFunction(3,’a’);someFunction(3,’a’);apply(fun f, void* args) {apply(fun f, void* args) { f(args);f(args);switch (args.lentgh) {switch (args.lentgh) {case 1: return f(args[0]);case 1: return f(args[0]);case 2: return f(args[0], args[1]);case 2: return f(args[0], args[1]);……}}

Use of ReflectionUse of Reflection

Building a high performance search Building a high performance search engineengine

Need way to store and retrieve Need way to store and retrieve objects from relational tableobjects from relational table

Need reflection to serialize objectsNeed reflection to serialize objectsSolution before .NET: template Solution before .NET: template

metaprogrammingmetaprogramming

Music Portal

CustomerCustomer

performs title performs title searchsearch

Service BrokerService Broker

Portal invokesPortal invokessearchsearchWeb ServiceWeb Service

DJInterpool

DeadVinyl

FunkFactory

Service Broker Service Broker invokes search invokes search servicesservices

Services Services respond respond with search with search resultsresults

Deployment ScenarioDeployment Scenario

Dynamic Objects (.NET)Dynamic Objects (.NET)

Dynamic class creationDynamic class creationDynamic class loadingDynamic class loadingNeeded for interactive SQL Needed for interactive SQL

interpreterinterpreter

Two-Way WebTwo-Way Web

Current Web LimitationsCurrent Web Limitations

Thin but weak:Thin but weak:– Not real-time– Not productive– Not interactive

Client cannot initiate actionsClient cannot initiate actionsBrowser pull: waste bandwidthBrowser pull: waste bandwidthJava, ActiveX: maintainability and Java, ActiveX: maintainability and

security restrictionssecurity restrictions

Current SOAPsCurrent SOAPs

SOAP 1.1 specificationsSOAP 1.1 specifications Implementations:Implementations:

– MS SOAP Toolkit 2.0– Apache SOAP 2.2 AXIS (= SOAP 3.0)– SOAP::Lite for Perl– pocketSOAP– GSoap for C++

Apache and MS are working on Apache and MS are working on incompatibilitiesincompatibilities

ConclusionsConclusions

Web Services are quite promisingWeb Services are quite promisingStill missing:Still missing:

– some plumbing, interoperability– 2-way interactivity– unified multistage programming

Issues:Issues:– no more DLL Hell– but maybe, Namespace Hell

ReferencesReferences

StandardsStandards

SOAPSOAP http://www.w3.org/TR/SOAPhttp://www.w3.org/TR/SOAP

WSDLWSDL http://www.w3.org/TR/WSDL

UDDIUDDI http://www.uddi.orghttp://www.uddi.org

PapersPapers1.1. Close up on .NET, DNJ, Close up on .NET, DNJ,

http://www.dnjonline.com/articles/essentials/iss24_essentials.htmlhttp://www.dnjonline.com/articles/essentials/iss24_essentials.html

2.2. M. Kirtland, Object-Oriented Software Development Made Simple with COM+ M. Kirtland, Object-Oriented Software Development Made Simple with COM+ Runtime Services, MSDJ, http://www.microsoft.com/msj/defaultframe.asp?Runtime Services, MSDJ, http://www.microsoft.com/msj/defaultframe.asp?page=/msj/1197/complus.htm&nav=/msj/1197/newnav.htmpage=/msj/1197/complus.htm&nav=/msj/1197/newnav.htm