際際滷

際際滷Share a Scribd company logo
Java Web Services
Sharmila Chalasani
MS Computer Science
State university of New York at Binghamton
Termination Project
Summer 2004
Outline
 Introduction to web services
 Existing solutions
 Web service Architecture
 Standards used
 Web services technology
 JAX-RPC Architecture
 Hosting using Java web services
 Steps involved in creating weather web service
 Consuming my weather forecast web service (client details)
 Some facts about web services
 References
Why are we here?
 "Web Services" contain the word "Web" and Web
technologies matter.
More and more people get connected using
computers, televisions, mobiles, 
 "Web Services" contain the word "services" and we
wonder why kind of services they will fulfill for us.
We already have services on the Web, so what's
missing?
The Problem (eg. how to buy tomatoes)
 Find the tomato sellers;
Yellow Pages: contain companies that are selling
tomatoes, their location, and contact information.
 Find the service offered according to my needs;
Where, when and how can I buy tomatoes?
 Buy the tomatoes;
do the transaction
Traditional web application/Web
service
Web Service Requirement
 Applications need to communicate:
Unless tomato buyers can communicate to tomato sellers, there
will be no business.
 The system must scale:
-As many tomato buyers and sellers as possible.
-Being able to use any future new kind of tomatoes or any kind of
products (potatoes, video games, )
-Add new layers: security!
 The solution must be portable across environments:
-Not all tomato buyers and sellers will use the same system or the
same language.
Used by anyone, anywhere, and with any kind of devices.
Existing solutions
 How can two (or more) applications communicate
today?
 Ad Hoc solutions:
Unless you want to buy your own tomatoes, it won't
be useful.
 Language-oriented solutions (Java RMI, )
Works well if the tomato seller uses your language
 Service-oriented solutions (CORBA, DCE, DCOM)
And about the Web?
Web service: definition
 A Web service is a software system identified by a
URI, whose public interfaces and bindings are
defined and described using XML. Its definition can
be discovered by other software systems. These
systems may then interact with the Web service in a
manner prescribed by its definition, using XML based
messages conveyed by Internet protocols.
 Loosely coupled, reusable software components that
semantically encapsulate discrete functionality and
are distributed and programmatically accessible over
standard Internet protocols.
Advantages of Web service
 Not based on a programming language:
Java, .Net, C, C++, Python, Perl, 
 Not based on a programming data model:
objects vs non-objects environments.
 Convergence of SOA (Service-Oriented
Architecture) and Web.
 Based on web technologies
 Do not need huge framework of memory
 Basic usage is b-to-b ,remote controlled
devices,internal external appl communications
Web services application
Can use Web Services to integrate across
departments, agencies, to companies, etc.
Web service Architecture
An architecture view based on SOAP, WSDL, and UDDI.
Web service Transport
 Data format
XML (subset of XML 1.0), URL encoding.
Data format schema definition: XML Schema
 Wire format
XML Protocol (XML-RPC, SOAP), URI
Transfer protocol: HTTP, SMTP, JMS, BEEP,
WS built on existing standards
 Extensible Markup Language (XML)
 The HTTP (Hypertext Transfer Protocol) standard is allowing
more systems to communicate with one another.
 SOAP (Simple Object Access Protocol) (built on XML)
standardizes the messaging capability on different systems.
 UDDI (Universal Description, Discovery, and Integration )
standardizes the publishing and finding of Web services.
 WSDL (Web Services Description Language ) standardizes
the description of Web services so providers and requesters
are speaking the same language.
Web Services technology
3 major Web services toolkits being used widely
 .NET Web services: Developed by Microsoft and is an
integral part of the complete .NET framework. Integrated and
easy to use with Visual Studio .NET. services are hosted on IIS
web servers.
 Java Web services: Suns Web service implementation for the
Java community. Comes bundled in a complete Java Web
services Development Pack (JWSDP Ver 1.3) including Tomcat
web server.
 Apache Axis: Initially developed by IBM and donated to the
