The Web Service Stack. • WS-Notification. • Application to the case study. – WS-
Notification Server. – WS-Notification on Symbian OS. – Implementation on the ...
The Web Service Stack on Symbian OS
Marco Aiello VITALab --- TUWien (A) & DIT --- Universita’ di Trento (I)
[email protected]
Summary • The Web Service Stack • WS-Notification • Application to the case study – WS-Notification Server – WS-Notification on Symbian OS – Implementation on the Nokia 6600 series
© Aiello 2005
Layers Applications, services
Middleware
Operating system Platform Computer and network hardware © Aiello 2005
ISO Open Systems Interconnection model Message received
Message sent Layers Application Presentation Session Transport Network Data link Physical Sender
Communication medium
© Aiello 2005
Recipient
OSI protocol summary Layer Application Presentation Session Transport Network Data link Physical
Description Protocols that are designed to meet the communication requirements of specific applications, often defining the interface to a service. Protocols at this level transmit data in a network representation that is independent of the representations used in individual computers, which may differ. Encryption is also performed in this layer, if required. At this level reliability and adaptation are performed, such as detection of failures and automatic recovery. This is the lowest level at which messages (rather than packets) are handled. Messages are addressed to communication ports attached to processes, Protocols in this layer may be connection-oriented or connectionless. Transfers data packets between computers in a specific network. In a WAN or an internetwork this involves the generation of a route passing through routers. In a single LAN no routing is required. Responsible for transmission of packets between nodes that are directly connected by a physical link. In a WAN transmission is between pairs of routers or between routers and hosts. In a LAN it is between any pair of hosts. The circuits and hardware that drive the network. It transmits sequences of binary data by analogue signalling, using amplitude or frequency modulation of electrical signals (on cable circuits), light signals (on fibre optic circuits) or other electromagnetic signals (on radio and microwave circuits). © Aiello 2005
Examples HTTP,FTP , SMTP, CORBA IIOP Secure Sockets (SSL),CORBA Data Rep.
TCP, UDP IP, ATM virtual circuits Ethernet MAC, ATM cell transfer, PPP Ethernet base- band signalling, ISDN
Middleware • Middleware: software layer which abstracts from network hardware, computing hardware, operating systems, programming languages and different implementations providing a uniform computational model • Examples, CORBA, Java RMI, DCOM, … • Middleware provides API to enable the communication of processes as a result of application requests relying on the transport layer © Aiello 2005
Middleware ISO/OSI
Applications, services RMI and RPC request-reply protocol
7 Middleware
6
marshalling and external data representation UDP and TCP
© Aiello 2005
4
Web Service • Web Services are a form of middlewere in which the abstraction from the implementation is even greater • Web Services are a family of XML-based languages for describing, publishing and binding loosely-coupled applications over the Internet © Aiello 2005
Definition (W3C) • Web service: a software applicatgion indentified by a URI, whose interfaces and bindings are capable of being defined, described and discovered as XML artifacts. A web service supports direct interactions with other software agents using XML-based messages exchanged via Internet-based protocols. © Aiello 2005
Web Service stack
© Aiello 2005
SOAP • Message format for one way communication • A set of conventions for RPC interaction pattern for client and servers • A set of rules for processing the messages (errors) • Description on how to transport the messages on top of HTTP, SMTP, etc. © Aiello 2005
QoS • A number of protocols for describing nonfunctional properties of services including: – Security – Transactionality – Poilicies
• And for defining Service Level Agreements
© Aiello 2005
WSDL • An interface definition language relaying on a type system • Abstract part: – types, messages, operations, porttypes
• Concrete part: – Bindings servics and ports
© Aiello 2005
UDDI • A business registry for the publication and discovery of services • Composed of – White pages: name listings – Yellow pages: taxonomy based – Green pages: technical details
© Aiello 2005
An example: Google’s web services • Google offers the possibility of performing 1000 queries per day via its freely available web services
GoogleSearch.wsdl
© Aiello 2005
SOAP Request 00000000000000000000000000000000
shrdlu winograd maclisp teletype
0 10 true false latin1 latin1
© Aiello 2005
But what’s behind a service? • http://www.mturk.com/
AWSMechanicalTurkRequester.wsdl
© Aiello 2005
BPEL • For the definition of processes, both abstract and executable • Roles of parties involved in the message exchange in the process • Port types that must be supported • Orchestration context • Correlation of information defining how messages can be routed to correct composition instances • State based system © Aiello 2005
Publish and Subscribe • For mobile devices and pervasive computing, process execution and orchestration are not the only coordination means • Asynchrnous event publishing and subscription mechanisms are paramount!
© Aiello 2005
The Domotic Web Service Stack WS-Notification
Coordination
WSDL, WS-Policy, UDDI
Service Description
WS-Agreement, WS-QoS, WS-Security
Quality of Service
SOAP device dependent Bluetooth
HTTP WiFi
GPRS
© Aiello 2005
Transport and Encoding Network
Home outgoing connection
Web Service Stack Implementators as server
Home open network
Web Service Stack Implementators as clients
Device connections
Devices and Actuators © Aiello 2005
WS-Notification • Topic based publish and subscribe mechanism • Includes three specifications: – WS-Base Notification • WS interfaces for point to point communication, operations and message structure
– WS-Brokered Notification • WS interfaces for broker
– WS-Topics • Tree structure, metadata and subscription expression © Aiello 2005
Known implementations • Used in the Globus Toolkit for notification in GRIDs (no broker server implemented) • WS-Messenger (WSMG) at Indiana University, an open source prototype • Zanoni’s implementation at Univ. of Trento for the Domotic scenario
© Aiello 2005
© Aiello 2005
The use of WS-Notification for the case study • A WS server connected to the sensors • A number of WS clients: – – – –
Java implementation for Palm OS C++ implementation for 60SDK C++ implementation for UIQ (in preparation) .Net implementation for Windows Mobile (in preparation)
© Aiello 2005
© Aiello 2005
The Server Listens for registrations and sensor events Socket info; ServerSocket ss = new ServerSocket(Property.listeningPort); while (true){ info = ss.accept(); RegisterSubscriptionNotifyThread registerSubscriptionNotifyThread=new RegisterSubscriptionNotifyThread (info,eventSubscriptionTree); registerSubscriptionNotifyThread.start(); } © Aiello 2005
The client’s registration Registration and port on which client is listening for events hostName:port
© Aiello 2005
The client’s registration Selecting a topic and an expiration for the registration “esns:eventPath” xmlDate © Aiello 2005
WS-Topic LISTING ONE
© Aiello 2005
Registrations LISTING TWO © Aiello 2005
Implementing the Symbian client
Thanks to Michele Iannotta for the code http://dit.unitn.it/~aiellom/tesi/iannottaCodice.zip © Aiello 2005
Application architecture
© Aiello 2005
© Aiello 2005
Active Objects CHomeSEngine creates the socket server session creates and connects the socket for server communication manages feedback from socket reader and socket writers informs the UI of visualization tasks
CSocketsReader sends asynchronous requests for reading from the socket server reports data or communication errors to the CHomeSEngine through the MEngineNotifier interface
CSocketsWriter sends asynchronous requests for writing on the socket server reports data or communication errors to the CHomeSEngine through the MEngineNotifier interface © Aiello 2005
© Aiello 2005
CHomeSEngine
HomeSEngine.cpp
© Aiello 2005
© Aiello 2005
CSocketReader
SocketsReader.cpp
© Aiello 2005
© Aiello 2005
CSocketWriter
SocketsWriter.cpp
© Aiello 2005
An example
© Aiello 2005
Home outgoing connection
Web Service Stack Implementators as P2P on the home open network
Device connections
Devices and Actuators © Aiello 2005
Discussion • We have implemented the web service stack on a symbian mobile device in the context of a domotic application • But the techniques is general • Symbian is suitable given the attention in resource management, in particular, battery, memory, processing time active objects and leaves © Aiello 2005
Discussion • We should build the WS Stack on Symbian for any P2P application • The important issues are: – XML processing – Portability – Smart use of active objects
© Aiello 2005
Discussion • Disadvantages of this approach are in the high cost of message exchange: – XML messages are heavy to parse – XML messages may be unecessarly big
The price to pay for interoperability?
© Aiello 2005
Discussion • Other possibility for using the WS stack on a mobile device are: – Java (e.g. for Palm OS) • http://java.sun.com/products/wsa/
– .Net (e.g. for iMate poketPC) • http://msdn.microsoft.com/library/default.asp?url=/library/enus/dnppcgen/html/devsmartphone.asp • http://msdn.microsoft.com/library/default.asp?url=/library/enus/dnnetcomp/html/compactfxtechart.asp
© Aiello 2005