![Page 1: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/1.jpg)
Publishing and transporting Web Services over XMPP
Johannes Wagener
![Page 2: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/2.jpg)
Web Services – State of the Art
(from Wikipedia)
WSDL:Web Services Description Language
SOAP:Simple Object Access Protocol
UDDI:Universal Description,Discovery and Integration
![Page 3: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/3.jpg)
http is a pull protocol!
Client ServerdoBLAST()
Client(waiting)
Server(working)
doBLAST()
Client(waiting)
Server(working)
doBLAST()
Firewall http timeout
![Page 4: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/4.jpg)
Workaround
Client ServerdoBLAST()
Client(loop)
Server(working)
checkResult(ID)
ClientServer
(finished)
checkResult(ID)
RESULT
“please wait”
(…)
ID
![Page 5: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/5.jpg)
Next generation of Web Services
should ...• be a properly and strictly defined standard• allow stateful job management• allow asynchronous client notification• be discoverable• have big user community with a lot of software
![Page 6: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/6.jpg)
About XMPP
• The Extended Messaging and Presence Protocol
• Formerly known as Jabber
• Invented by Jeremie Miller in 1998
• Formalized by the Internet Engineering Task Force since 2004
• RFC 3920 – 3923, 4622
• XMPP Standards Foundation continues to define various XMPP Extensions
• “…a protocol for streaming XML elements in order to exchange structured information in close to real time between any two network endpoints.
While XMPP provides a generalized, extensible framework for exchanging XML data, it is used mainly for the purpose of building instant messaging and presence applications.” (from RFC 3920)
![Page 7: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/7.jpg)
(from Wikipedia)
![Page 8: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/8.jpg)
XMPP Architecturesimilar to Email …
server2.org
server1.com
server3.net
![Page 9: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/9.jpg)
XMPP Architectureone user can connect with different resources
server2.org
server1.com
server3.net
[email protected]/[email protected]/home
User ID Server Resource
![Page 11: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/11.jpg)
XMPP ArchitectureUse cases of Server Components
server3.net
msn.server3.netconference.server3.net
![Page 12: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/12.jpg)
XMPP Architecturepresent
jabber.org
![Page 13: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/13.jpg)
XMPP Architecturepresent
jabber.org
googlemail.com
![Page 14: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/14.jpg)
XMPP Architecturepresent
jabber.org
googlemail.comgmx.net
![Page 15: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/15.jpg)
… but many unofficial servers, too.
![Page 16: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/16.jpg)
Clients
![Page 17: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/17.jpg)
Servers
![Page 18: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/18.jpg)
ServersClusterable
![Page 19: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/19.jpg)
Libraries
• 3 x .NET• 3 x C• 2 x C#• 7 x C++• 3 x COM• 2 x Delphi• 1 x Flash• 9 x Java• 1 x Java Script
• 1 x Lisp• 1 x Mono• 5 x Perl• 2 x PHP• 4 x Python• 2 x Ruby• 1 x TCL• 1 x XPCom
![Page 20: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/20.jpg)
The Protocol
• An inbound and outbound “XML Stream”
• Client connections are usually done with TCP. However there are no restrictions; i.e. many server allow polling over HTTP
• Streams may be encrypted in various formats
• Packets are sent as “stanzas”
• There are three top level stanzas:
<message/> … to submit messages
<presence/> … to submit presence information
<iq/> … for everything else – and that’s a lot
![Page 21: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/21.jpg)
Simplified Stream Example...with two <message/> stanzas
(from RFC 3920)
![Page 22: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/22.jpg)
C: <iq from='[email protected]/balcony' to='server.org' type='get' id='request_1'> <query xmlns='jabber:iq:version'/> </iq>
S: <iq type='result' from='server.org' to='[email protected]/balcony' id='request_1'> <query xmlns='jabber:iq:version'> <name>ejabberd</name> <version>1.1.2</version> <os>win32/nt5.1.2600</os> </query> </iq>
Information Query: <iq/>
![Page 23: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/23.jpg)
XMPP Extensions Protocol (XEPs)
(…)
http://www.xmpp.org/extensions
![Page 24: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/24.jpg)
(Web) Service Discovery
There are three kinds of information that needto be discovered about an entity
• its basic identity (type and/or category)• the features it offers and protocols it supports • any additional items associated with the entity,
whether or not they are addressable as JIDs
![Page 25: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/25.jpg)
Web Service related XEPs
} Asynchronous +Stateful -Discoverable -
Asynchronous +Stateful +Discoverable +
![Page 26: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/26.jpg)
Ad-Hoc CommandsC: <iq type='set' from='[email protected]' to='service.server.org' id='iq_127'> <command xmlns='http://jabber.org/protocol/commands' node='function_name' action='complete'/>
<THE RPC INPUT/OUTPUT DATA/> </command> </iq>
S: <iq type='result' from='service.server.org' to='[email protected]' id='iq_127'> <command xmlns='http://jabber.org/protocol/commands' sessionid='RPC-SESSION-1' node='function_name' status='completed'>
<THE RPC OUTPUT/OUTPUT DATA/> </command> </iq>
![Page 27: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/27.jpg)
Use Case: Disco and Ad-Hoc CommandsRendering a GUI around a service with the XEP-0004 X-Data envelope
XEP-0004 X-Data Formsoptimized for GUI
![Page 28: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/28.jpg)
Ad-Hoc CommandsC: <iq type='set' from='[email protected]' to='service.server.org' id='iq_127'> <command xmlns='http://jabber.org/protocol/commands' node='function_name' action='complete'/>
<THE RPC INPUT DATA/> </command> </iq>
S: <iq type='result' from='service.server.org' to='[email protected]' id='iq_127'> <command xmlns='http://jabber.org/protocol/commands' sessionid='RPC-SESSION-1' node='function_name' status='completed'>
<THE RPC OUTPUT DATA/> </command> </iq>
X-Data Forms (XEP-0004)GUI
X-Data Forms (XEP-0004)GUI
![Page 29: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/29.jpg)
Web Service related XEPs
} Asynchronous +Stateful -Discoverable -
Asynchronous +Stateful +Discoverable +
Yet another XEP?
SOAP ? something else?WSDL ?
![Page 30: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/30.jpg)
Test Case: Web ServiceServer Component
gandhi
SOAPWSDbfetch
wsdbfetch.gandhi
![Page 31: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/31.jpg)
gandhi
chat-client@gandhi
SOAPWSDbfetch
bioclipse@gandhi
wsdbfetch.gandhi
Test Case: ClientGUI (chat-client), Scripting Environment (Bioclipse)
![Page 32: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/32.jpg)
XEP-0050 Ad-Hoc CommandsTransporting EMBL-EBI’s WSDbfetch Web Service over XMPP
![Page 33: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/33.jpg)
Summary:XMPP is• a well established and widely used XML routing
technology• a server-client oriented architecture• working with unique entity identifiers• offering a discoverable network• an asynchronous protocol (the server can push data to
the client)
Client Serverfunction(data)
“function started”
“result is available”
![Page 34: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/34.jpg)
Andreas Heusler
Egon Willighagen
Ola Spjuth
![Page 35: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/35.jpg)
![Page 36: Publishing and transporting Web Services over XMPP Johannes Wagener](https://reader030.vdocuments.site/reader030/viewer/2022032802/56649e155503460f94aff063/html5/thumbnails/36.jpg)
XEP-0096: File Transfer
Requirements• Enable seamless file transfer, including fall-back
mechanisms as appropriate. • Ensure that the profile will work even when one or both
parties are behind a firewall. • Define a full-featured set of metadata for file transfers,
including the following:– description – size – name – date – hash
• Optionally support ranged transfers.