Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Service Oriented Architecture


Published on

Published in: Technology

Service Oriented Architecture

  1. 1. Service Oriented Architectureand Web services<br />Mohammed LuqmanShareef<br />
  2. 2. Popular Distributed Application Frameworks/Technologies<br />2010-02-08<br />2<br />COM, DCOM Microsoft specific<br />EJB, RMI Java Specific<br />CORBA Platform and Language Independent<br />
  3. 3. What is SOA?<br />2010-02-08<br />3<br /><ul><li>SOA is an architectural style of building software applications that promotes loose coupling between components for their reuse.</li></ul>A software system is divided into highly flexible and re-usable components called services. <br />SOA is just an architecture blue print <br />It is NOT a technical standard<br />It is NOT a technology<br />
  4. 4. What is Service ?<br />2010-02-08<br />4<br />Self-contained module that perform a predetermined task<br />Software component that have published contracts/interfaces<br />Black-box to the consumers<br />Platform-Independent<br />Interoperable<br />
  5. 5. Why SOA?<br />2010-02-08<br />5<br />End Customer Portal<br />Operator Portal<br />Partner Portal<br />Customer Info<br />Management<br />Order Management<br />Credit Management<br />Sales<br />Management<br />Billing<br />Lets take a telecom enterprise system<br />Invoicing<br />Provisioning<br />Network Management<br />Inventory<br />Service<br />Catalog<br />Customer Profiles<br />
  6. 6. Why SOA?<br />2010-02-08<br />6<br />End Customer Portal<br />Operator Portal<br />Partner Portal<br />Services<br />Credit Management<br />Sales<br />Management<br />Customer Info<br />Management<br />Order Management<br />Provisioning<br />Invoicing<br />Inventory<br />Network Management<br />Customer Profiles<br />Billing<br />Service<br />Catalog<br />
  7. 7. SOA: Architectural Principles<br />2010-02-08<br />7<br />Loose coupling<br />Minimize dependencies.<br />Service contract<br />Services adhere to a communications agreement.<br />Service abstraction <br />Hide the service execution logic from the outside world.<br />Service reusability<br />Logic is divided into services for reuse.<br />
  8. 8. SOA: Architectural Principles<br />2010-02-08<br />8<br />Service composability<br />Services can be assembled to form composite service.<br />Service autonomy<br />Services have control over the logic they encapsulate.<br />Service discoverability<br />Services can be found and assessed via available discovery mechanisms.<br />Service relevance<br /> Service presented at a granularity recognized by user a meaningful service.<br />
  9. 9. SOA Implementation<br />2010-02-08<br />9<br /> While SOA can be implemented using any service based technology such as CORBA, the SOAP based web services standard implementation has gained wide industry acceptance, because these standards provide greater interoperability.<br /> Key differences between CORBA and web service are<br />
  10. 10. Realizing SOA with Web Services<br />2010-02-08<br />10<br />W WW<br />
  11. 11. What is web service ?<br />2010-02-08<br />11<br />Web service is a standard way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. <br /> XML is used to tag the data, <br /> SOAP is used to transfer the data, <br /> WSDL is used for describing the services available and <br /> UDDI is used for listing what services are available. <br /> Web services are loosely coupled computing services that can reduce the complexity of building business applications, save costs, and enable new business models. Services running on an arbitrary machine can be accessed in a platform- and language-independent fashion.<br />
  12. 12. How to buy tomatoes ?<br />2010-02-08<br />12<br />Lookup for the tomato sellers<br />Yellow Pages: contain companies that are selling tomatoes, their location, and contact information. <br /><ul><li>Find the service offered according to my needs</li></ul>Where, when and how can I buy tomatoes? <br /><ul><li>Buy the tomatoes do the transaction</li></li></ul><li>How to access a service?<br />2010-02-08<br />13<br />Lookup for the Service Provider<br />Registry: contain providers that are selling services, their location, and contact information. <br />Find the service offered according to my needs<br />Where, when and how can I get the service? <br />Access the servicedo the transaction <br />
  13. 13. Components of a web service<br />2010-02-08<br />14<br />XML (eXtensible Markup Language)<br />A uniform data representation and exchange mechanism<br />SOAP (Simple Object Access Protocol)<br />Lightweight (XML-based) protocol for exchange <br /> of information in a decentralized, distributed environment<br />WSDL (Web Service Description Language)<br />XML format that describes the web service<br />UDDI (Universal Description Discovery and Integration)<br />Like yellow pages of Web services<br />
  14. 14. 3 roles of service<br />2010-02-08<br />15<br />
  15. 15. Service Vs. Consumer<br />2010-02-08<br />16<br />Policy<br />Adheres to<br />governed by<br />End Point<br />Binds to<br />Exposes<br />Serves<br />Service <br />Consumer<br />Service<br />Contracts<br />implements<br />Understands<br />describes<br />Messages<br />Sends/Receives<br />Sends/Receives<br />
  16. 16. Steps to develop a web serviceusing JAX-WS<br />2010-02-08<br />17<br />Define the service implementation and compile it.<br /> WS&gt;javac -d .<br />Use wsgen to generate the artifacts required to deploy the service.<br /> WS&gt;wsgen -wsdlserver.HelloImpl<br />3. Package the files into a WAR file and deploy it .<br />package server;<br />import javax.jws.WebService;<br />@WebService<br />public class HelloImpl {<br /> /**<br /> * @param name<br /> * @return Say hello to the person.<br /> */<br /> public String sayHello(String name) {<br /> return &quot;Hello, &quot; + name + &quot;!&quot;;<br /> }<br />}<br />
  17. 17. HelloImplService.wsdl<br />2010-02-08<br />18<br />
  18. 18. HelloImplService.wsdl contd…<br />2010-02-08<br />19<br />
  19. 19. HelloImplService_schema1.xsd<br />2010-02-08<br />20<br />
  20. 20. Steps to develop a web service contd…<br />2010-02-08<br />21<br />package myClient;<br />import helloservice.endpoint.HelloService;<br />import helloservice.endpoint.Hello;<br />public class HelloClient {<br /> public static void main(String[] args) {<br /> try {<br />HelloService service = new HelloService();<br /> Hello port = service.getHelloPort();<br /> String response = port.sayHello(“Luqman&quot;);<br />System.out.println(response);<br /> } catch (Exception e) {<br />e.printStackTrace();<br /> }<br /> }<br />}<br />Implement Client Code<br />5. Use wsimport to generate and compile the web service artifacts needed to connect to the service.<br /> WS&gt;wsimport HelloImplService.wsdl<br /> parsing WSDL...<br /> generating code...<br /> compiling code...<br />6. Run the client.<br />
  21. 21. WSDL<br />2010-02-08<br />22<br />WSDL elements<br />WSDL is a contract between service provider and the consumer<br />A WSDL document describes<br />What the service can do<br />Where it resides<br />How to invoke it<br />Types<br />Message<br />Operation<br />Port Type<br />WSDL<br />Binding<br />Port<br />Service<br />
  22. 22. WSDL elements<br />2010-02-08<br />23<br />Types<br /> Data type definition used in exchanging messages<br />Message<br /> Describes the logical content of data being communicated<br />Operation<br /> An Abstract description of an action supported by the service<br />Port Type<br /> A set of operations and messages involved with the service<br />Binding<br /> A concrete protocol and data format specification for a port type<br />Port<br /> A single end point defined as a combination of a binding and a network address<br />Service<br /> Identifies which ports to group together<br />
  23. 23. SOAP<br />2010-02-08<br />24<br />SOAP Envelope<br />SOAP Header<br />Header Block<br />SOAP Body<br />Message Body<br />Fault Handlers<br />SOAP message structure<br />SOAP is a lightweight (XML-based) protocol for exchange of information in a decentralized, distributed environment. <br />SOAP is a format for sending messages<br />SOAP is independent of transport protocol<br />A SOAP message is an ordinary XML document containing the following elements:<br />Envelope - identifies the XML document as a SOAP message<br />Header - contains application specific info like authentication etc.<br />Body - contains the message in request and response<br />Fault - contains errors and status information<br />
  24. 24. SOAP Example<br />&lt;?xml version=&quot;1.0&quot;?&gt;&lt;soap:Envelopexmlns:soap=&quot;;soap:encodingStyle=&quot;;&gt;&lt;soap:Bodyxmlns:m=&quot;;&gt;  &lt;m:sayHello&gt;    &lt;m:name&gt;Luqman&lt;/m:name&gt;  &lt;/m:sayHello&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt; <br />2010-02-08<br />25<br />Request<br />Response<br />&lt;?xml version=&quot;1.0&quot;?&gt;&lt;soap:Envelopexmlns:soap=&quot;;soap:encodingStyle=&quot;;&gt;&lt;soap:Bodyxmlns:m=&quot;;&gt;  &lt;m:sayHelloResponse&gt;    &lt;m:return&gt;Hello Luqman&lt;/m:return&gt;  &lt;/m:sayHelloResponse&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt; <br />
  25. 25. SOAP Fault<br />2010-02-08<br />26<br />SOAP errors are handled using a specialised envelope known as a Fault Envelope<br />A SOAP Fault is a special element which must appear as an immediate child of the body element<br />&lt;faultcode&gt; and &lt;faultstring&gt; are required.<br />
  26. 26. UDDI<br />2010-02-08<br />27<br />3 levels of information in UDDI<br />UDDI is a set of specifications that is used to publish information for describing and discovering web services, finding businesses, building registries. <br />UDDI is a directory for storing information about web services.<br />UDDI communicates via SOAP.<br />White Pages<br />To query companies with their names and attributes<br />Yellow Pages<br />To query businesses with their categories<br />Green Pages<br />Contains technical info on how to interact with the services<br />
  27. 27. UDDI Structure<br />2010-02-08<br />28<br />
  28. 28. Registry APIs (SOAP Messages)<br />2010-02-08<br />29<br /><ul><li>Publishers API
  29. 29. Save things
  30. 30. save_business
  31. 31. save_service
  32. 32. save_binding
  33. 33. save_tModel
  34. 34. Delete things
  35. 35. delete_business
  36. 36. delete_service
  37. 37. delete_binding
  38. 38. delete_tModel
  39. 39. security…
  40. 40. get_authToken
  41. 41. discard_authToken
  42. 42. Inquiry API
  43. 43. Find things
  44. 44. find_business
  45. 45. find_service
  46. 46. find_binding
  47. 47. find_tModel
  48. 48. Get Details about things
  49. 49. get_businessDetail
  50. 50. get_serviceDetail
  51. 51. get_bindingDetail
  52. 52. get_tModelDetail</li></li></ul><li>REST<br />2010-02-08<br />30<br />
  53. 53. RESTful web services<br />2010-02-08<br />31<br />REpresentationalState Transfer<br />Each unique URL is a representation of some object<br />Ex :<br /> http://www.<br />HTTP GET Method operates on the resource.<br />Object state is transferred and stored at client.<br />Representation of the resource state in XML, JSON etc.<br />
  54. 54. RESTful web services contd…<br />2010-02-08<br />32<br />Principles<br /><ul><li>Resource identification through URI
  55. 55. Uniform interface</li></ul> GET/PUT/POST/DELETE<br /><ul><li>Self-descriptive messages
  56. 56. Stateful interactions through hyperlinks</li></ul>Benefits<br />Client side<br />Easy to experiment in browser<br />Broad programming language support<br />Choice of data formats<br />bookmarkable<br />Server side<br /><ul><li>Uniform Interface
  57. 57. Cacheable
  58. 58. Scalable
  59. 59. Easy failover</li></li></ul><li>Example<br />2010-02-08<br />33<br />Request<br />GET/india/hyd/employees/1234 HTTP/1.1<br />Host:<br />Accept: application/xml<br />Response<br />HTTP/1.1 200 OK<br />Date: Tue, 09 Feb 2010 11:41:20 GMT<br />Server: Apache/1.3.6<br />Content-Type: application/xml; charset=UTF-8<br />&lt;?xml version=&quot;1.0&quot;?&gt;<br />&lt;Employees xmlns=&quot;…&quot;&gt;<br /> &lt;Employee name=“ABC”&gt;<br /> …<br /> &lt;/Employee&gt;<br />&lt;/Employees&gt;<br />Resource<br />Method<br />State<br />transfer<br />Representation<br />
  60. 60. Developing a RESTful web service using JAX-WS<br />2010-02-08<br />34<br />package com.sun.jersey.samples.helloworld.resources;<br />import;<br />import;<br />import;<br />@Path(&quot;/employees/{empid}&quot;)<br />public class Employee{<br />@GET<br /> @Produces(&quot;text/xml&quot;)<br /> public String getEmployee(@PathParam(“empid&quot;) String empId) {<br /> ...<br /> …<br /> }<br />}<br />
  61. 61. Securing web services<br />SSL is not enough<br />SSL provides point to point security<br />WS needs end to end security<br />SSL provides security at transport level<br />WS needs security at message level<br />SSL doesn’t support non-repudiation<br />Non-repudiation is critical for business WS<br />Web service security requirements<br />Authentication ( Identity check )<br />Authorization ( Access Control )<br />Confidentiality ( Encryption )<br />Integrity ( Signature Support )<br />Non-repudiation ( Ability to prove that a particular transaction is performed)<br />Accessibility ( Ensuring that the service is not impacted by attacks)<br />2010-02-08<br />35<br />
  62. 62. Web service security standards<br />2010-02-08<br />36<br />XML digital signature ( IETF and W3C)<br />XML Encryption ( W3C)<br />SAML (Secure Assertion Markup Language) ( OASIS)<br />WS-Security (Web Services Security) (OASIS)<br />WS-SecureConversation<br />WS-Federation<br />WS-Policy<br />WS-Trust<br />WS-Privacy<br />XACML (Extensible Access Control Markup Language) (OASIS)<br />ebXML Message Service (OASIS)<br />
  63. 63. The way forward<br />2010-02-08<br />37<br />SOAD<br />SOSE<br />ED SOA<br />ESB<br />SoaML<br />BPEL<br />SOA-Tel<br />SOA Reference Architecture<br />
  64. 64. For more information<br />2010-02-08<br />38<br />SOAP -<br />WSDL -<br />UDDI -<br />SAML -<br />ebXML -<br />CORBA Vs. Web services - http://www2002.og/CDROM/alternate/395<br />SoaML -<br />BPEL -<br />
  65. 65. Questions?<br />2010-02-08<br />39<br />
  66. 66. Thank You<br />2010-02-08<br />40<br />