Apache group. One of the earliest and stable Web service
implementation. Runs on Apache Web servers.
Package used in my project
 JWSDP 1.3 (java web services developer pack)
 JWSDP includes :
-Java XML pack
-Tomcat Java Servlet
-JavaServer pages containers
-Registry server
-Ant build tool.
 JWSDP 1.4 is released now
Java API used in my project
 JAX-RPC (Java API for XML based RPC)

Features and Developer Benefits :
- Portable and interoperable web services
- Ease of development of web services endpoints & clients
- Increased developer productivity
- Support for open standards: XML, SOAP, WSDL
- Standard API developed under Java Community Process
- Support for tools
- RPC programming model with support for attachments
- Support for SOAP message processing model & extensions
- Secure web services
- Extensible type mapping
JAX-RPC Architecture
Hosting using Java Web Services
 Required tools and files to create java web service :
Ant Tool : This a tool extensively used in J2EE architecture for
handling multiple configuration files while compiling several
files. You can consider it similar to make utility in unix platforms.
Build.xml : This is the file used by the Ant tool to get the
compilation and path directives. It contains options to selectively
compile-server, compile-client, generate-client, run-client etc
Build.properties : Some misc properties and path settings that
are referred to by build.xml.
config.xml : Defines the URL for WSDL file location. Each Web
services has a corresponding WSDL (Web service Definition
Language) document.
Hosting Java web services cont.
jaxrpc-ri.xml: Defines the various end points for referencing a
Web service.
Misc. utilities:
wscompile: The wscompile tool generates stubs, ties,
serializers, and WSDL files used in JAX-RPC clients and
services. The tool reads as input a configuration file and either
a WSDL file or an RMI interface that defines the service.
wsdeploy: Reads a WAR file (something like Jar file) and the
jaxrpc-ri.xml file and then generates another WAR file
that is ready for deployment
Steps : creating my project
MyWeatherService
 Deploy the service using ant deploy and verifying the service
using
service endpoint's URL:
http://localhost:8080/weather-jaxrpc/weather
Deployed MyWeatherService
 This page also has a URL to the service's WSDL file.
 model.gz file contains the internal data structures that
describe the service.
WSDL file of my web service
MyWeatherService functions
 Functions available from service endpoint interface :
- boolean isvalidZipCode(String zip)
- String getWeatherReport(String zip)
- HashMap getZipcodeListMap()
- getHighTemp , getLowTemp, getHumidity,
getWind, getVisibility etc.
Communicating modes accessing web service
Stubs, dynamic proxy,DII(dynamic invocation interface)
Consuming MyWeatherService
Clients created to consume my weather service :
genereate stubs, compile client, package client, run the client
 Static stub client
stubs are created before runtime (by wscompile), it is usually
called a static stub. .It makes this call through a stub, a local
object which acts as a proxy for the remote service.
 Dynamic Proxy client
This client creates a Service object which is factory of
proxies(stubs are created at runtime dynamically)
 Web Client
This client used .jsp pages to display web form for the user to
enter zipcode to get weather forecast by calling
getWeatherReport function on the stubs created before.
Consuming Web service cont.
Consuming Web service cont.
WebClient
Web services: challenges
 A whole suite of technologies to design:
communication protocol
description of services
enable security and privacy
describe complex interactions
...
 Must design to be interoperable and Web-
friendly
Some facts
 Web service is a new paradigm, it is in initial stages.
 Web service tech is evolving rapidly, sometimes in
unexpected directions .such changes may cause
difficulties early on.
 Various standards and specifications are still being
defined and refined.
 Security standards are also being defined.
 The key security issues for WS concern authentication ,
authorization, and ensuring security at the transport
and message level.They remain a work in progress by
the community.
References
 Java web services tutorial from sun
http://java.sun.com/webservices/docs/1.1/tutorial/doc/
 Java Web services In a Nutshell OReilly  Kim
