11 Web Services Dr. Miguel A. Labrador Department of Computer Science & Engineering

Slides:



Advertisements
Similar presentations
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Advertisements

Overview of Web Services
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
RPC Robert Grimm New York University Remote Procedure Calls.
Snejina Lazarova Senior QA Engineer, Team Lead CRMTeam Dimo Mitev Senior QA Engineer, Team Lead SystemIntegrationTeam Telerik QA Academy SOAP-based Web.
J2ME Web Services Specification.  With the promise to ease interoperability and allow for large scale software collaboration over the Internet by offering.
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
J2ME RMI 1 Java 2 Platform, Micro Edition Implementation of J2ME RMI Application Farooq Sheikh.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 42 Web Services.
Lecture 10: Web Services. Outline Overview of Web Services Create a Web Service with Sun J2EE (JAX-RPC)
1 HyCon Framework Overview Frank Allan Hansen and Bent Guldbjerg Christensen ! Run this presentation in presentation mode to watch animations.
Web Services CS Web Services Internet-available services using XML messaging, for computer-computer interaction Not tied to any OS or language Self-describing:
INTRODUCTION TO WEB SERVICES CS 795. What is a Web Service ? Web service is a means by which computers talk to each other over the web using HTTP and.
RSS RSS is a method that uses XML to distribute web content on one web site, to many other web sites. RSS allows fast browsing for news and updates.
1 Java Server Programming zLecture 1 focuses on: yIntroduction to web services y Web Services using Axis y The bigger Picture: Introduction to J2EE y Java.
Processing of structured documents Spring 2003, Part 6 Helena Ahonen-Myka.
Web Services Mohamed Fahmy Dr. Sherif Aly Hussein.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
C Copyright © 2009, Oracle. All rights reserved. Appendix C: Service-Oriented Architectures.
SSC2: Web Services. Web Services Web Services offer interoperability using the web Web Services provide information on the operations they can perform.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
WSDL Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II.
COP 4991 Component Based Software Development Lecture #4 Java Web Services Onyeka Ezenwoye.
1 HRS2422 Web Services JAX-WS and SOAP Introduction  Web service – A software component stored on one computer that can be accessed via method.
Small Devices on DBGlobe System George Samaras Chara Skouteli.
Web Services & WCF ~ Ankit. Web services A web service is a collection of protocols and standards used for exchanging data between applications or systems.
Web Services An introduction for eWiSACWIS May 2008.
CSCI 6962: Server-side Design and Programming Web Services.
J2ME Presented by May Sayed & Menna Hawash. Outline Introduction “Java Technology” Introduction “What is J2ME?” J2ME Architecture J2ME Core Concepts 
Lecture 15 Introduction to Web Services Web Service Applications.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Web Services Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Web Services based e-Commerce System Sandy Liu Jodrey School of Computer Science Acadia University July, 2002.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University February 07, 2005.
Introduction to Server-Side Web Development Introduction to Server-Side Web Development using JSP and Web Services JSP and Web Services 18 th March 2005.
Copyright © 2013 Curt Hill SOAP Protocol for exchanging data and Enabling Web Services.
1 Web Services Web and Database Management System.
Web Services (SOAP) part 1 Eriq Muhammad Adams J |
XML and Web Services (II/2546)
C# 1 Web services CSC 298. C# 2 Web services  A technology to make libraries available across the internet.  In Visual Studio,  can create a web service.
Developing Web Services with the Eclipse Web Tools Platform David Gallardo.
Web Services An Introduction Copyright © Curt Hill.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
Web Services Architecture Presentation for ECE8813 Spring 2003 By: Mohamed Mansour.
.NET Mobile Application Development XML Web Services.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Lecture VI: SOAP-based Web Service CS 4593 Cloud-Oriented Big Data and Software Engineering.
Presentation 11: SOAP on small devices. Ingeniørhøjskolen i Århus Slide 2 af 10 Outline Which small devices? What are the limitations and what kind of.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
Presentation 11: SOAP on small devices. Ingeniørhøjskolen i Århus Slide 2 af 10 Outline Which small devices? What are the limitations and what kind of.
DEVELOPING WEB SERVICES WITH JAVA DESIGN WEB SERVICE ENDPOINT.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
The Java API for XML-Based Web Services. A Web Service example in Java SOAP-awareServlet (e.g. Apache Axis2) SOAP-awareServlet Any class processing the.
Java Web Services Orca Knowledge Center – Web Service key concepts.
GF and RS, Dept of CS, Mangalore University
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Sabri Kızanlık Ural Emekçi
Chapter 5 Remote Procedure Call
WEB SERVICES.
Unit – 5 JAVA Web Services
GF and RS, Dept. of CS, Mangalore University
Web services, WSDL, SOAP and UDDI
WebServices Using JAX-RPC
Introduction to Web Services
Distributed System using Web Services
Chapter 42 Web Services.
Distributed System using Web Services
Presentation transcript:

