wstechnology

33 %
67 %
Information about wstechnology
News-Reports

Published on June 19, 2007

Author: Arkwright26

Source: authorstream.com

Slide1:  Part I: Quick and Dirty THE US NATIONAL VIRTUAL OBSERVATORY Web Service Technologies Or How the Magic Happens Matthew J. Graham CACR/Caltech Overview:  Overview Web services and SOA RESTful services Rich clients SOAP and WSDL Attachments Security State Asynchrony Web services (oc)cult :  Web services (oc)cult Invocations Strange languages Action at a distance High priesthood What is a web service?:  What is a web service? 'A software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format.' - W3C Not a new idea: RPC, RMI Service Oriented Architecture:  Service Oriented Architecture An application architecture within which all functions are defined as independent services with well-defined invocable interfaces which can be called in defined sequences to form scientific processes. Not a new idea: CORBA, ICE Principles: Service reusability Service contract Service loose coupling Service abstraction Virtual Observatory = Service Oriented Astronomy Service composability Service autonomy Service statelessness Service discoverability How’s it done in the real world?:  How’s it done in the real world? 'Things should be made as simple as possible, but no simpler' - Albert Einstein A web service is just a machine-readable web app and a web app is just a dynamic web site WWW is the largest, most distributed and scalable application on the planet  HTTP and HTML (XML) REST: The formal approach:  REST: The formal approach Architectural style not an implementation (http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm) Each resource has a URI Exchange resource representations (XML) Uniform CRUD API: HTTP protocol CRUD action Description POST CREATE Create a new resource GET RETRIEVE Retrieve a resource representation PUT UPDATE Update a resource DELETE DELETE Delete a resource Accidentally RESTful:  Accidentally RESTful HTTP GET/POST + XML (POX/HTTP) Verbs allowed in URIs Requires little new infrastructure - just HTTP and XML processing technologies Simple clients, e.g. wget or xsltproc Commercially popular (85% of traffic, 6x faster): Amazon (http://www.amazon.com/gp/aws/landing.html) Yahoo (http://developer.yahoo.net) eBay (http://developer.ebay.com/rest) Flickr (http://www.flickr.com/services/) Del.icio.us (http://del.icio.us/doc/api) What do RESTful services lack?:  What do RESTful services lack? Reliable messaging Digital signatures Message routing Resource life cycle management Asynchronous event notification Is this a problem?:  Is this a problem? Security transport level (HTTPS): point-to-point fast and well supported State sessions Asynchrony easy to implement Client technologies: fat web pages:  Client technologies: fat web pages XForms (http://www.w3.org/Markup) MVC approach to web forms separates content (XML model/instance) from presentation (XSLT/XHTML) Server-side implementation: Orbeon (http://www.orbeon.org) Chiba (http://chiba.sourceforge.net) Client-side implementation: FormsPlayer (http://www.formsplayer.com) FormFaces (http://www.formfaces.com) Browsers (e.g. http://www.mozilla.org/projects/xforms) AJAX (Asynchronous Javascript + XML):  AJAX (Asynchronous Javascript + XML) Uses browser’s XML support: DOM, XSLT XMLHttpRequest Google Maps, Google Suggest The bleeding edge:  The bleeding edge AFLAX (Asynchronous Flash + XML): http://www.xamlon.com/software/xamlonpro/flash/aflax.aspx OpenLaszlo (http://openlaszlo.org) Mashups On July 19, Google registered: googlesolarsystem.*, googlegalaxy.*, and googleuniverse.*, AJAX SOA:  AJAX SOA Slide15:  Part II: Standards THE US NATIONAL VIRTUAL OBSERVATORY Web Service Technologies Or How the Magic Happens Matthew J. Graham CACR/Caltech Recap:  Recap Client technologies: XForms, AJAX RESTful approach: Distributed hypermedia model (WWW) is key architecture for loosely coupled distributed systems Each URL is a representation of some object, e.g. http://us-vo.org/conesearch?POS=123,34andamp;SR=0.5 Manipulate representation with CRUD interface Application understands that resource access method is semantically significant Low REST vs. high REST What is SOAP?:  What is SOAP? Originally meant Simple Object Access Protocol An XML-based communication protocol and encoding format for exchanging structured information in a decentralized, distributed environment W3C specification (http://www.w3.org/TR/soap) Anatomy of a SOAP message:  Anatomy of a SOAP message An envelope to encapsulate data which defines formatting conventions for describing the message contents and routing directions: header and body A message exchange pattern: request/response (RPC mechanism), fire-and-forget A transport or binding protocol Data encoding rules for describing the mapping of application-defined datatypes into an XML tag-based representation SOAP example:  SOAP example Request: andlt;soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'andgt; andlt;soap:Bodyandgt; andlt;ComovingLineOfSight xmlns='http://skyservice.pha.jhu.edu'andgt; andlt;zandgt;floatandlt;/zandgt; andlt;hubbleandgt;floatandlt;/hubbleandgt; andlt;omegaandgt;floatandlt;/omegaandgt; andlt;lambdaandgt;floatandlt;/lambdaandgt; andlt;/ComovingLineOfSightandgt; andlt;/soap:Bodyandgt; andlt;/soap:Envelopeandgt; Response: andlt;soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'andgt; andlt;soap:Bodyandgt; andlt;ComovingLineOfSightResponse xmlns='http://skyservice.pha.jhu.edu'andgt; andlt;ComovingLineOfSightResultandgt;floatandlt;/ComovingLineOfSightResultandgt; andlt;/ComovingLineOfSightResponseandgt; andlt;/soap:Bodyandgt; andlt;/soap:Envelopeandgt; Why is SOAP better?:  Why is SOAP better? Asynchrony Routing Reliable messaging (e.g. once-and-only delivery, guaranteed or exact execution) Send and receive complex datatypes to invoke a particular method not just key-value pairs Security Binds to other protocols Service description What is WSDL?:  What is WSDL? Web Services Description Language An XML grammar for describing a web service as a collection of endpoints capable of exchanging messages in a particular fashion W3C specification (http://www.w3.org/TR/wsdl) http://www.xmethods.net Anatomy of a WSDL file:  Anatomy of a WSDL file andlt;definitionsandgt; andlt;/definitionsandgt; andlt;messageandgt;* - model data exchanged andlt;partandgt;andlt;/partandgt;* andlt;/messageandgt; andlt;bindingandgt;* - formatting and representation of SOAP andlt;operationandgt;* message on the wire andlt;inputandgt;andlt;/inputandgt; andlt;outputandgt;andlt;/outputandgt; andlt;/operationandgt; andlt;/bindingandgt; andlt;serviceandgt;* - identifies actual endpoint for WS andlt;portandgt;andlt;/portandgt;* andlt;/serviceandgt; andlt;importandgt;* - include other WSDLs andlt;typesandgt; - define datatypes used in andlt;messageandgt; andlt;schemaandgt;andlt;/schemaandgt;* andlt;/typesandgt; andlt;porttypeandgt;* - a subset of operation supported for andlt;operationandgt;* an endpoint andlt;inputandgt;andlt;/inputandgt; - define input and output parameters andlt;outputandgt;andlt;/outputandgt; andlt;faultandgt;andlt;/faultandgt;* andlt;/operationandgt; andlt;/porttypeandgt; WSDL example:  WSDL example andlt;definitions xmlns:http=http://schemas.xmlsoap.org/wsdl/http/ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:s=http://www.w3.org/2001/XMLSchema xmlns:s0=http://skyservice.pha.jhu.edu xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/ targetNamespace='http://skyservice.pha.jhu.edu' xmlns='http://schemas.xmlsoap.org/wsdl/'andgt; andlt;typesandgt;andlt;s:schema elementFormDefault='qualified' targetNamespace='http://skyservice.pha.jhu.edu'andgt; andlt;s:element name='ComovingLineOfSight'andgt;… andlt;s:element minOccurs='1' maxOccurs='1' name='z' type='s:float' /andgt; andlt;s:element minOccurs='1' maxOccurs='1' name='hubble' type='s:float' /andgt; andlt;s:element minOccurs='1' maxOccurs='1' name='omega' type='s:float' /andgt; andlt;s:element minOccurs='1' maxOccurs='1' name='lambda' type='s:float' /andgt; …andlt;/s:elementandgt; andlt;s:element name='ComovingLineOfSightResponse'andgt;… andlt;s:element minOccurs='1' maxOccurs='1' name='ComovingLineOfSightResult' type='s:float' /andgt; …andlt;/s:elementandgt; andlt;/s:schemaandgt;andlt;/typesandgt; andlt;message name='ComovingLineOfSightSoapIn'andgt; andlt;part name='parameters' element='s0:ComovingLineOfSight' /andgt; andlt;/messageandgt; andlt;message name='ComovingLineOfSightSoapOut'andgt; andlt;part name='parameters' element='s0:ComovingLineOfSightResponse' /andgt; andlt;/messageandgt; andlt;portType name='DistanceSoap'andgt; andlt;operation name='ComovingLineOfSight'andgt; andlt;documentationandgt;Return the comoving line of sight distance...andlt;/documentationandgt; andlt;input message='s0:ComovingLineOfSightSoapIn' /andgt; andlt;output message='s0:ComovingLineOfSightSoapOut' /andgt; andlt;/operationandgt; andlt;/portTypeandgt; andlt;service name='Distance'andgt; andlt;port name='DistanceSoap' binding='s0:DistanceSoap'andgt; andlt;soap:address location='http://voservices.net/Cosmology/ws_v1_0/Distance.asmx' /andgt; andlt;/portandgt; andlt;/serviceandgt; andlt;/definitionsandgt; What about the binding?:  What about the binding? andlt;binding name='DistanceSoap' type='s0:DistanceSoap'andgt; andlt;soap:binding transport='http://schemas.xmlsoap.org/soap/http' style='document' /andgt; andlt;operation name='ComovingLineOfSight'andgt; andlt;soap:operation soapAction='http://skyservice.pha.jhu.edu/ComovingLineOfSight' style='document' /andgt; andlt;inputandgt; andlt;soap:body use='literal' /andgt; andlt;/inputandgt; andlt;outputandgt; andlt;soap:body use='literal' /andgt; andlt;/outputandgt; andlt;/operationandgt; andlt;/bindingandgt; Binding attributes:  Binding attributes Style (representation on the wire) rpc: the endpoint treats child elements in the body as XML representation of method call (SOAP 1.1, sec. 7) document: the body can contain arbitrary XML Use (how data is serialized across the wire) encoded: rules in a URL specified by encodingStyle attribute literal: rules specified by XML schema WSDL binding flavours (I):  WSDL binding flavours (I) andlt;message name='Request'andgt; andlt;part name='x' type='xs:int'/andgt; andlt;/messageandgt; andlt;message name='empty'/andgt; andlt;portType name='foo'andgt; andlt;operation name='method'andgt; andlt;input message='Request'/andgt; andlt;output message='empty'/andgt; andlt;/operationandgt; andlt;/portTypeandgt; andlt;message name='Request'andgt; andlt;part name='x' type='xs:int'/andgt; andlt;/messageandgt; andlt;message name='empty'/andgt; andlt;portType name='foo'andgt; andlt;operation name='method'andgt; andlt;input message='Request'/andgt; andlt;output message='empty'/andgt; andlt;/operationandgt; andlt;/portTypeandgt; andlt;typesandgt; andlt;schemaandgt; andlt;element name='xElement' type='xs:int'/andgt; andlt;/schemaandgt; andlt;/typesandgt; andlt;message name='Request'andgt; andlt;part name='x' element='xElement'/andgt; andlt;/messageandgt; andlt;message name='empty'/andgt; andlt;portType name='foo'andgt; andlt;operation name='method'andgt; andlt;input message='Request'/andgt; andlt;output message='empty'/andgt; andlt;/operationandgt; andlt;/portTypeandgt; RPC Document Literal Encoding WSDL binding flavours (II):  WSDL binding flavours (II) andlt;soap:envelopeandgt; andlt;soap:bodyandgt; andlt;methodandgt; andlt;x xsi:type='xs:int'andgt;5andlt;/xandgt; andlt;/methodandgt; andlt;/soap:bodyandgt; andlt;/soap:envelopeandgt; andlt;soap:envelopeandgt; andlt;soap:bodyandgt; andlt;methodandgt; andlt;xandgt;5andlt;/xandgt; andlt;/methodandgt; andlt;/soap:bodyandgt; andlt;/soap:envelopeandgt; andlt;soap:envelopeandgt; andlt;soap:bodyandgt; andlt;xElementandgt;5andlt;/xElementandgt; andlt;/soap:bodyandgt; andlt;/soap:envelopeandgt; RPC Document Literal Encoding WSDL binding flavours (III):  andlt;typesandgt; andlt;schemaandgt; andlt;element name='method'andgt; andlt;complexTypeandgt; andlt;sequenceandgt; andlt;element name='x' type='xs:int'/andgt; andlt;/sequenceandgt; andlt;/complexTypeandgt; andlt;/elementandgt; andlt;/schemaandgt; andlt;/typesandgt; andlt;message name='Request'andgt; andlt;part name='parameters' element='method'/andgt; andlt;/messageandgt; andlt;message name='empty'/andgt; andlt;portType name='foo'andgt; andlt;operation name='method'andgt; andlt;input message='Request'/andgt; andlt;output message='empty'/andgt; andlt;/operationandgt; andlt;/portType WSDL binding flavours (III) andlt;soap:envelopeandgt; andlt;soap:bodyandgt; andlt;methodandgt; andlt;xandgt;5andlt;/xandgt; andlt;/methodandgt;andgt; andlt;/soap:bodyandgt; andlt;/soap:envelopeandgt; Document/literal wrapped Which flavour to use?:  Which flavour to use? Doc style can pass entire transaction as an XML document (state) Doc style not constrained by RPC-oriented encoding Doc style can be validated at call time Processing overhead in encoding payloads with RPC Doc style can use low memory parsers such as SAX and StAX RPC’s natural tendency to expose programming language object structures  doc/literal wrapped (95%) Why not doc/literal wrapped?:  Why not doc/literal wrapped? Overloaded operations: public void myMethod (int x, float y); public void myMethod (int x); Number of parameters: public void someOtherMethod(int x, float y); Data graphs: andlt;complexType name='Node'andgt; andlt;sequenceandgt; andlt;element name='name' type='string'/andgt; andlt;element name='left' type='Node'/andgt; andlt;element name='right' type='Node'/andgt; andlt;/sequenceandgt; andlt;/complexTypeandgt; RPC/encoding: andlt;Aandgt; Literal: andlt;Aandgt; andlt;nameandgt;Aandlt;/nameandgt; andlt;nameandgt;Aandlt;/nameandgt; andlt;left href='9999'/andgt; andlt;leftandgt; andlt;right href='9999'/andgt; andlt;nameandgt;Bandlt;/nameandgt; andlt;/Aandgt; andlt;/leftandgt; andlt;B id='9999'andgt; andlt;rightandgt; andlt;nameandgt;Bandlt;/nameandgt; andlt;nameandgt;Bandlt;/nameandgt; andlt;/Bandgt; andlt;/rightandgt; andlt;/Aandgt; A Left Right B Left Right Client Invocation Models:  Client Invocation Models Static: use generated stubs (wsdl2*) Dynamic: no generated code a proxy dynamically generates a class at runtime that conforms to a particular interface, proxying all invocations to a single ‘generic’ method Examples: Java : use javax.xml.rpc.Service.getPort() and createCall() .NET : use RealProxy class (must extend ContextBound) or Reflection.Emit Generic SOAP client: http://soapclient.com/soaptest.html Interoperability:  Interoperability Suitable for and capable of being implemented in a neutral manner on multiple operating systems and in multiple programming languages Not all web services are interoperable! Web Services Interoperability Organisation (http://www.ws-i.org) WS-I Testing Tools Attachments: opaque data:  Attachments: opaque data 'By value' XML representation or use xs:hexBinary or xs:base64Binary within the body data expansion by a factor of ~1.33 - 4 anything within SOAP body gets parsed processing costs of encoding/decoding 'By reference' attach pure binary data as external unparsed entity outside SOAP message use reference URI within the body Reference solutions:  Reference solutions SwA (SOAP with Attachments) Multipart MIME message: SOAP (0), data (1-n) Use Content-Id as reference in body Lack of length header on message sections No recommendation just W3C Note DIME (Direct Internet Message Encapsulation) Uses faster and more efficient binary encoding No standard, disowned by Microsoft Both introduce a data structure outside realm of XML data model: no rules to specify how attachment content related to SOAP envelope so incompatible with WS-* MTOM:  MTOM Message Transmission Optimization Mechanism Uses MIME - backwards compatible with SwA Uses XOP:Include as reference mechanism (XOP = XML Binary Optimized Packaging) Conceptually binary data is base64-encoded in SOAP XML document  compatible with WS-* Implementations: Axis2 (http://ws.apache.org/axis2) WSE 3.0 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwse/html/newwse3.asp) Security:  Security Transport level (https) Message level: End-to-end: allows for unlimited intermediaries Data origin authentication Different types of security tokens/credentials: unsigned (username/password) binary (X.509 certificate) XML (SAML token) Multiple credentials WS-Security:  WS-Security OASIS standard (http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss)) Security token validation (authentication): validate authentication assertions made by principals Message integrity (signing): verify message origin validate encryption keys confirm security token claims Message confidentiality (encryption) Introduces extra XML into SOAP header WSS Implementations:  WSS Implementations Java: WSS4J (http://ws.apache.org/wss4j) C#: WSE 2.0 (http://msdn.microsoft.com/webservices/webservices/building/wse/default.aspx) WSRF.Net (http://www.cs.virginia.edu/~gsw2c/wsrf.net.html) Perl : WS-Security will be supported by WSRF::Lite (but not yet) (http://www.sve.man.ac.uk/Research/AtoZ/ILCT) Python: pyGridWare (http://dsd.lbl.gov/gtg/projects/pyGridWare/) State:  State Stateless is good: In case of failure, just restart without concern of previous interactions (reliability) New service instances can be created/destroyed in response to system load (scalability) How to handle state? Separate web service and state information (resource) Identify resource with a unique key Use message exchanges with the service to interact with the resource (manipulate state) WS-Resource:  WS-Resource An entity composed of a web service and a stateful resource The address is called an endpoint reference (WS-Addressing) ACID: Updates made in all-or-nothing fashion (atomicity) Consistent state even after failure (consistency) Updates isolated within a given work unit (isolation) Permanence of updates (durability) WS-RF: the nuts and bolts:  WS-RF: the nuts and bolts WSDL for a stateful service: andlt;definitionsandgt; andlt;importandgt;* andlt;typesandgt; andlt;xs:schemaandgt; andlt;xs:element name='StatefulResourceProperties'andgt;…andlt;/xs:elementandgt; andlt;xs:schemaandgt; andlt;typesandgt; andlt;porttype wsdlpp:extends='…' wsrp:ResourceProperties='tns:StatefulResourceProperties'andgt; Implementations: Java: GT4 (htttp://www.globus.org); Apache WSRF (http://ws.apache.org/wsrf) .NET: WSRF.Net (http://www.cs.virginia.edu/~gsw2c/wsrf.net.html) Python: pyGridWare (http://dsd.lbl.gov/gtg/projects/pyGridWare/) Perl: WSRF::Lite (http://www.sve.man.ac.uk/Research/AtoZ/ILCT) Asynchrony:  Asynchrony Real world is asynchronous No current standards for asynchronous services but most promising is OASIS ASAP (http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=asap) Toolkits exist which facilitate asynchronous activities: WS-RF (see above) Axis2 (http://ws.apache.org/axis2) JMS (http://java.sun.com/products/jms) / Caffeine (http://caffeine.berlios.de/site/) WSIF (http://www.apache.org/wsif) Messaging operations:  Messaging operations WSDL defines four types of messaging operation that an endpoint can support: One-way: endpoint receives a message Request/response: endpoint receives a message and sends a correlated message Solicit/response: endpoint sends a message and receives a correlated message Notification: endpoint sends a message One-way/two-way transport behaviour Patterns for asynchrony (I):  Patterns for asynchrony (I) Fire and Forget: Request/response (Transport timeout) C S C S C S Patterns for asynchrony (II):  Patterns for asynchrony (II) Polling: Callback: C S C S WS-Addressing:  WS-Addressing No standard SOAP way to specify: where a message is going how to return a response where to report an error WS-Addressing provides: To ReplyTo FaultsTo Anonymous MessageId / RelatesTo Standard for including service-specific attributes MEST (MESsage Transfer) :  MEST (MESsage Transfer) Messaging: No notion of client/server: just peers Largely time independent: messages delivered when peer is available Messages can be duplicated and delivered to multiple peers Messages and services are first class abstractions (no interfaces, data and operations) SSDL (http://www.ssdl.org) Indigo: dual contracts are beyond WSDL Conclusions:  Conclusions Pick the right approach: do you need SOAP? Location of functionality: fat web pages Think about interactions: WSDL Use your favourite language and platform Interoperability is a great idea Be aware of emerging and converging technologies and new paradigms

Add a comment

Related presentations

Related pages

WS Technology - Home

Axxsys Consulting, a successful and growing financial services consultancy firm, are announcing the acquisition of WS Technology, in order to strengthen ...
Read more

CWS Technology Inc.

CWS Technology is a web development company, offering customized application development, offshore software development and mobile application development ...
Read more

WS Technology - About

WS Technology Consultants were established in 2011 as a niche consultancy firm focused specifically on delivering both tactical and strategic solutions to ...
Read more

WS Packaging Group

Engage shoppers on the path to purchase. WSTechnology has the ability to develop one-of-a-kind constructions, RFID and NFC applications, or resource beta ...
Read more

CWS Technology (@cwstechnology) on Twitter

CWS Debut on Tumblr - Hey All! CWS is now available on Tumblr as well. Follow us for Latest Technology... tmblr.co/ZI4Rgj1sHQY62
Read more

ws.technology.info

Cíle: Kreativní, ekonomicky dosažitelné, pro velkou většinu dostupné komplexní využití ověřené a dlouhodobě provozovat e lné technologie na ...
Read more

swstechnology.com archive

swstechnology.com: Root : File name : Size : Last changed .. AquaChem: Aquifertest: Diver-Office: Diver-Office_Premium: DiverMobile: DiverPocket: Hydro ...
Read more

WS Packaging Group

WSTechnology Enhance your brand with innovative technology. We help you increase consumer engagement, confidence, and brand loyalty. ... WS Packaging Group.
Read more

WS Technology Consulting | WS Technology Consulting

WS TECHNOLOGY CONSULTING is headquartered and incorporated in Dar Es Salaam, Tanzania. It is founded by Martin Warioba and John Sausi. WS Technology ...
Read more

CWS Technology Inc.

CWS Technology Inc., Noida, India. 7,938 likes · 9 talking about this · 131 were here. CWS Technology - Custom Application Development, Web Application...
Read more