Topley
 XML In a Nutshell O'Reilly
 Java Web Services for Experienced Programmers
Deitel developer series
 Java Web Services David Chappell OReilly
 New updates about the package jwsdp & projects
are discussed here https://jwsdp.dev.java.net/
Thanks

More Related Content

Similar to java web services - soap and rest services (20)

Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
Richard Banks
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
Knoldus Inc.
Web Server Hardware and Software
Web Server Hardware and SoftwareWeb Server Hardware and Software
Web Server Hardware and Software
webhostingguy
Rajeev_Resume
Rajeev_ResumeRajeev_Resume
Rajeev_Resume
Rajeev Bhatnagar
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
Anup72
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
Hong H畉i Nguy畛n
J2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBCJ2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBC
ChaithraCSHirematt
Cloud description
Cloud descriptionCloud description
Cloud description
thanuambika
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecture
rahmed_sct
Asp
AspAsp
Asp
Kundan Kumar Pandey
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET Basic
KALIDHASANR
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
cornelia davis
Web Browsers.pptx
Web Browsers.pptxWeb Browsers.pptx
Web Browsers.pptx
HariomMangal1
Assignment3.2
Assignment3.2Assignment3.2
Assignment3.2
Fina KHosravi
Making Rational HATS a Strategic Investment
Making Rational HATS a Strategic InvestmentMaking Rational HATS a Strategic Investment
Making Rational HATS a Strategic Investment
Strongback Consulting
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management system
Yesu Raj
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management system
Yesu Raj
newSkills_09
newSkills_09newSkills_09
newSkills_09
Yue Chao Qin
Brent Wilkins Resume
Brent Wilkins ResumeBrent Wilkins Resume
Brent Wilkins Resume
Brent Wilkins
Web-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptxWeb-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptx
AlokKumar250045
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
Richard Banks
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
Knoldus Inc.
Web Server Hardware and Software
Web Server Hardware and SoftwareWeb Server Hardware and Software
Web Server Hardware and Software
webhostingguy
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
Anup72
J2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBCJ2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBC
ChaithraCSHirematt
Cloud description
Cloud descriptionCloud description
Cloud description
thanuambika
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecture
rahmed_sct
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET Basic
KALIDHASANR
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
cornelia davis
Web Browsers.pptx
Web Browsers.pptxWeb Browsers.pptx
Web Browsers.pptx
HariomMangal1
Making Rational HATS a Strategic Investment
Making Rational HATS a Strategic InvestmentMaking Rational HATS a Strategic Investment
Making Rational HATS a Strategic Investment
Strongback Consulting
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management system
Yesu Raj
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management system
Yesu Raj
Brent Wilkins Resume
Brent Wilkins ResumeBrent Wilkins Resume
Brent Wilkins Resume
Brent Wilkins
Web-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptxWeb-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptx
AlokKumar250045

Recently uploaded (20)