11 Web Services Dr. Miguel A. Labrador Department of Computer Science & Engineering

2 Copyright© Dr. Miguel A. Labrador 2 2 Outline Introduction Web services components The Web Services API Creating a simple Web service –Server side –MIDlet

3 Copyright© Dr. Miguel A. Labrador 3 3 Web Services Created to allow any networked application client to find applications located anywhere in the Internet and use them as if they were locally installed applications –Regardless of platform To realize this vision, four critical aspects are needed: –Develop and deploy applications that can be accessed and used by everyone –Describe the services Web Services Definition Language (WSDL) –Find the services Universal Description, Discovery, and Integration (UDDI) registry –Not really needed if you know the URL where the service is offered –Connect and use the services Standard protocols and languages –HTTP, SOAP, RPC, XML

4 Copyright© Dr. Miguel A. Labrador 4 4 The Java ME Platform Service Provider Creates Web Service Application Stub ClientWSDL Document UDDI Request Service Creates Registers Finds and Obtains Service WSDL

5 Copyright© Dr. Miguel A. Labrador 5 5 The Web Services API Based on JSR 172, J2ME Web Services APIs (WSA) –The purpose of this specification is to define an optional package that provides standard access from Java ME devices to Web services Two optional packages –Java API for XML-based RPC (JAX-RPC) Allows mobile devices to access remote XML-based Web services Java API for interacting with SOAP-based Web services –Implementation of RPC in Java –Java API for XML Processing (JAXP) Adds XML parsing capabilities to the Java ME platform Can be used by all applications

6 Copyright© Dr. Miguel A. Labrador 6 6 The Web Services API Application Operating System CLDC 1.1 MIDP 2.0 JAX-RPC Runtime Service Provider Interface (SPI) JAX-RPC Stub JAXP API JAX- RPC API Server Service Request Service Response SOAP XML/HTTP Client

7 Copyright© Dr. Miguel A. Labrador 7 7 The JAX-RPC Package Contains the javax.microedition.xml.rpc, javax.xml.namespace, javax.xml.rpc and javax.rmi packages –All classes and interfaces that make up the stub, SPI, and runtime Stub makes requests to the runtime and receives service responses through the service provider interface –An instance of the stub class is generated by the stub generator. The instance is used to: Set the properties of the stub to invoke an RPC Make all appropriate format conversions Create objects describing the input and return parameters Encode the input values Invoke the RPC Decode the return value The runtime contains all the functionality needed to transfer data to and from the server on behalf of the application

8 Copyright© Dr. Miguel A. Labrador 8 8 The JAXP Package Subset of the J2SE JAXP API Includes the javax.xml.parsers, org.xmal.sax, org.xmal.sax.helpers packages Parse XML data

9 Copyright© Dr. Miguel A. Labrador 9 9 Creating a Web Service Creating a Web service is very much automated in NetBeans Let us go through the process of creating a Web service that functions like a calculator –MIDlet asks user for operands and type of operation (sum, …) –MIDlet sends request to Web server –Web server calculates the result and sends it back to MIDlet Need to develop Web server part and MIDlet

