SlideShare a Scribd company logo
Web Services
 Farag Zakaria
  ITI-JAVA 30
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
Web services concept
• Web service is a software system identified by a
  URI whose public interfaces and bindings are
  defined ,described and discovered by XML
  artifacts.(W3C)
• Client server application
• Application to application communication
• Interoperability (standard communication)
• Neutral (platform & language independent).
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
Why web services
• Interoperability (SOAP messaging).
• Economical (recycled components, no
  installation and tight integration of software).
• Accessible (applications are exposed and
  accessed on the web.)
• Available (services are on any device, any
  where, anytime.)
• Scalable (no limit on scope of application and
  their number.)
Example
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services?
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
When to use web services ?
• Applications do not have severe restrictions on
  reliability and speed.
• Cooperation among different application.
• Upgrading services independently from clients
  without changing the WSDL.
• Services can be easily expressed with simple
  request/response semantics and simple state
•
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services?
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
Web services architecture
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services?
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
SOAP messaging
SOAP(Simple Object Access Protocol)
• Define communication format between client
  and web service(XML message format).
• Wire protocol extension for conveying RPC calls.
• SOAP is not a transport protocol. You must
  attach your message to a transport mechanism
  like HTTP.
SOAP structure
• A SOAP message is contained in an envelop.
• The envelop element in turn contain (in order)
  1. An optional header with one or more child
     entries. (security , transaction)
  2. A body element that can contain one or more
     child entries. These child entries may contain
      arbitrary XML data.(application data)
• Header entries may optionally have a
  “mustUnderstand” attribute.
   mustUnderstand=1 recipient must process header
   mustUnderstand=0 optional header
•
SOAP structure(cont.)
• The body contains the XML message that you
  are transmitting.
• The message format is not specified by SOAP.
 The <Body></Body> tag pairs are just a way to notify
 the recipient that the actual XML message is contained
 therein.
 The recipient decides what to do with the message.
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services?
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
WSDL(Web Service Description
Language)
• Defines what your service does and how it is
  invoked.
• Guideline for constructing SOAP message.
• XML language for writing APIs(generating
  client code to use the web service).
• Verbose
WSDL documents parts
• Data definition (in XML) for custom types.
• Abstract message definitions (request, response)
• Organization of messages into “ports” and
  “operations” (classes and methods).
• Protocol bindings (to SOAP, for example)
• Service point locations (URLs)
WSDL document parts(cont.)
WSDL document parts(cont.)
WSDL document parts(Data Definition)
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services?
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
JAX-WS
• Simpler way to develop/deploy web services
  - POJO + Annotation.
  - No deployment descriptor is needed.
  - Layered programming model
• Layered programming model
  - Server side
  - Client side
  - Business layer
Programming model(server side)
•   Write a POJO implementing the service
•   Add @WebService annotation to it
•   Deploy the application
•   Point your clients at the WSDL
    http://mysite/myapp/service.wsdl
Example(Server side)
@WebService(name="AddNumbers",
       portName="CalculatorPort",
       serviceName="CalculatorService")
public class NumbersWebService
{
  @WebMethod(operationName="add")
  @WebResult(name="result")
  public int add(@WebParam(name="first") int first,
                    @WebParam(name="second") int second)
  {
    return first + second;
  }
}
Programming model(client side)
• You need to know the url of WSDL
• Generate service classes and interfaces.
• Create object from service class
• Get a proxy using a get<ServiceName>Port
  method.
• Invoke any remote operations.
Example(Client side)
• CalculatorService service = new
                 CalculatorServiceLocator();

 AddNumbers calc = service.getCalculatorPort();

 System.out.println(calc.add(3, 4));
Agenda
•   Web services concept.
•   Why web services?
•   When to use web services?
•   Web services architecture
•   SOAP
•   WSDL
•   JAX-WS
•   JAX-WS vs. JAX-RPC
•   RESTful web services
JAX-WS vs. JAX-RPC
             JAX-WS                         JAX-RPC
Map to JAVA 1.5 and higher      Map to JAVA 1.4
Support SOAP 1.1 and SOAP 1.2   Support SOAP 1.1
Data mapping model (JAXB)       Has its own data mapping model
Support MTOM through (JAXB)
Asynchronous communication
JAX-WS Demo
RESTful web services
Agenda
•   REST Architecture principales
•   RESTful web services & WADL.
•   REST vs. Traditional web services
•   RESTful advantages
REST Architecture principales
• Representational State Transfer.
• Every thing is a resource.
• Resources are addressable.
• Resources have an interface(operations and data
  types).