Build With AI X GDG Harare Beginners .pdf
Build With AI X GDG Harare Beginners .pdfBuild With AI X GDG Harare Beginners .pdf
Build With AI X GDG Harare Beginners .pdf
Google Developer Group - Harare
BrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdf
BrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdfBrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdf
BrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdf
Nick Samuel
FutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAIFutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAI
Pete Nieminen
Introduction to Mobile App Development.
Introduction to  Mobile App Development.Introduction to  Mobile App Development.
Introduction to Mobile App Development.
AkashDwivedi43
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
MariaDB Berlin Roadshow 際際滷s - 8 April 2025
MariaDB Berlin Roadshow 際際滷s - 8 April 2025MariaDB Berlin Roadshow 際際滷s - 8 April 2025
MariaDB Berlin Roadshow 際際滷s - 8 April 2025
MariaDB plc
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
Pavel Shukhman
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEA
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEAQ1 FY26 TUG Leader Quarterly Call - APAC / EMEA
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEA
lward7
SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8
SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8
SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8
DianaGray10
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD TechnicianRicardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno
Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...
Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...
Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...
Buwaneka De Silva
Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...
Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...
Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...
3G4G
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
AI Driven Posture Analysis Fall Detection System for the Elderly.pdf
AI Driven Posture Analysis Fall Detection System for the Elderly.pdfAI Driven Posture Analysis Fall Detection System for the Elderly.pdf
AI Driven Posture Analysis Fall Detection System for the Elderly.pdf
Patrick Ogbuitepu
APAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdfAPAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdf
GDG on Campus Monash
SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...
SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...
SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...
DianaGray10
TNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptxTNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptx
MohamedHasan816582
Codequiry: A Code Similarity Checker Every Developer Should Know
Codequiry: A Code Similarity Checker Every Developer Should KnowCodequiry: A Code Similarity Checker Every Developer Should Know
Codequiry: A Code Similarity Checker Every Developer Should Know
Code Quiry
Introduction to PHP from Beginning to End
Introduction to PHP from Beginning to EndIntroduction to PHP from Beginning to End
Introduction to PHP from Beginning to End
christopherneo4
SaaS Product Development Best Practices
SaaS Product Development Best PracticesSaaS Product Development Best Practices
SaaS Product Development Best Practices
ApptDev
BrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdf
BrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdfBrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdf
BrightonSEO April 2025 - hreflang XML E-Commerce - Nick Samuel.pdf
Nick Samuel
FutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAIFutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAI
Pete Nieminen
Introduction to Mobile App Development.
Introduction to  Mobile App Development.Introduction to  Mobile App Development.
Introduction to Mobile App Development.
AkashDwivedi43
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
MariaDB Berlin Roadshow 際際滷s - 8 April 2025
MariaDB Berlin Roadshow 際際滷s - 8 April 2025MariaDB Berlin Roadshow 際際滷s - 8 April 2025
MariaDB Berlin Roadshow 際際滷s - 8 April 2025
MariaDB plc
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
Pavel Shukhman
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEA
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEAQ1 FY26 TUG Leader Quarterly Call - APAC / EMEA
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEA
lward7
SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8
SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8
SAP Automation with UiPath: Leveraging AI for SAP Automation - Part 8 of 8
DianaGray10
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD TechnicianRicardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno
Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...
Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...
Atlassian Community - Human-Centered AI in Product Management Unleashing Inno...
Buwaneka De Silva
Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...
Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...
Misc: The Internet Story - How Data Travels, Transit Works, and the Role of C...
3G4G
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
AI Driven Posture Analysis Fall Detection System for the Elderly.pdf
AI Driven Posture Analysis Fall Detection System for the Elderly.pdfAI Driven Posture Analysis Fall Detection System for the Elderly.pdf
AI Driven Posture Analysis Fall Detection System for the Elderly.pdf
Patrick Ogbuitepu
APAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdfAPAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdf
GDG on Campus Monash
SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...
SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...
SAP Automation with UiPath: Top 10 Use Cases Across FI/MM/SD/Basis/PP Modules...
DianaGray10
TNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptxTNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptx
MohamedHasan816582
Codequiry: A Code Similarity Checker Every Developer Should Know
Codequiry: A Code Similarity Checker Every Developer Should KnowCodequiry: A Code Similarity Checker Every Developer Should Know
Codequiry: A Code Similarity Checker Every Developer Should Know
Code Quiry
Introduction to PHP from Beginning to End
Introduction to PHP from Beginning to EndIntroduction to PHP from Beginning to End
Introduction to PHP from Beginning to End
christopherneo4
SaaS Product Development Best Practices
SaaS Product Development Best PracticesSaaS Product Development Best Practices
SaaS Product Development Best Practices
ApptDev

