Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Drexel University Software Engineering Research Group (SERG) 1 An Introduction to Web Services.

Similar presentations


Presentation on theme: "© Drexel University Software Engineering Research Group (SERG) 1 An Introduction to Web Services."— Presentation transcript:

1 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 1 An Introduction to Web Services

2 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 2 Web Services Architecture Client Protocol- Specific Server Web Service Container Web Service

3 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 3 Web Services Architecture Client Protocol- Specific Server Web Service Container Web Service SOAP over HTTP/S SOAP Native Call

4 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 4 Web Services Architecture (.Net Scenario) Client Web Service or Application Client Protocol- Specific Server IIS Web Server Web Service Container.Net Framework Web Service.asmx Component SOAP over HTTP/S SOAP Native Call

5 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 5 Web Services Architecture (Java Scenario) Client Web Service or Application Client Protocol- Specific Server Apache Tomcat JSP/Servlet Container Web Service Container Apache Axis/SOAP Web Service Java Component SOAP over HTTP/S SOAP Native Call

6 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 6 WSDL – The Contract for Invoking a Service Client Web Service Infrastructure Web Service Call Web Service WSDL Service Spec. 1.Parse Call 2.Validate Call Against WSDL 3.Validate Pass? 1.YES: Web Service Implementation 2.NO: Generate and Return Fault

7 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 7 WSDL – The Web Service Contract WSDL Service Interface Abstract Definition Service Implementation Concrete Definition Messages Operations Interface Binding Service Endpoint

8 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 8 Abstract and Concrete Elements of WSDL Service DefinitionWSDL Document Abstract Interface Definition Concrete Implementation Definition............

9 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 9 Service WSDL Structure Name = Ports: Collection of Ports Port Binding = Address: Physical Endpoint Binding Name = Type = Operations: Operation Collection Operation Name = Input name=Logical_In_Op_Name Output name=Logical_Out_Op_Name PortType/Interface Name = Operations: Operation Collection Operation Name = Input message= Output message= Message Name = Parts: Collection of Parts Part Name = Type = Type Name = Simple Built In Type OR ComplexType: XSD Definition of Type 1..* Concrete Abstract Message Type Message Name Port/Interface Name Operation Name Binding Name

10 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 10 What is WSDL? Web Service Description Language Specifies Types: types defined for usage in the messages Messages: the messages being exchanged between a client and a service Port types / Interfaces: An abstract set of operations supported by one or more endpoints (commonly known as an interface); operations are defined by an exchange of messages Bindings: concrete protocol and data formats for a specific port type Service: a collection of bound ports and addresses WSDL allows for the automatic generation of service proxies Concrete Abstract

11 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 11 WSDL Types The web services standards define a collection of common types, user-defined types can be specified using XML schema Example: Array of Strings (“ArrayOf_xsd_string”)

12 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 12 WSDL Message Each message to and from a web service is modeled via a tag A given message may have 1 or more parts Each message part has a name and a type

13 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 13 WSDL PortType / Interface PortType elements have been renamed to Interface elements These elements associate messages with the operations that they will be used for Defines input, output and fault operations

14 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 14 WSDL Bindings Bindings provide the concrete syntax that must be used to access operations for different protocols <wsdlsoap:body encodingStyle="http://.../" namespace="urn:DirectoryService" use="encoded"/> <wsdlsoap:body encodingStyle=“http://.../" namespace="urn:DirectoryService" use="encoded"/>

15 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 15 WSDL Services Service elements encapsulate one or more physical ports defining an endpoint for the service Port definition includes the binding reference

16 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 16 WSDL defines a service contract WSDL Proxy Component Stub i.e., WSDL2Java Component Implementation WSDL i.e., Java2WSDL WSDL can be generated from an implementation or be used to generate a proxy class

17 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 17 WSDL is your Service Contract Approaches: Contract-First Contract-Last Meet-in-the-Middle

18 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 18 Contract First WSDL Component Stub Component Proxy Advantages: Optimized Interface, Portable Interface Disadvantages: Hard to develop

19 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 19 Contract Last Proxy Component Stub Component Implementation WSDL Advantages: No need to know WSDL, Easy Disadvantages: Non-optimized stubs, portability problems are possible

20 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 20 Meet-In-The Middle Component Interface WSDL Blends the advantages of the contract- first and contract-last approaches Hand-Optimized WSDL Component Stub Component Proxy

21 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 21 SOAP SOAP is the web service standard for encoding requests and responses to and from web services

22 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 22 SOAP Structure SOAP Envelope Header Language, Security, Schema,etc. Body Input/Output Message Fault Information Extensions Attachments not governed by SOAP schema Extensions

23 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 23 The Body Section… Document-Centric or RPC-Centric Doc-Centric is the.Net default, the body contains an xml representation of the request/response RPC-Centric is the Java default, the body contains name/value pairs of the arguments in the request/response

24 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 24 SOAP Request -.Net

25 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 25 SOAP Response -.Net

26 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 26 SOAP Request – Axis/Java (RPC-Centric)

27 © Drexel University Software Engineering Research Group (SERG) http://serg.cs.drexel.edu 27 SOAP Response – Axis/Java (RPC-Centric)


Download ppt "© Drexel University Software Engineering Research Group (SERG) 1 An Introduction to Web Services."

Similar presentations


Ads by Google