1 / 54

Implementing Soap & Web Services

Implementing Soap & Web Services. By Jozef Drans  eld (ST-MA) & Derek Mathieson (AS-IDS). Presentation Roadmap. Past. Present. Future. Why Web Services?.

pennie
Download Presentation

Implementing Soap & 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. Implementing Soap & Web Services By Jozef Dranseld (ST-MA) & Derek Mathieson (AS-IDS)

  2. Presentation Roadmap Past Present Future

  3. Why Web Services? “The Web can grow significantly in power and scope if it is extended to support communication between applications, from one program to another.” - From the W3C XML Protocol Working Group Charter

  4. The Hype • New paradigm? • Reason to move platforms? • Replacement for EDI?

  5. Gartner’s ‘Hype’ Curve Key: Time to “plateau” Visibility Less than two years Two to five years Grid Computing Biometrics Five to 10 years Beyond 10 years Natural-language search Identity services Virtualprivatenetworks Personal digitalassistant phones WirelessLANs/802.11 Nanocomputing Text-to-speech E-tags Speech recognition incall centers Peer-to-peercomputing Voice over IP Personalfuel cells Bluetooth WAP/WirelessWeb Public key infrastructure Locationsensing Speech recognition on desktops Peak of inflated expectations Technologytrigger Trough of disillusionment Slope of enlightenment Plateau ofproductivity Maturity Web Services Source: Gartner Group June 2002

  6. What are Web Services? • Identified by a URI • Interfaces defined using XML • Can be discovered by other systems • Interact using XML based messages conveyed by Internet protocols Source: Web Services Glossary

  7. What are Web Services? XML Application 1 Application 2

  8. CERN IDS Is this New?

  9. A Brief History …

  10. Is this Different? • Platform neutral • Open Standards • Interoperable • Based on ubiquitous software • XML Parsers • HTTP Server

  11. The Components

  12. Transport • HTTP POST is most common • But other protocols such as • FTP • SMTP • HTTP GET • And other exotic ones: • Jabber • BEEP

  13. Packaging – Soap • Used to mean • Simple • Object • Access • Protocol • From SOAP 1.2 > SOAP is no longer an acronym • Two Types of SOAP

  14. Packaging – Soap • SOAP RPC: • encode and bind data structures into xml. • encode an RPC call

  15. Serialization class PurchaseOrder { String item = “socks”; int amount = 1; } <PurchaseOrder> <item type=“xsd:string”> socks </item> <amount type=“xsd:int”> 1 </amount> </PurchaseOrder> Serializer

  16. Packaging - SOAP • SOAP ‘document style’ • packages xml in an envelope

  17. Packaging – Soap HTTP Post SOAP Envelope SOAP Head SOAP Body

  18. Packaging – Soap <s:Envelope xmlns:s=“URN”> <s:header> <s:transaction xmlns:m=“soap-transaction”> <m:transactionID> 1234 </m:transactionID > </s:transaction> </s:header>

  19. Packaging – Soap <s:Body> <n:purchaseOrder xmlns:n=“URN”> <n:item>socks</n:item> <n:amount>1</n:amount> </n:purchaseOrder> </s:Body> </s:Envelope>

  20. Description – WSDL • Web Services Description Language • “Web Services Description Language (WSDL) provides a model and an XML format for describing Web services.” w3c.org

  21. Description – WSDL Types Messages Operations Encoding Endpoint

  22. Types <types> <schema targetNamespace=" IMessageService.xsd" xmlns="…/XMLSchema" xmlns:SOAPENC="…/soap/encoding/"/> </types>

  23. Messages <message name=“purchase"> <part name=“item" type="xsd:string"/> <part name=“quantity" type="xsd:integer"/> </message>

  24. Operations <operation name="setMessage"> <input name="setMessageRequest“ message="tns:setMessageRequest"/> <output name="setMessageResponse“ message="tns:setMessageResponse"/> </operation>

  25. Encoding <soap:operation soapAction="" style="rpc"/> <input name="setMessage0Request"> <soap:body use="encoded" namespace="MessageService" encodingStyle="…/soap/encoding/"/> </input>

  26. Endpoint <service name="MessageService"> <port name="MessageServicePort" binding="tns:MessageServiceBinding"> <soap:address location="http://localhost:8080/setMessage/"/> </port> </service>

  27. Discovery – UDDI • Universal Description, Discovery and Integration • A UDDI Server acts as a registry for Web Services and makes them searchable.

  28. Discovery – UDDI • Demonstration: https://uddi.ibm.com/ubr/registry.html

  29. Discovery – UDDI UDDI Registry Inquiry Publish

  30. Discovery – UDDI UDDI Registry Inquiry Publish

  31. Examples • Java • Client • Server • VBScript • Client –high level API • Client – low level API • .NET • C# Client • C# Server

  32. Design Recommendations • Create a local class • Create a method with the same name

  33. Examples (Java Client) URL endpointURL = new URL(endpoint); Call call = new Call(); call.setSOAPTransport(m_httpconn); call.setTargetObjectURI("MessageService"); call.setMethodName("setMessage"); call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

  34. Examples (Java Client) Vector params = new Vector(); params.addElement( new Parameter("name", java.lang.String.class, name, null)); params.addElement( new Parameter("colour", java.lang.String.class, colour, null)); call.setParams(params); Response response = call.invoke(endpointURL, "");

  35. Examples (Java Client) • Demonstration

  36. Examples (Java Server) • A Web service Server is simple: • New class with method • Then: • Register class with soap router • Or • Place the source code in a jws file

  37. Examples (VB Client) • High Level API (After adding a Web Service Reference) Dim serv As clsws_MessageService Set serv = New clsws_MessageService serv.wsm_setMessage txtName.Text, txtColor.Text

  38. Examples (VB Client) Serializer.Init Connector.InputStream Serializer.startEnvelope , ENC Serializer.SoapNamespace "xsi", XSI Serializer.SoapNamespace "SOAP-ENC", ENC Serializer.SoapNamespace "xsd", XSD Serializer.startBody Serializer.startElement Method, URI, , "method" Serializer.startElement “parameter“ Serializer.SoapAttribute "type", , "xsd:string", "xsi" Serializer.writeString username Serializer.endElement Serializer.endBody Serializer.endEnvelope Connector.EndMessage

  39. Examples (VB Client) Name Colour

  40. Examples (C# Client) • Add a Web References to a project Localhost.MessageService serv = new Localhost.MessageService(); serv.setMessage(x, y);

  41. Examples (C# Client) • Demonstration

  42. Examples (C# Server) public class Demo : System.Web.Services.WebService { public Demo() { InitializeComponent(); } [Web Method] public string HelloWorld() { return “Hello World”; } }

  43. CERN IDS Web ServicesFuture

  44. Security Bookstore Client Application

  45. Security Bank Client Application Bookstore Warehouse

  46. WS Security Standardisation • W3C - http://www.w3c.org • XML Encryption • XML Digital Signatures • WS-I - http://www.ws-i.org • WS Security Profile • OASIS - http://www.oasis-open.org • WS-Security • SAML - Security Assertion Markup Language • XACML - Extensible Access Control Markup Language • XKMS - XML Key Management Specification

  47. Security – Fire Walls Bookstore Client Application Fire Wall

  48. WS-I • Web Services Interoperability Organization http://www.ws-i.org R1017 A RECEIVER MUST NOT mandate the use of the xsi:type attribute in messages except as required in order to indicate a derived type WS-I Basic Profile Version 1.0

  49. Missing Pieces • Security • Single Sign-on, credentials • Transactions • Quality of service • Timeliness guarantees • Asynchronous operations • Co-ordination, workflow

More Related