java web services - soap and rest services

  • 1. Java Web Services Sharmila Chalasani MS Computer Science State university of New York at Binghamton Termination Project Summer 2004
  • 2. Outline Introduction to web services Existing solutions Web service Architecture Standards used Web services technology JAX-RPC Architecture Hosting using Java web services Steps involved in creating weather web service Consuming my weather forecast web service (client details) Some facts about web services References
  • 3. Why are we here? "Web Services" contain the word "Web" and Web technologies matter. More and more people get connected using computers, televisions, mobiles, "Web Services" contain the word "services" and we wonder why kind of services they will fulfill for us. We already have services on the Web, so what's missing?
  • 4. The Problem (eg. how to buy tomatoes) Find the tomato sellers; Yellow Pages: contain companies that are selling tomatoes, their location, and contact information. Find the service offered according to my needs; Where, when and how can I buy tomatoes? Buy the tomatoes; do the transaction
  • 6. Web Service Requirement Applications need to communicate: Unless tomato buyers can communicate to tomato sellers, there will be no business. The system must scale: -As many tomato buyers and sellers as possible. -Being able to use any future new kind of tomatoes or any kind of products (potatoes, video games, ) -Add new layers: security! The solution must be portable across environments: -Not all tomato buyers and sellers will use the same system or the same language. Used by anyone, anywhere, and with any kind of devices.
  • 7. Existing solutions How can two (or more) applications communicate today? Ad Hoc solutions: Unless you want to buy your own tomatoes, it won't be useful. Language-oriented solutions (Java RMI, ) Works well if the tomato seller uses your language Service-oriented solutions (CORBA, DCE, DCOM) And about the Web?
  • 8. Web service: definition A Web service is a software system identified by a URI, whose public interfaces and bindings are defined and described using XML. Its definition can be discovered by other software systems. These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by Internet protocols. Loosely coupled, reusable software components that semantically encapsulate discrete functionality and are distributed and programmatically accessible over standard Internet protocols.
  • 9. Advantages of Web service Not based on a programming language: Java, .Net, C, C++, Python, Perl, Not based on a programming data model: objects vs non-objects environments. Convergence of SOA (Service-Oriented Architecture) and Web. Based on web technologies Do not need huge framework of memory Basic usage is b-to-b ,remote controlled devices,internal external appl communications
  • 10. Web services application Can use Web Services to integrate across departments, agencies, to companies, etc.
  • 11. Web service Architecture An architecture view based on SOAP, WSDL, and UDDI.
  • 12. Web service Transport Data format XML (subset of XML 1.0), URL encoding. Data format schema definition: XML Schema Wire format XML Protocol (XML-RPC, SOAP), URI Transfer protocol: HTTP, SMTP, JMS, BEEP,
  • 13. WS built on existing standards Extensible Markup Language (XML) The HTTP (Hypertext Transfer Protocol) standard is allowing more systems to communicate with one another. SOAP (Simple Object Access Protocol) (built on XML) standardizes the messaging capability on different systems. UDDI (Universal Description, Discovery, and Integration ) standardizes the publishing and finding of Web services. WSDL (Web Services Description Language ) standardizes the description of Web services so providers and requesters are speaking the same language.
  • 14. Web Services technology 3 major Web services toolkits being used widely .NET Web services: Developed by Microsoft and is an integral part of the complete .NET framework. Integrated and easy to use with Visual Studio .NET. services are hosted on IIS web servers. Java Web services: Suns Web service implementation for the Java community. Comes bundled in a complete Java Web services Development Pack (JWSDP Ver 1.3) including Tomcat web server. Apache Axis: Initially developed by IBM and donated to the Apache group. One of the earliest and stable Web service implementation. Runs on Apache Web servers.
  • 15. Package used in my project JWSDP 1.3 (java web services developer pack) JWSDP includes : -Java XML pack -Tomcat Java Servlet -JavaServer pages containers -Registry server -Ant build tool. JWSDP 1.4 is released now
  • 16. Java API used in my project JAX-RPC (Java API for XML based RPC) Features and Developer Benefits : - Portable and interoperable web services - Ease of development of web services endpoints & clients - Increased developer productivity - Support for open standards: XML, SOAP, WSDL - Standard API developed under Java Community Process - Support for tools - RPC programming model with support for attachments - Support for SOAP message processing model & extensions - Secure web services - Extensible type mapping
  • 18. Hosting using Java Web Services Required tools and files to create java web service : Ant Tool : This a tool extensively used in J2EE architecture for handling multiple configuration files while compiling several files. You can consider it similar to make utility in unix platforms. Build.xml : This is the file used by the Ant tool to get the compilation and path directives. It contains options to selectively compile-server, compile-client, generate-client, run-client etc Build.properties : Some misc properties and path settings that are referred to by build.xml. config.xml : Defines the URL for WSDL file location. Each Web services has a corresponding WSDL (Web service Definition Language) document.
  • 19. Hosting Java web services cont. jaxrpc-ri.xml: Defines the various end points for referencing a Web service. Misc. utilities: wscompile: The wscompile tool generates stubs, ties, serializers, and WSDL files used in JAX-RPC clients and services. The tool reads as input a configuration file and either a WSDL file or an RMI interface that defines the service. wsdeploy: Reads a WAR file (something like Jar file) and the jaxrpc-ri.xml file and then generates another WAR file that is ready for deployment
  • 20. Steps : creating my project MyWeatherService Deploy the service using ant deploy and verifying the service using service endpoint's URL: http://localhost:8080/weather-jaxrpc/weather
  • 21. Deployed MyWeatherService This page also has a URL to the service's WSDL file. model.gz file contains the internal data structures that describe the service.
  • 22. WSDL file of my web service
  • 23. MyWeatherService functions Functions available from service endpoint interface : - boolean isvalidZipCode(String zip) - String getWeatherReport(String zip) - HashMap getZipcodeListMap() - getHighTemp , getLowTemp, getHumidity, getWind, getVisibility etc. Communicating modes accessing web service Stubs, dynamic proxy,DII(dynamic invocation interface)
  • 24. Consuming MyWeatherService Clients created to consume my weather service : genereate stubs, compile client, package client, run the client Static stub client stubs are created before runtime (by wscompile), it is usually called a static stub. .It makes this call through a stub, a local object which acts as a proxy for the remote service. Dynamic Proxy client This client creates a Service object which is factory of proxies(stubs are created at runtime dynamically) Web Client This client used .jsp pages to display web form for the user to enter zipcode to get weather forecast by calling getWeatherReport function on the stubs created before.
  • 26. Consuming Web service cont. WebClient
  • 27. Web services: challenges A whole suite of technologies to design: communication protocol description of services enable security and privacy describe complex interactions ... Must design to be interoperable and Web- friendly
  • 28. Some facts Web service is a new paradigm, it is in initial stages. Web service tech is evolving rapidly, sometimes in unexpected directions .such changes may cause difficulties early on. Various standards and specifications are still being defined and refined. Security standards are also being defined. The key security issues for WS concern authentication , authorization, and ensuring security at the transport and message level.They remain a work in progress by the community.
  • 29. References Java web services tutorial from sun http://java.sun.com/webservices/docs/1.1/tutorial/doc/ Java Web services In a Nutshell OReilly Kim Topley XML In a Nutshell O'Reilly Java Web Services for Experienced Programmers Deitel developer series Java Web Services David Chappell OReilly New updates about the package jwsdp & projects are discussed here https://jwsdp.dev.java.net/

Editor's Notes

  • #7: DCE->Distributed Computing Environment, is a technology that is a bit older than CORBA, but a good bit more stable and scalable. Not only does it offer the basic RPC mechanisms and IDL stub compilers needed to create distributed applications, but it also offers security & authentication through Kerberos. From the point of view of implementing Microsoft-style software components on a non-Windows operating system, where binary compatibility is impractical, DCOM is more interesting than in-proc COM. DCOM is the over-the-wire protocol for ``out-of-proc'', remote Microsoft component object messages. This is micro soft competition to Corba.
  • #21: model.gz file contains the internal data structures that describe the service.