• Protocol is client-server, stateless, cacheable,
  layered.
Agenda
•   REST Architecture principales
•   RESTful web services & WADL.
•   REST vs. Traditional web services
•   RESTful advantages
RESTful web services & WADL.
• REST applied to web services.
  - web service accessible through URI.
  - operations are HTTP primitives(PUT,GET,..).
  - Web services returns a MIME type(XML,
    JSON, …).
• More resource efficient than SOAP
• RESTful web services
  - java class + annotations (for URI, operations,
    Data types).
RESTful web services & WADL.(cont.)
• Annotations
  - @Path(“”) for URI of service.
  - @GET,@POST,.. for Http methods.
  - @Produces(“…”) to define format of
     returned data
  - @Consumes (“…”) to define format of
     accepted input data
RESTful web services & WADL.(cont.)
<servlet>
    <servlet-name>ServletAdaptor</servlet-name>
    <servlet-class>
     com.sun.jersey.spi.container.servlet.ServletContainer
    </servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>ServletAdaptor</servlet-name>
    <url-pattern>/resources/*</url-pattern>
</servlet-mapping>
RESTful web services & WADL.(cont.)
@Path("/hello")

@Consumes("text/html")

public class RESTWSTest
{
  @GET
  @Produces("text/html")
  public String sayHello(@QueryParam("name") String name)
  {
    return "<html><body><h1>Hello " + name +
  "</h1></body></html>";
  }

}
RESTful web services & WADL.(cont.)
• WADL web application description language.
  - easy to understand.
  - HTTP assumed.
• XML-based language.
• Development language + platform neutral.
• Aligned with REST terminology.
• WADL elements
  - resources
  - methods
  - representations
WADL
<application>
<doc jersey:generatedBy="Jersey: 1.1.4 11/10/2009 05:36 PM"/>
<resources base="http://localhost:8080/WebServicesREST/resources/">
<resource path="/hello">
 <method id="sayHello" name="GET">
   <request>
      <param name="name" style="query" type="xs:string"/>
   </request>
   <response>
      <representation mediaType="text/html"/>
   </response>
 </method>
</resource>
</resources>
</application>
Agenda
•   REST Architecture principales.
•   RESTful web services & WADL.
•   REST vs. Traditional web services
•   RESTful advantages
REST vs. Traditional web services
• Traditional web services
  - a lot of custom methods(ports according to
    business).
  - use http to transport soap
• RESTful
  - fixed methods(Http methods).
  - Http is the protocol.
Agenda
•   REST Architecture principales
•   RESTful web services & WADL.
•   REST vs. Traditional web services
•   RESTful advantages
RESTful advantages
•   More secure over http (use web port 80)
•   Ease of testing (only browser needed).
•   Thin client.
•   Save memory.(no need to build xml tree in memory).
RESTful Demo
Any Questions??!
If time allowed
• SOAP Handler Demo
References
• JavaPassion web site
• Sun Java JEE6 tutorial
• Sun Java Web Services tutorial
Ad

More Related Content

What's hot (20)

Web services for banks
Web services for banksWeb services for banks
Web services for banks
Sreekanth Narendran
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
Dong Ngoc
 
SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
Katrien Verbert
 
Web services SOAP
Web services SOAPWeb services SOAP
Web services SOAP
princeirfancivil
 
Web services soap
Web services soapWeb services soap
Web services soap
Khan625
 
Java web services
Java web servicesJava web services
Java web services
kumar gaurav
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
IMC Institute
 
Web services wsdl
Web services wsdlWeb services wsdl
Web services wsdl
Khan625
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
weili_at_slideshare
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web Services
IMC Institute
 
Soa 12 jax ws-xml Java API for web services
Soa 12 jax ws-xml Java API for web servicesSoa 12 jax ws-xml Java API for web services
Soa 12 jax ws-xml Java API for web services
Vaibhav Khanna
 
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
Rodrigo Cândido da Silva
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAP
IMC Institute
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transfer
Tricode (part of Dept)
 
Java
JavaJava
Java
BALUJAINSTITUTE
 
WSDL
WSDLWSDL
WSDL
Akshay Ballarpure
 
Mule web services
Mule web servicesMule web services
Mule web services
Thang Loi
 
The power of datomic
The power of datomicThe power of datomic
The power of datomic
Konrad Szydlo
 
Soa 8 soa technologies for web services
Soa 8 soa technologies for web servicesSoa 8 soa technologies for web services
Soa 8 soa technologies for web services
Vaibhav Khanna
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
jrodbx
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
Dong Ngoc
 
Web services soap
Web services soapWeb services soap
Web services soap
Khan625
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
IMC Institute
 
Web services wsdl
Web services wsdlWeb services wsdl
Web services wsdl
Khan625
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
weili_at_slideshare
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web Services
IMC Institute
 
Soa 12 jax ws-xml Java API for web services
Soa 12 jax ws-xml Java API for web servicesSoa 12 jax ws-xml Java API for web services
Soa 12 jax ws-xml Java API for web services
Vaibhav Khanna
 
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
Rodrigo Cândido da Silva
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAP
IMC Institute
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transfer
Tricode (part of Dept)
 
Mule web services
Mule web servicesMule web services
Mule web services
Thang Loi
 
The power of datomic
The power of datomicThe power of datomic
The power of datomic
Konrad Szydlo
 
Soa 8 soa technologies for web services
Soa 8 soa technologies for web servicesSoa 8 soa technologies for web services
Soa 8 soa technologies for web services
Vaibhav Khanna
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
jrodbx
 

Viewers also liked (7)

Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
Raveendra Bhat
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
Angelin R
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
Madhaiyan Muthu
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
Lorna Mitchell
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
Peter R. Egli
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
guest0df6b0
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
Raveendra Bhat
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
Angelin R
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
Madhaiyan Muthu
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
Peter R. Egli
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
guest0df6b0
 
Ad

Similar to Ntg web services (20)

WEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptxWEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptx
karthiksmart21
 
Lecture 7 Web Services JAX-WS & JAX-RS
Lecture 7   Web Services JAX-WS & JAX-RSLecture 7   Web Services JAX-WS & JAX-RS
Lecture 7 Web Services JAX-WS & JAX-RS
Fahad Golra
 
Xml.ppt
Xml.pptXml.ppt
Xml.ppt
praveen gautam
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
Andrey Oleynik
 
Windows communication foundation (part1) jaliya udagedara
Windows communication foundation (part1)    jaliya udagedaraWindows communication foundation (part1)    jaliya udagedara
Windows communication foundation (part1) jaliya udagedara
Jaliya Udagedara
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
Dr.Saranya K.G
 
java-webservices introduction ppt for beginners
java-webservices introduction ppt for beginnersjava-webservices introduction ppt for beginners
java-webservices introduction ppt for beginners
VasantPrasad
 
Nick Raienko ''Service-oriented GraphQL''
Nick Raienko ''Service-oriented GraphQL''Nick Raienko ''Service-oriented GraphQL''
Nick Raienko ''Service-oriented GraphQL''
OdessaJS Conf
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
Ram Awadh Prasad, PMP
 
Intro To Web and Web Services (REST Series 01)
Intro To Web and Web Services (REST Series 01)Intro To Web and Web Services (REST Series 01)
Intro To Web and Web Services (REST Series 01)
Heartin Jacob
 
Introduction to REST
Introduction to RESTIntroduction to REST
Introduction to REST
kumar gaurav
 
Wt unit 6 ppts web services
Wt unit 6 ppts web servicesWt unit 6 ppts web services
Wt unit 6 ppts web services
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
Betclic Everest Group Tech Team
 
Introduction to Web Services and the cocnept
Introduction to Web Services and the cocneptIntroduction to Web Services and the cocnept
Introduction to Web Services and the cocnept
PaceInfotech
 
Web services soap rest training
Web services soap rest trainingWeb services soap rest training
Web services soap rest training
FuturePoint Technologies
 
Web Services
Web ServicesWeb Services
Web Services
Katrien Verbert
 
Web Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri MishraWeb Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri Mishra
Sheshadri Mishra
 
Rest introduction
Rest introductionRest introduction
Rest introduction
Manav Prasad
 
Web services
Web services Web services
Web services
UMA MAHESWARI
 
Web service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopWeb service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National Wokshop
Nishikant Taksande
 
WEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptxWEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptx
karthiksmart21
 
Lecture 7 Web Services JAX-WS & JAX-RS
Lecture 7   Web Services JAX-WS & JAX-RSLecture 7   Web Services JAX-WS & JAX-RS
Lecture 7 Web Services JAX-WS & JAX-RS
Fahad Golra
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
Andrey Oleynik
 
Windows communication foundation (part1) jaliya udagedara
Windows communication foundation (part1)    jaliya udagedaraWindows communication foundation (part1)    jaliya udagedara
Windows communication foundation (part1) jaliya udagedara
Jaliya Udagedara
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
Dr.Saranya K.G
 
java-webservices introduction ppt for beginners
java-webservices introduction ppt for beginnersjava-webservices introduction ppt for beginners
java-webservices introduction ppt for beginners
VasantPrasad
 
Nick Raienko ''Service-oriented GraphQL''
Nick Raienko ''Service-oriented GraphQL''Nick Raienko ''Service-oriented GraphQL''
Nick Raienko ''Service-oriented GraphQL''
OdessaJS Conf
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
Ram Awadh Prasad, PMP
 
Intro To Web and Web Services (REST Series 01)
Intro To Web and Web Services (REST Series 01)Intro To Web and Web Services (REST Series 01)
Intro To Web and Web Services (REST Series 01)
Heartin Jacob
 
Introduction to REST
Introduction to RESTIntroduction to REST
Introduction to REST
kumar gaurav
 
Introduction to Web Services and the cocnept
Introduction to Web Services and the cocneptIntroduction to Web Services and the cocnept
Introduction to Web Services and the cocnept
PaceInfotech
 
Web Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri MishraWeb Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri Mishra
Sheshadri Mishra
 
Web service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopWeb service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National Wokshop
Nishikant Taksande
 
Ad

Recently uploaded (20)

Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 

Ntg web services

  • 1. Web Services Farag Zakaria ITI-JAVA 30
  • 2. Agenda • Web services concept. • Why web services? • When to use web services • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 3. Web services concept • Web service is a software system identified by a URI whose public interfaces and bindings are defined ,described and discovered by XML artifacts.(W3C) • Client server application • Application to application communication • Interoperability (standard communication) • Neutral (platform & language independent).
  • 4. Agenda • Web services concept. • Why web services? • When to use web services • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 5. Why web services • Interoperability (SOAP messaging). • Economical (recycled components, no installation and tight integration of software). • Accessible (applications are exposed and accessed on the web.) • Available (services are on any device, any where, anytime.) • Scalable (no limit on scope of application and their number.)
  • 7. Agenda • Web services concept. • Why web services? • When to use web services? • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 8. When to use web services ? • Applications do not have severe restrictions on reliability and speed. • Cooperation among different application. • Upgrading services independently from clients without changing the WSDL. • Services can be easily expressed with simple request/response semantics and simple state •
  • 9. Agenda • Web services concept. • Why web services? • When to use web services? • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 11. Agenda • Web services concept. • Why web services? • When to use web services? • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 13. SOAP(Simple Object Access Protocol) • Define communication format between client and web service(XML message format). • Wire protocol extension for conveying RPC calls. • SOAP is not a transport protocol. You must attach your message to a transport mechanism like HTTP.
  • 14. SOAP structure • A SOAP message is contained in an envelop. • The envelop element in turn contain (in order) 1. An optional header with one or more child entries. (security , transaction) 2. A body element that can contain one or more child entries. These child entries may contain arbitrary XML data.(application data) • Header entries may optionally have a “mustUnderstand” attribute. mustUnderstand=1 recipient must process header mustUnderstand=0 optional header •
  • 15. SOAP structure(cont.) • The body contains the XML message that you are transmitting. • The message format is not specified by SOAP. The <Body></Body> tag pairs are just a way to notify the recipient that the actual XML message is contained therein. The recipient decides what to do with the message.
  • 16. Agenda • Web services concept. • Why web services? • When to use web services? • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 17. WSDL(Web Service Description Language) • Defines what your service does and how it is invoked. • Guideline for constructing SOAP message. • XML language for writing APIs(generating client code to use the web service). • Verbose
  • 18. WSDL documents parts • Data definition (in XML) for custom types. • Abstract message definitions (request, response) • Organization of messages into “ports” and “operations” (classes and methods). • Protocol bindings (to SOAP, for example) • Service point locations (URLs)
  • 22. Agenda • Web services concept. • Why web services? • When to use web services? • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 23. JAX-WS • Simpler way to develop/deploy web services - POJO + Annotation. - No deployment descriptor is needed. - Layered programming model • Layered programming model - Server side - Client side - Business layer
  • 24. Programming model(server side) • Write a POJO implementing the service • Add @WebService annotation to it • Deploy the application • Point your clients at the WSDL http://mysite/myapp/service.wsdl
  • 25. Example(Server side) @WebService(name="AddNumbers", portName="CalculatorPort", serviceName="CalculatorService") public class NumbersWebService { @WebMethod(operationName="add") @WebResult(name="result") public int add(@WebParam(name="first") int first, @WebParam(name="second") int second) { return first + second; } }
  • 26. Programming model(client side) • You need to know the url of WSDL • Generate service classes and interfaces. • Create object from service class • Get a proxy using a get<ServiceName>Port method. • Invoke any remote operations.
  • 27. Example(Client side) • CalculatorService service = new CalculatorServiceLocator(); AddNumbers calc = service.getCalculatorPort(); System.out.println(calc.add(3, 4));
  • 28. Agenda • Web services concept. • Why web services? • When to use web services? • Web services architecture • SOAP • WSDL • JAX-WS • JAX-WS vs. JAX-RPC • RESTful web services
  • 29. JAX-WS vs. JAX-RPC JAX-WS JAX-RPC Map to JAVA 1.5 and higher Map to JAVA 1.4 Support SOAP 1.1 and SOAP 1.2 Support SOAP 1.1 Data mapping model (JAXB) Has its own data mapping model Support MTOM through (JAXB) Asynchronous communication
  • 32. Agenda • REST Architecture principales • RESTful web services & WADL. • REST vs. Traditional web services • RESTful advantages
  • 33. REST Architecture principales • Representational State Transfer. • Every thing is a resource. • Resources are addressable. • Resources have an interface(operations and data types). • Protocol is client-server, stateless, cacheable, layered.
  • 34. Agenda • REST Architecture principales • RESTful web services & WADL. • REST vs. Traditional web services • RESTful advantages
  • 35. RESTful web services & WADL. • REST applied to web services. - web service accessible through URI. - operations are HTTP primitives(PUT,GET,..). - Web services returns a MIME type(XML, JSON, …). • More resource efficient than SOAP • RESTful web services - java class + annotations (for URI, operations, Data types).
  • 36. RESTful web services & WADL.(cont.) • Annotations - @Path(“”) for URI of service. - @GET,@POST,.. for Http methods. - @Produces(“…”) to define format of returned data - @Consumes (“…”) to define format of accepted input data
  • 37. RESTful web services & WADL.(cont.) <servlet> <servlet-name>ServletAdaptor</servlet-name> <servlet-class> com.sun.jersey.spi.container.servlet.ServletContainer </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ServletAdaptor</servlet-name> <url-pattern>/resources/*</url-pattern> </servlet-mapping>
  • 38. RESTful web services & WADL.(cont.) @Path("/hello") @Consumes("text/html") public class RESTWSTest { @GET @Produces("text/html") public String sayHello(@QueryParam("name") String name) { return "<html><body><h1>Hello " + name + "</h1></body></html>"; } }
  • 39. RESTful web services & WADL.(cont.) • WADL web application description language. - easy to understand. - HTTP assumed. • XML-based language. • Development language + platform neutral. • Aligned with REST terminology. • WADL elements - resources - methods - representations
  • 40. WADL <application> <doc jersey:generatedBy="Jersey: 1.1.4 11/10/2009 05:36 PM"/> <resources base="http://localhost:8080/WebServicesREST/resources/"> <resource path="/hello"> <method id="sayHello" name="GET"> <request> <param name="name" style="query" type="xs:string"/> </request> <response> <representation mediaType="text/html"/> </response> </method> </resource> </resources> </application>
  • 41. Agenda • REST Architecture principales. • RESTful web services & WADL. • REST vs. Traditional web services • RESTful advantages
  • 42. REST vs. Traditional web services • Traditional web services - a lot of custom methods(ports according to business). - use http to transport soap • RESTful - fixed methods(Http methods). - Http is the protocol.
  • 43. Agenda • REST Architecture principales • RESTful web services & WADL. • REST vs. Traditional web services • RESTful advantages
  • 44. RESTful advantages • More secure over http (use web port 80) • Ease of testing (only browser needed). • Thin client. • Save memory.(no need to build xml tree in memory).
  • 47. If time allowed • SOAP Handler Demo
  • 48. References • JavaPassion web site • Sun Java JEE6 tutorial • Sun Java Web Services tutorial