© Drexel University Software Engineering Research Group (SERG) 1 An Introduction to Web Services
© Drexel University Software Engineering Research Group (SERG) 2 Web Services Architecture Client Protocol- Specific Server Web Service Container Web Service
© Drexel University Software Engineering Research Group (SERG) 3 Web Services Architecture Client Protocol- Specific Server Web Service Container Web Service SOAP over HTTP/S SOAP Native Call
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 7 WSDL – The Web Service Contract WSDL Service Interface Abstract Definition Service Implementation Concrete Definition Messages Operations Interface Binding Service Endpoint
© Drexel University Software Engineering Research Group (SERG) 8 Abstract and Concrete Elements of WSDL Service DefinitionWSDL Document Abstract Interface Definition Concrete Implementation Definition
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 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”)
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 14 WSDL Bindings Bindings provide the concrete syntax that must be used to access operations for different protocols <wsdlsoap:body encodingStyle=" namespace="urn:DirectoryService" use="encoded"/> <wsdlsoap:body encodingStyle=“ namespace="urn:DirectoryService" use="encoded"/>
© Drexel University Software Engineering Research Group (SERG) 15 WSDL Services Service elements encapsulate one or more physical ports defining an endpoint for the service Port definition includes the binding reference
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 17 WSDL is your Service Contract Approaches: Contract-First Contract-Last Meet-in-the-Middle
© Drexel University Software Engineering Research Group (SERG) 18 Contract First WSDL Component Stub Component Proxy Advantages: Optimized Interface, Portable Interface Disadvantages: Hard to develop
© Drexel University Software Engineering Research Group (SERG) 19 Contract Last Proxy Component Stub Component Implementation WSDL Advantages: No need to know WSDL, Easy Disadvantages: Non-optimized stubs, portability problems are possible
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 21 SOAP SOAP is the web service standard for encoding requests and responses to and from web services
© Drexel University Software Engineering Research Group (SERG) 22 SOAP Structure SOAP Envelope Header Language, Security, Schema,etc. Body Input/Output Message Fault Information Extensions Attachments not governed by SOAP schema Extensions
© Drexel University Software Engineering Research Group (SERG) 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
© Drexel University Software Engineering Research Group (SERG) 24 SOAP Request -.Net
© Drexel University Software Engineering Research Group (SERG) 25 SOAP Response -.Net
© Drexel University Software Engineering Research Group (SERG) 26 SOAP Request – Axis/Java (RPC-Centric)
© Drexel University Software Engineering Research Group (SERG) 27 SOAP Response – Axis/Java (RPC-Centric)