1 / 21

Web services

Web services. Implementing a service-oriented architecture. Technology until now. Socket – connection (raw data wrap into other streams) HTTP – connection (get,put,post text) ‘Outdated’ – not tried CORBA (general object oriented method call) RMI (java object oriented method call).

ronni
Download Presentation

Web services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web services Implementing a service-oriented architecture Web services

  2. Technology until now • Socket – connection (raw data wrap into other streams) • HTTP – connection (get,put,post text) • ‘Outdated’ – not tried • CORBA (general object oriented method call) • RMI (java object oriented method call) Web services

  3. SOA Service-Oriented Architecture • Nodes in a network make resources available to other participants in the network as services • Accessed in a standardized way • Loosely coupled services • Platform independent • Programming language independent • Web services makes SOA happen! Web services

  4. SOA terms • Service • Business function • Accepts requests, produces responses • Provider (server) • Function which performs a service in response to a request from a consumer • Consumer (client) • Function which consumes the result of a service supplied by a provider • Discovery • Ability to identify services • Using a repository / registry • Binding • Relationship between provider and consumer is dynamic • Established at runtime Web services

  5. Technology that allows applications to communicate Platform independent Programming language independent Send XML messages Can use many transport protocols Uses open standards Web services are Developed by technical people Aggregated into solving business problems by business people Web servicesThe idea Web services

  6. Web services standards Open standards defined by • W3C http://www.w3.org • OASIS http://www.oasis-open.org • Supported by any major company • Microsoft • Sun Microsystems • IBM • Oracle • and many others Web services

  7. Web services, technologies • SOAP • Simple Object Access Protocol • WSDL • Web Service Description Language • UDDI • Universal Description, Discovery, and Integration • XML • eXtensible Markup Language • Used by all web service technologies Web services

  8. Overview Web services

  9. Language to describe data to be exchanged on the web And many other things Programs exchange XML documents XML documents are processed by programs Mark up language XML tags structures information Element <tag>…</tag> An element may have many sub-elements Nested elements An element has exactly 1 super-element Except the root element, which has 0 super-elements Example XML document <persons> <person> <name>Anders</name> <city>Roskilde</city> </person> <person> <name>Peter</name> <city>Sorø</city> </person> </persons> XML Web services

  10. Well-formed All start-tags must have a matching end-tag <person>…</persons> Tags must be properly nested <persons> <person>…</person> </persons> Only 1 outer tag Called the root element Valid Well-formed Conforms to an XML schema A set of “grammar rules” Specifies which tags are allowed, etc. Structure in XML documents Web services

  11. SOAP • XML is fine for data exchange, but it’s not enough • We need distinction between the header and the body of the message • Like in HTTP • A SOAP message in an XML document consisting of • Envelope (mandatory) • Headers (optional) • Body (mandatory) • Example • http://java.sun.com/developer/technicalArticles/WebServices/soa2/WSProtocols.html • Attachments (images and other binary content) Web services

  12. SOAP protocol Web services

  13. SOAPSimple Object Access Protocol • SOAP messages can be transported using any transport protocol • HTTP • SMTP • Others • SOAP messages are tunneled through firewalls • SOAP messages can be produced and consumed using any programming language • Sender and receiver can be written in different programming language • Sender and receiver need not know what programming language the other part was written in Web services

  14. WSDLWeb Services Description Language • Clients use a WSDL file to learn how to call a web service • WSDL file is an XML document describing the public interface to a web service • Message formats • Operations • Methods which can be called on the web service • Parameters and return types to the methods • Protocol bindings • Protocol used for transportation • Examples • http://java.sun.com/developer/technicalArticles/WebServices/soa2/WSProtocols.html Web services

  15. UDDIUniversal Description, Discovery, and Integration • An UDDI registry is like a phone book (yellow pages) • Web service producers register • Details of the business providing the service • Informal description of the functionality of the service • Location of the WSDL file • Information allowing users to register for information about updates to the service • Web service consumers search the registry for useful services • UDDI uses XML for registration • Several organizations run public UDDI registries • IBM • Microsoft • Others • Private UDDI registries • Most UDDI registries are found inside companies Web services

  16. Web service security • Integrity • SOAP messages are not tampered with • Confidentiality • SOAP message can only be seen by intended recipients • Authentication • Web service can only be called by authenticated clients • Underlying technologies • Secure Socket Layer (SSL) • And many others Web services

  17. WS-BPEL Web Services Business Process Execution Language • Business processes means calling more web services in a specific sequence. • BPEL coordinates web services • Web services are components • BPEL defines a sequence (work flow) of calls to web services Web services

  18. JAX-RPC / JAX-WS Java API for XML-based RPC • RPC • Remote Procedure Call • Calling a method on a remote object • JAX-RPC • Using web services to call remote methods from a Java program • How it works • Java program invokes a method on a stub • Stub invokes routines in the JAX-RPC runtime system (RS) • RS converts the remote method invocation into a SOAP message • RS transmits the message as an HTTP request • JAX-RPC is part of Java Enterprise Edition (J2EE) • JAX-WS is the new version of JAX-RPC Web services

  19. JAX-RPC data types • Primitive types • Works well • As primitive types or wrapper classes • Integer ~ int • Collections • Arrays [ ] work • List, etc. work. • Custom types (your own classes) • Must be XML serializable • No-arg constructor • Get and set methods on all properties • Exception(s) • Send as SOAP Faults (wrapped) • Can be quite hard to understand on the client side Web services

  20. Referencesand further reading Web services in general • Ed OrtService-Oriented Architecture and Web Services: Concepts, Technologies, and Tools, Sun 2005 • http://java.sun.com/developer/technicalArticles/WebServices/soa2/WSProtocols.html • Misc. references • http://en.wikipedia.org/wiki/SOAP_(protocol) • http://en.wikipedia.org/wiki/Webservices • http://www.w3.org/2002/ws/ • http://www.w3schools.com/webservices/ (ASP.NET) • Martin KalinJava Web Services, O’Reilly 2009 • Bill Burke RESTful Java with JAX-RS, O’Reilly 2009 • John Flanders RESTful .NET, O’Reilly 2008 • Singh et al.Designing Web Services with the J2EE 1.4 Platform, Addison Wesley 2004 • Companies • http://www-01.ibm.com/software/solutions/soa/ • http://www.oracle.com/technologies/soa/index.html • http://java.sun.com/webservices/ Web services

  21. XML http://en.wikipedia.org/wiki/XML http://www.w3schools.com/xml/ http://www.w3.org/XML/ SOAP http://en.wikipedia.org/wiki/SOAP_(protocol) http://www.w3.org/2000/xp/Group/ EnglanderJava and SOAP, O’Reilly 2002 WSDL http://en.wikipedia.org/wiki/Web_Services_Description_Language http://www.w3.org/2002/ws/desc/ UDDI http://en.wikipedia.org/wiki/UDDI http://www.uddi.org/ http://uddi.microsoft.com/ JAX-RPC / JAX-WS http://en.wikipedia.org/wiki/JAX-RPC http://en.wikipedia.org/wiki/JAX-WS Web service catalogs http://www.remotemethods.com/ http://www.webservicex.net/WS/ References, technologies Web services

More Related