Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Server-Side Web Development Introduction to Server-Side Web Development using JSP and Web Services Session IV: JSP and Web Services 11.

Similar presentations


Presentation on theme: "Introduction to Server-Side Web Development Introduction to Server-Side Web Development using JSP and Web Services Session IV: JSP and Web Services 11."— Presentation transcript:

1 Introduction to Server-Side Web Development Introduction to Server-Side Web Development using JSP and Web Services Session IV: JSP and Web Services 11 th March 2004 Bogdan L. Vrusias b.vrusias@surrey.ac.uk

2 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20042 Introduction The first revolution with the Internet was all about delivering information to people. We are now in the second revolution, which focuses on delivering information to systems. XML is the tool that makes this new revolution a reality, and Web services are the methods with which businesses will drive system-to- system communication.

3 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20043 Session IV Before we go into Web services, we look into the Implicit Objects and the JSP Environment. What is a Web service. Tools and APIs for developing a Web service. Basic Web Service Process Advantages and disadvantages of Web services.

4 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20044 Implicit Objects and the JSP Environment The scriptlets and expressions written in a JSP page do not stand alone as a complete program – trey need an environment in which to operate. The JSP container provides this environment and makes it accessible to the page author through what are called implicit objects: –request ( HttpServletRequest ) –response ( HttpServletResponce ) –pageContext –session ( HttpSession ) –application ( ServletContext ) –out ( JspWriter ) –config –page –exception

5 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20045 Basic request Methods String getHeader(String name) Enumeration getHeaderNames() String getParameter(String name) Enumeration getParameterNames() HttpSession getSession(boolean create) String getMethod()

6 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20046 Basic response Methods String getHeader(String name) Enumeration getHeaderNames() String getParameter(String name) Enumeration getParameterNames() HttpSession getSession(boolean create)

7 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20047 Basic session Methods Object getAttribute(String name) Enumeration getAttributeNames() String getId() int getMaxInactiveInterval() void invalidate() void setAttribute(String name, Object value)

8 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20048 Basic application Methods Object getAttribute(String name) void setAttribute(String name, Object value) void removeAttribute(String name) Enumeration getAttributeNames() String getRealPath(String path) URL getResource(String path) void log(String msg)

9 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 20049 Basic pageContext Methods Object findAttribute(String name) Object getAttribute(String name) void setAttribute(String name, Object value, int scope) void removeAttribute(String name, int scope) Application Session Request Page

10 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200410 Basic out Methods void print(String value) void println(String value)

11 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200411 What is a Web Service? Simply: A web service is a product in the form of a reusable function build by one company that is exposed on the Internet for another company to use. Web service is a remote Internet service that’s capable of sending and receiving data over an HTTP network within a well defined XML package. Using a Web service can be as simple as logging into a Web site or as complex as facilitating a multi-organisational business negotiation. For example, some search engine web sites provide this service. The search request can happen at a site, but the actual search occurs at another site hosting the search service. The practical reason to build a web service is to permit businesses to provide small, reusable, and self-describing computing methods to each other.

12 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200412 Characteristics of a Web Service The data representation model is XML based. They are accessible using standard Internet protocols such as HTTP or SMTP. The user of a Web service is not tied to that Web service directly (loosely coupled). Ability to be synchronous or asynchronous. The clients can call methods, procedures, and functions on remote objects, through the Remote Procedure Calls (RPCs). They are distributed. They can centralise to a single source. A single Web service is NOT a full application. A Web service can be self-describing. Web services support the transparent exchange of documents to facilitate business integration.

13 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200413 The basic building blocks XML –Without XML, Web services would not have been possible! SOAP (Simple Object Access Protocol) –SOAP is a protocol used for transferring queries and responses used by a Web service. –SOAP has three parts: A self-described envelop in which a message is contained. A set of encoding rules to define special Web service-defined data types. Rules for describing the exposed methods of a Web service. –Security issues (SSL, encryption) WSDL (Web Service Description Language) –WSDL is an XML-formatted language for describing Web services. –WSDL has the ability to describe a Web service in a standard way.

14 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200414 Service Management Initiatives UDDI (Universal Description, Discovery and Integration) –UDDI is a distributed directory that allows businesses to list themselves on the Internet. –Businesses can access UDDI either through a Web interface or through automated programming methods. ebXML (e-business XML) –ebXML is a specification for standardising XML globally to aid in trade between organisations of any size. –It provides a standard method to exchange business messages written in XML. UDDI Vs ebXML –ebXML is design to be a complete business-to-business solution while UDDI focuses on serving as a simple index and a place for companies to integrate Web services relative to each other.

15 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200415 Basic Web Service Process Register – The service provider registers its services with a UDDI registry. Enquire – The client looks up the service from the UDDI registry. Describe – The client obtains a description of the various methods and parameter types from the service provider in the form of WSDL. Communicate – The client invokes the Web service using SOAP, and the service sends a SOAP response back to the client. CLIENT UDDI Repository WEB SERVICE Register Enquire Describe Communicate

16 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200416 Java APIs SAAJ (SOAP with Attachments API for Java) JAX-RPC (Java API for XML-based RPC) AXIS (Apache eXtensive Interaction System) (…used to be Apache SOAP) JAXM (Java API for XML Messaging) JAXR (Java API for XML Registries) JWSDL (Java API for WSDL) …

17 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200417 Advantages Logic can be broken down into smaller reusable pieces of code. The code can be used by many different applications. The code can be registered so that many different organisations can use a single Web service. Web services can describe themselves to the world through special registries. Standalone protocols, APIs, and tools are evolving to allow programmers to build and access Web services.

18 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200418 Disadvantages You need to create another software tier to utilise Web services. Accessing Web services over the Internet causes both security and speed concerns for an application designer.Automated tool that support Web services are currently young and few. Web services are new within the programming community. Unlike XML, which has the W3C to control and define XML, currently no single organisation exists to define the nature of a Web service.

19 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200419 A Warning Due to the current constantly changing nature of Web services, we should not rush into them. Instead, we should carefully and slowly enter into Web services marketplace. Start with small interactions to gain experience. Probably using it internally at first is a wise decision to take. Then… ones you have reached and understand Web services and the major development tool have matured… go for it.

20 Introduction to Server-Side Web Development 11 th March 2004Bogdan L. Vrusias © 200420 Session IV: Closing Questions??? Remarks??? Comments!!! Evaluation!


Download ppt "Introduction to Server-Side Web Development Introduction to Server-Side Web Development using JSP and Web Services Session IV: JSP and Web Services 11."

Similar presentations


Ads by Google