3. Web Evolution Web Services using Apache Axis | Atul Kahate XML Programmability Connectivity HTML Presentation TCP/IP Technology Innovation FTP, E-mail, Gopher Web Pages Browse the Web Program the Web Web Services
4. Distributed Programming Web Services using Apache Axis | Atul Kahate Remote Procedure Call (RPC) Program A calls Program B remotely (different process, possibly different computer) Remote Objects Method M1 of Object A calls method M2 of Object B remotely (different process, possibly different computer)
5.
6. Middleware Layers Web Services using Apache Axis | Atul Kahate Applications Remote objects, RMI, and Events Request-Response protocol External data representation Operating system Middleware layers
10. Web Services Versus HTTP Web Services using Apache Axis | Atul Kahate Client-server programming Programs with specific function in mind HTTP based communication Generic functionality accessed using a browser Web Services Specific functionality accessed using HTTP
11. Web Server versus Web Service Web Services using Apache Axis | Atul Kahate Web Server Provides basic HTTP service Web Service Provides a service based on operations defined in its interface
12.
13.
14.
15. Web Service Concept Web Services using Apache Axis | Atul Kahate A Web server running at http://www.ttdev.com A Web service running at the path /SimpleService An operation An operation Name: concat Name: … Full path of the Web service is http://www/ttdev.com/SimpleService
21. Data Types Refined Web Services using Apache Axis | Atul Kahate Operation concat Local name: concat Namespace: http://www.ttdev.com/ss Parameters: s1: string in http://www.w3.org/2001/XMLSchema s2: string in http://www.w3.org/2001/XMLSchema Return: string in http://www.w3.org/2001/XMLSchema
22.
23. Adding Messages and Parts Web Services using Apache Axis | Atul Kahate Operation concat Local name: concat Namespace: http://www.ttdev.com/ss Input message: Part 1: Name: s1 Type: string in http://www.w3.org/2001/XMLSchema Part 2: Name: s2 Type: string in http://www.w3.org/2001/XMLSchema Output message: Part 1: Name: return Type: string in http://www.w3.org/2001/XMLSchema
29. Document Style Web Service Web Services using Apache Axis | Atul Kahate Operation concat Local name: concat Namespace: http://www.ttdev.com/ss Input message: Part 1: Name: concatRequest Element: Output message: Part 1: Name: concatResponse Type: string in http://www.w3.org/2001/XMLSchema <xsd:schema targetNamespace = ”http://www.ttdev.com/ss” xmlns:xsd = ”http://www.w3.org/2001/XMLSchema”> <xsd:element name = “concatRequest”> <xsd:complexType> <xsd:sequence> <xsd:element name = “s1” type = “xsd:string” /> <xsd:element name = “s2” type = “xsd:string” /> <xsd:sequence> <xsd:complexType> </xsd:element> </xsd:schema> <test:concatRequest xmlns:test=”http://www.ttdev.com/ss”> <s1>abc</s1> <s2>123</s2> </test:concatRequest> Operation details XML schema Sample message
30. Sample Return (Output) Message Web Services using Apache Axis | Atul Kahate <test:concatResponse xmlns:test = “http://www.ttdev.com/ss” xmlns:xsd = “http://www.w3.org/2001/XMLSchema” xmlns:xsi = “http://www/w3.org/2001/XMLSchema-Instance” xsi:type = “xsd:string”> abc123 </test:concatRespnose> Indicates that the return type is string, which is defined in the Schema-Instance namespace
33. Using Port Types Web Services using Apache Axis | Atul Kahate Web service Port type Local name: StringUtil Namespace: http://ttdev.com/ss Operation Local name: concat Namespace: http://ttdev.com/ss … Operation Local name: separate Namespace: http://ttdev.com/ss … Schema … Port type Local name: DateUtil Namespace: http://ttdev.com/ss Operation Local name: getDifference Namespace: http://ttdev.com/ss … Operation Local name: convertFormat Namespace: http://ttdev.com/ss …
36. Web Services using Apache Axis | Atul Kahate Web service Schema … Port type: stringUtil concat … Binding Name: binding_1 Port type: stringUtil Format: SOAP Transport: HTTP Binding Name: binding_2 Port type: stringUtil Format: TEXT Transport: SMTP Example POST http://www.ttdev.com/ss/abc <concatRequest> <s1>abc</s1> <s2>123</s2> </concatRequest> Example FROM: user@mydomain.com TO: … concat (s1 = “abc”, s2 = “123”)
37.
38.
39. Web Services using Apache Axis | Atul Kahate Web service Schema … Port type: stringUtil concat … Binding Name: binding_1 Port type: stringUtil Format: SOAP Transport: HTTP Binding Name: binding_2 Port type: stringUtil Format: TEXT Transport: SMTP Deployed on Port 1 Deployed on Port 2 Deployed on Port 3 Port 4 C1 C2 C3
40.
41. Web Services using Apache Axis | Atul Kahate Web service Schema … Port type: stringUtil concat … Binding Name: binding_1 Port type: stringUtil Format: SOAP Transport: HTTP Binding Name: binding_2 Port type: stringUtil Format: TEXT Transport: SMTP Port Name: Port 1 Binding: Endpoint: … Port Name: Port 2 Binding: Endpoint: … Port Name: Port 3 Binding: Endpoint: … Deployed on Name: Port 4 Binding: Endpoint: …
42.
43. Web Services using Apache Axis | Atul Kahate Web service Target namespace: http://ttdev.com/ss Schema … Port type: stringUtil concat … Binding Name: binding_1 Port type: stringUtil Format: SOAP Transport: HTTP Binding Name: binding_2 Port type: stringUtil Format: TEXT Transport: SMTP Port Name: Port 1 Binding: Endpoint: … Port Name: Port 2 Binding: Endpoint: … Port Name: Port 3 Binding: Endpoint: … Deployed on Name: Port 4 Binding: Endpoint: …
44.
45. Summary Web Services using Apache Axis | Atul Kahate Service Port PortType Operation Message Message Operation Message Message Binding Port PortType Operation Message Message Operation Message Message Binding
46. WSDL and Java Web Services using Apache Axis | Atul Kahate WSDL portType Java Interface <portType name=”BookQuote”> public interface BookQuote { <operation name=”GetBookPrice”> <input name=”isbn” message=”GetBookPriceRequest”/> <output name=”price” message=”GetBookPriceResponse”/> </operation> public float getBookPrice (String isbn); <operation name=”GetBulkBookPrice”> <input name=”request” message=”GetBulkBookPriceRequest”/> <output name=”prices” message=”GetBulkBookPriceResponse”/> </operation> public float getBulkBookPrice (String isbn, int quantity); <operation name=”GetBookISBN”> <input name=”title” message=”GetBulkBookISBNRequest”/> <output name=”isbn” message=”GetBulkBookISBNResponse”/> </operation> public String getBookISBN (String bookTitle); </portType> }