170 likes | 176 Views
This article provides an overview of web services, including their definition, benefits, drawbacks, architecture, communication process, tools, and implementation. It also discusses the different web services development platforms and references for further information.
E N D
Overview of Web Services Maria Lizarraga CS526
Agenda • Definition • Benefits/Drawbacks • Architecture • Communication Process • Tools • Implementation Maria Lizarraga
What is a web service? • A web service is a web software application available on the network that provides an interface for exchanging information with a client. • the software application • a method to interface to the application • URI associated with the application • a published document that gives visibility to the world Maria Lizarraga
Benefits • Platform and Language Independent • Uses industry standards • Low cost internet communication • Reduces development effort Maria Lizarraga
Drawbacks • Less efficient, slow • Hard to locate • Requires learning a different set of development tools and technology Maria Lizarraga
Architecture Maria Lizarraga
Web Services Description Language (WSDL) Document • Name • Location • Operations • Data Types See WSDL document. Maria Lizarraga
Universal Description, Discovery, and Integration (UDDI) Registry • Publish Web Services • Discovering Web Services Maria Lizarraga
Simple Object Access Protocol, SOAP Message • XML • Embedded into HTTP • Three parts • Envelope • Header • Body Maria Lizarraga
Communication Process Maria Lizarraga
Client Application Maria Lizarraga
SOAP Message POST /GradesService/services/GradesService HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: IBM WebServices/1.0 Host: localhost:9080 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 356 <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/ envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/ encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> <soapenv:Body> <getStudents xmlns="http://grades"/> </soapenv:Body> </soapenv:Envelope> Application package grades; public class GradesService { final int NUMSTUDENTS = 4; String[] students; char[] grade; public GradesService ( ) { students = new String [] {"Mary", "Joe", "Sally", "Tim"}; grade = new char [] {'A', 'B', 'C', 'D'}; } // end constructor public char getStudentGrade (String student) { for (int i = 0; i < NUMSTUDENTS; i++) if (student.equals(students[i])) return grade[i]; return 'Z'; } // end getStudentGrade public String getStudent (int studentID) { return students[studentID]; } // end getStudent public String[] getStudents ( ) { return students; } // end getStudents public static void main(String[] args){ GradesService gs = new GradesService(); for (int i = 0; i < gs.NUMSTUDENTS; i++) System.out.println("Student: " + gs.getStudent (i) + "\tGrade:” + gs.getStudentGrade(gs.getStudent(i))); } // end main } // end class GradesService Request Maria Lizarraga
HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-US Connection: close <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <getStudentsResponse xmlns="http://grades"> <getStudentsReturn> Mary </getStudentsReturn> <getStudentsReturn> Joe </getStudentsReturn> <getStudentsReturn> Sally </getStudentsReturn> <getStudentsReturn> Tim </getStudentsReturn> </getStudentsResponse> </soapenv:Body> </soapenv:Envelope> Response Maria Lizarraga
Web Services Development Platforms • Java Web Services Development Pack (JWSDP) • IBM WebSphere • Systinet Web Applications and Services Platform (WASP) • Microsoft.NET • HP Web Services Platform Maria Lizarraga
WebSphere Implementation • Create an application • Create a server • Create a project • Create a service • Test the service • Create the client • Test the client • Publish the service Maria Lizarraga
Summary • Architecture • UDDI Registry, Client and Server Applications • WSDL • SOAP • Communication Process • Application -> Stub -> Runtime -> SOAP Message • Soap Message -> Runtime -> Ties -> Application • Web Services Development Platforms Maria Lizarraga
References • IBM WebBench, http://www-306.ibm.com/software/websphere/ • The Java Web Services Tutorial 1.0, August 7, 2002, http://java.sun.com/webservices/docs/1.0/tutorial/ • Web Services Description Language (WSDL) 1.1, http://www.w3.org/TR/wsdl • UDDI web site, http://www.uddi.org • SOAP Tutorial, http://www.w3schools.com/soap • Deploying Web services with WSDL: Part 1, Bilal Siddiqui, http://www-106.ibm.com/developerworks/library/ws-intwsdl/ Maria Lizarraga