10 Copyright© Dr. Miguel A. Labrador 10 Copyright© Dr. Miguel A. Labrador 10 Web Service Part The process consists of the following chronological steps –Define operations to perform (sum, subtraction, multiplication, division) –Define input and output parameters –Create a New Application Project From the Categories list, select Web From the Projects list, select Web Application Write in the name of your project Click Next and Finish –Create a new package for the project Select project in Projects’ tab and right click on it Select New->Java Package Write in name and click on Finish

11 Copyright© Dr. Miguel A. Labrador 11 Copyright© Dr. Miguel A. Labrador 11 Web Service Part The process consists of the following chronological steps –Create Web Service Select project in Projects’ tab and right click on it Select New->Web Service Write in Name Select package just created and Finish The configuration screen appears to define operations and parameters –Design the service

12 Copyright© Dr. Miguel A. Labrador 12 Copyright© Dr. Miguel A. Labrador 12 Web Service Part

13 Copyright© Dr. Miguel A. Labrador 13 Copyright© Dr. Miguel A. Labrador 13 Web Service Part The process consists of the following chronological steps –Click on “Source” button to see the Web Service code that NetBeans automatically creates for you Only need to include the code that performs each function in the respective part

14 Copyright© Dr. Miguel A. Labrador 14 Copyright© Dr. Miguel A. Labrador 14 Creating a Web Service The process consists of the following chronological steps –Save changes –Click on service and right click for Clean and Build –Click on service and right click to Undeploy and Deploy your project –NetBeans also automatically creates the WSDL file – (Glassfish 12796)/Project Name (Context Path from Properties/Run menu)/Web service name(CalculatorService)?wsdl – ce?wsdl –

15 Copyright© Dr. Miguel A. Labrador 15 Copyright© Dr. Miguel A. Labrador 15 Example WSDL File -<!-- Published by JAX-WS RI at RI's version is JAX-WS RI hudson-417-SNAPSHOT. --> -<!-- Generated by JAX-WS RI at RI's version is JAX-WS RI hudson-417-SNAPSHOT. --> -<definitions xmlns:wsu=" wssecurity-utility-1.0.xsd" xmlns:soap=" xmlns:tns=" xmlns:xsd=" xmlns=" targetNamespace=" name="ServerCalculatorService"> - <xsd:import namespace=" schemaLocation=" />

16 Copyright© Dr. Miguel A. Labrador 16 Copyright© Dr. Miguel A. Labrador 16 Creating the MIDlet The process consists of the following chronological steps –Next step is to create the MIDlet –Create New Project Mobility, MIDP Application –Write in name and click Finish –Create package as before –Select Project, right click, New Visual MIDlet –Write in the MIDlet name, select package –Select New Java ME Web Service Client Provide URL of WSDL document Click on Retrieve WSDL –NetBean creates application skeleton –Maps WSDL definitions to Java representation and XML data types to Java types –Design Visual MIDlet

17 Copyright© Dr. Miguel A. Labrador 17 Copyright© Dr. Miguel A. Labrador 17 Creating a MIDlet

18 Copyright© Dr. Miguel A. Labrador 18 Copyright© Dr. Miguel A. Labrador 18 Creating the MIDlet

19 Copyright© Dr. Miguel A. Labrador 19 Copyright© Dr. Miguel A. Labrador 19 Creating the MIDlet The process consists of the following chronological steps –Add the code public void commandAction(Command command, Displayable displayable) { // write pre-action user code here if (displayable == form) { if (command == okCommand) { // write pre-action user code here // write post-action user code here Runnable theInvoker = new Runnable(){ public void run() { int op1 = Integer.parseInt(textField.getString()); int op2 = Integer.parseInt(textField1.getString()); ServerCalculatorService_Stub remoteCalculator = new ServerCalculatorService_Stub(); int op3; try { op3 = remoteCalculator.calculateSum(op1, op2); textField2.setString(""+op3); } catch (RemoteException ex) { ex.printStackTrace(); textField2.setString(ex.getMessage()); } }; Thread t = new Thread(theInvoker); t.start();

20 Copyright© Dr. Miguel A. Labrador 20 Copyright© Dr. Miguel A. Labrador 20 Creating the MIDlet The process consists of the following chronological steps –Run the MIDlet