- SOAP and RESTful web services are two common approaches for building web services. SOAP uses XML and web-related standards like HTTP, SMTP, and SOAP. RESTful services are based on REST architectural principles and use HTTP and common data formats like JSON and XML.
- The document outlines the specifications, implementations, and differences between SOAP and RESTful web services. It discusses topics like SOAP vs REST characteristics, WSDL and SOAP message structure, JAX-WS and JAX-RS annotations for building web services, and considerations for when to use each approach.
1. Introduction to Web Services
2. Web Service Architecture
3. What are Web Services?
4. Why are Web Services?
5. The base of WS
6. What is SOAP?
7. What is WSDL?
8. How to test a web service?
9. Examples
The slides provide a major overview on SOAP protocol, and demonstrates a working example that uses SOAP for RPC. It uses WCF/visual studio and Apache Axis for the implementation.
SOAP Web Services have a well established role in the enterprise, but aside from the many benefits of the WS-* standards, SOAP and XML also carry additional baggage for developers. Consequently, REST Web Services are gaining tremendous popularity within the developer community. This session will begin by comparing and contrasting the basic concepts of both SOAP and REST Web Services. Building on that foundation, Sam Brannen will show attendees how to implement SOAP-based applications using Spring-WS 2.0. He will then demonstrate how to build a similar REST-ful application using Spring MVC 3.0. The session will conclude with an in-depth look at both server-side and client-side development as well as efficient integration testing of Web Services using the Spring Framework.
Simple REST-API overview for developers. An newer version is here: https://www.slideshare.net/patricksavalle/super-simple-introduction-to-restapis-2nd-version-127968966
An introduction to REST and RESTful web services.
You can take the course below to learn about REST & RESTful web services.
https://www.udemy.com/building-php-restful-web-services/
1. Introduction to Web Services
2. Web Service Architecture
3. What are Web Services?
4. Why are Web Services?
5. The base of WS
6. What is SOAP?
7. What is WSDL?
8. How to test a web service?
9. Examples
The slides provide a major overview on SOAP protocol, and demonstrates a working example that uses SOAP for RPC. It uses WCF/visual studio and Apache Axis for the implementation.
SOAP Web Services have a well established role in the enterprise, but aside from the many benefits of the WS-* standards, SOAP and XML also carry additional baggage for developers. Consequently, REST Web Services are gaining tremendous popularity within the developer community. This session will begin by comparing and contrasting the basic concepts of both SOAP and REST Web Services. Building on that foundation, Sam Brannen will show attendees how to implement SOAP-based applications using Spring-WS 2.0. He will then demonstrate how to build a similar REST-ful application using Spring MVC 3.0. The session will conclude with an in-depth look at both server-side and client-side development as well as efficient integration testing of Web Services using the Spring Framework.
Simple REST-API overview for developers. An newer version is here: https://www.slideshare.net/patricksavalle/super-simple-introduction-to-restapis-2nd-version-127968966
An introduction to REST and RESTful web services.
You can take the course below to learn about REST & RESTful web services.
https://www.udemy.com/building-php-restful-web-services/
MDN @ 10 Years: Mistakes, Successes, and LessonsJanet Swisher
Mozilla Developer Network (MDN) just celebrated ten years as an open documentation wiki and an open documentation community. This session looks at MDN as a sociotechnical system, that is, how its technological and social facets affect one another. I talk about things we've done wrong and what we learned from them, as well as things we've done right and how we know.
Webinar on Angular JS titled 'Develop Responsive Single Page Application'Edureka!
AngularJS, a MVW framework from Google is based on JavaScript, a language globally known to millions of developers worldwide - thus giving it a much lower learning curve even for complete beginners. Integrating AngularJS is simple as it evaluates page once HTML is in the DOM and make easier to bind Angular on top of existing applications. It can run along with Node.js, an asynchronous development platform with lightning speed execution, which makes building Mean Stack applications easier and faster. AngularJS comes with a very good documentation and also have wide range of third party modules making it user-friendly for developers.
The topics covered in the presentation are:
1.What is Angular JS
2.Global Opportunities for Angular JS
3.Why learn Angular JS
4.Angular JS Features
5.MVC Architecture
6.How to build a responsive single page application
7.Compare Angular.js, Backbone.js and Ember.js
Building RESTful applications using Spring MVCIndicThreads
REST is an alternate and simpler approach for implementing WebServices. It is based on the HTTP protocol and hence leverages a lot of existing infrastructures. It uses an uniform interface thus making it easy to build client applications. In this session we will look at the fundamental concepts behind REST (Resource, URI, Stateless Conversation ..) and how to apply it in the context of a real applcation. We will also discuss the pros & cons of RESTful vs Soap based webservices. We will discuss the design of RESTful application and then look at how to implement it using Spring MVC.
Spring Framework 4.0 is the latest generation of the popular open source framework for Enterprise Java developers, focusing on the future with support for Java SE 8 and Java EE 7. In this presentation core Spring committer Sam Brannen will provide attendees an overview of the new enterprise features in the framework as well as new programming models made possible with the adoption of JDK 8 language features and APIs.
Specifically, this talk will cover support for lambda expressions and method references against Spring callback interfaces, JSR-310 Date-Time value types for Spring data binding and formatting, Spring's new @Conditional mechanism for activation of bean definitions, and a new WebSocket endpoint model. The presentation also provides an overview of Spring 4.0's updated support for enterprise APIs such as JMS 2.0, JPA 2.1, Bean Validation 1.1, Servlet 3.1, and JCache. Last but not least, Sam will highlight some of the major themes for the upcoming Spring Framework 4.1 release such as support for JCache 1.0 annotations, annotation-driven JMS listeners, and testing improvements.
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Sam Brannen
Spring Framework 4.0 is the next generation of the popular open source framework for Enterprise Java developers, focusing on the future with support for Java SE 8 and Java EE 7. In this presentation core Spring committer Sam Brannen will provide attendees an overview of the new enterprise features in the framework as well as new programming models made possible with the adoption of JDK 8 language features and APIs.
Specifically, this talk will cover support for lambda expressions and method references against Spring callback interfaces, JSR-310 Date-Time value types for Spring data binding and formatting, Spring's new @Conditional mechanism for activation of bean definitions, and a new WebSocket endpoint model. Regarding enterprise APIs, the presentation will cover Spring 4.0's new support for JMS 2.0, JPA 2.1, Bean Validation 1.1, Servlet 3.1, JCache, and JSR-236 concurrency. Last but not least, Sam will discuss improvements to Spring's testing support and point out which deprecated APIs have been pruned from the framework.
This article provides a brief introduction to the two styles of web-services interaction and details the benefits and challenges associated with each one.
A quick overview on REST : what it is and what it is not. REST has strict contraints and many internet Apis are not so REST. It’s also very popular today because RESTfull services can be consumed easily by any client or device. Soap is also still valid in a few circomstaces. It has never been so easy to create Rest-like services in .net since asp.net Web Api.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
2. • Overview of web service
• SOAP web service specification
• SOAP Web Service Implementation
• Restful web service specification
• Restful Web Service Implementation
• When to use
Agenda
3. • Definition: “A Web service is a software system designed to support
interoperable machine-to-machine interaction over a network”.
• Characteristic
– Machine-to-machine interactions
– Loosely-coupling
– Interoperability
– Platform-independence
– Language-independence
– Operating system-independence
– Leverage of the existing WWW
Web service definition
4. • Addressing the key points
– How to encode/decode data need to be transferred: base64, binary..
– The format of encoded application data(wire-protocol): STOMP, RMI, SOAP…
– The protocol used to transfer data : HTTP, TCP, SMTP…
– The way used to transfer data: publish/subscribe, point-to-point, request-response…
• Advantages of web service
– Interoperability
– Standard industry
• Disadvantages of web service
– Performance: XML serializable, SOAP encoding..
– Availability
– Transaction
– Authentication
Web service definition
5. • Roles in a SOAP web service
– Service Provider: The service provider implements the service and makes it
available on the Internet.
– Service Registry: Provides a central place where developers can publish
new services or find existing ones.
– Service Consumer: consume the web service
• Protocol used
– SOAP: provides a simple and lightweight mechanism for exchanging
structured and typed information between peers in a decentralized,
distributed environment using XML.
– WSDL: defines services as collections of network endpoints.
– UDDI: provides a platform-independent way of describing and
discovering Web services and Web service providers.
– Transferring protocol: HTTP, FTP, SMTP…
SOAP Web Service
6. • Additional specification WS-*
– WS-Security: encrypting XML message, digital signature before sending over network.
– WS-Reliability: insure message is delivered correctly.
– WS-Transaction: describe an extensible coordination framework and specific
coordination types for: Short duration, ACID transactions and longer running business
transactions.
– WS-Addressing: defines a standard for incorporating message addressing information
into web services messages and provides a uniform addressing method for SOAP messages
traveling over synchronous and asynchronous transports
– WS-Policies
– WS-Notification and Eventing: describes a publish/subscribe messaging model
implemented over Web services and leverages the WS-Addressing specification.
– WS-I Basic Profile: provides interoperability guidance for core Web Services
specifications such as SOAP, WSDL, and UDDI.
SOAP Web Service
9. Web Service Description Language(WSDL)
• Describe the interface of a web service: location, method, message transferring…
• Some major parts of a WSDL document:
– Message: Messages are the data element for all input/output for a WSDL and its operations
– portType: is a set of abstract operations
• One-way: input only, the endpoint receives a message
• Request-Response: the endpoint receives a message, process and return a response
• Solicit-Response: output followed by input: The endpoint sends a message, and receives a
correlated message. This type of operation may also output an optional fault message.
• Notification: output only, send message but not wait for response.
– Binding: how a portType operation will actually be transmitted over the wire, HTTP GET, HTTP
POST, or SOAP
– Port: which specifies an address(like URI) for a binding
– Service: is used to aggregate a set of related ports
12. • SOAP: XML-based mechanism for exchanging structured data
between network applications.
• SOAP consist of some major parts:
– Envelope: defines an overall framework for expressing general info.
– Header: is a generic container for control information.
– Body: represents the message payload.
– Fault: carry error and/or status information within a SOAP message.
• SOAP encode model:
– SOAP Encoding: uses a set of rules based on the XML Schema data types to encode, but
the message does not conform to a particular schema
– Literal XML: body contents conform to a specific XML Schema
• SOAP communication model:
– Document-style
– RPC-style
• The combination of encode and communication model affects considerably on
performance, interoperability….
SOAP Web Service: SOAP
14. SOAP Web Service Style
Soap binding
Encoded style
Document Style(Java default) RPC Style
Encoded Document-style message that does not
include a schema (nobody uses this in
practice).
RPC-style message that formats its body according to
the rules defined in the SOAP standard (which are not
always exact and can lead to incompatibilities).
Literal
(java Default)
Document-style message that formats its
body according to a schema. This schema is
included in the WSDL. There’s also a 5th
type. It isn’t an official standard but it is used
a lot in practice. It came into being to
compensate for document/literal’s main
shortcoming of not having a standard way of
specifying the web method name:
RPC-style message that formats its body according to a
schema that reflects the rules defined in the SOAP
standard. This schema is included in the WSDL.
Literal Wrapped
(Java Default)
The same as document/literal, but wraps the
contents of the body in an element with the
same name as the web service method (just
like RPC-style messages). This is what web
services implemented in Java use by default.
Literal Bare
Communication model
15. • JAX-WS:
– Java specification for next generation of XML Web Service model.
– Support SOAP 1.1, SOAP 1.2 over HTTP
– Support WSDL 1.1 HTTP Binding
– Support WS-I Basic Profile 1.1 and 1.0
– Go with Java 5 or later version which support many new feature.
– Using JAXB for schema mapping.
– Implemented by some most popular framework:
• CXF
• Axis 2
• JAX-RPC:
– Support SOAP 1.1
– Support WS-I Basic Profile 1.0
– Go with java 1.4
– JAX-RPC has its own data mapping model
SOAP Web Service Implementation
16. • Annotation: simplifying the development effort and extensively used.
– @ServiceMode: Message or Payload.
– @WebService: mark a endpoint implementation as implementing a web service or to mark
that a service endpoint interface as defining a web service interface.
– @WebMethod: define a web service operation
– @WebEndpoint
– @WebParam
– @SOAPBinding: Document or RPC
– @Oneway: a one-way operation returns the thread of control to the calling application prior
to executing the actual business method.
– @HandlerChain: intercept the SOAP message before entering main process for
validating…by implementing SOAPHandler
– @MTOM: support attachment like binary… format
– @BindingType: binding to a specific protocol like SOAP, JMS…
JAX-WS
17. • Invoking Asynchronously web service
– Asynchronous polling use:
Service service = ...;
StockQuote quoteService = (StockQuote)service.getPort(portName);
Response<Float> response = quoteService.getPriceAsync(ticker);
while(response.isDone()) {
// do something while we wai
}
Float quote = response.get();
– Asynchronous callback use:
class MyPriceHandler implements AsyncHandler<Float> {
………….
public void handleResponse(Response<Float> response) {}
}
JAX-WS
18. • Resource injection:
@Resource
private WebServiceContext ctx;
• Data binding with JAXB 2.1
– Marshaling Java Object to XML.
– Un-marshaling XML to Java Object.
– Validate schema
• Support MTOM
– Allowing to send binary attachment such as image
– Optimizing transferring.
• Support SOAP 1.2
• Support WS-Addressing
JAX-WS
19. • REST is described by a set of architectural constraints that attempt to
minimize latency and network communications while, at the same
time, maximizing the independence and scalability of component
implementations.
• REST characteristic/constraints
– Client-Server: Separation of concerns is the principle behind the client-
server.
– Layer
– Caching: improve network efficiency
– Stateless: communication must be stateless in nature.
– Uniform unique resource: emphasis on a uniform interface between
components, and is the central feature that distinguishes the REST
architectural style from other network-based styles .
Restful Web Service
20. • Restful web service built base on the REST architecture style with some
important feature:
– The web services are completely stateless. A good test is to consider
whether the interaction can survive a restart of the server.
– A caching infrastructure can be leveraged for performance If the data that
the web service returns is not dynamically generated.
– Bandwidth is particularly important and needs to be limited. REST is
particularly useful for limited-profile devices, such as PDAs and mobile
phones.
– The service producer and service consumer have a mutual understanding
of the context and content being passed along. There is no formal way to
describe the web services interface, both parties must agree with a pre-
defined interface.
Restful Web Service
21. Restful Web Service Architecture
JSP/Ajax
AngularJS
IOS app
Android app
HTTP/HTTPs/Other
Rest Controller
Service Facade
JSON, XML, PNG.
Core Services
22. • The API suggests its own usage
– Using common and concrete terms
– Using noun, not verb: /getAllCars -> /cars
– Do not mix up singular and plural nouns
• Self-description the request-response.
• JSON when possible, XML if have to
• SSL everywhere - all the time
• Pagination, sorting the query result
• Average granularity, not just one resource = one URL
• Use sub-resources for relations
• Versioning with timestamp, a release number and in the path, not header
• Leverage the HTTP status codes and error In a payload
• Use HTTP headers for specifying serialization formats
– Content-Type defines the request format
– Accept defines a list of acceptable response formats.
• Stateless design.
Restful Web Service design guidelines
23. • JAX-RS
– A Java Specification for building Restful Web service
– A part of JEE architecture
– Current version: 2.0
– Some most popular framework implementation:
• Jersey: a JAX-RS reference implementation from Oracle.
• RESTEasy: fully certified and portable implementation of the JAX-RS by Jboss.
• Restlet
• CXF: enterprise solution with fully Spring integration.
• Non JAX-RS compliant:
– Not fully support JAX-RS, provide some non-standard APIs
• Dropwizard: Java framework for developing ops-friendly, high-performance,
RESTful web services.
• Spring MVC
How to build a Restful Web Service
24. • Annotation
– @Path: is used to define a URI matching pattern for incoming HTTP
requests to a specific resource. URI value can be a regular expression,
variables are denoted by braces { and }:
@Path("/users/{username}") -> http://example.com/users/Galileo
@Path("{database}-db")
public Object getDatabase(@PathParam("database") String db) ->
http://example.com/oracle-db
– @GET: HTTP GET method is used to retrieve a representation of a resource,
and It is both an idempotent and safe operation
• GET http://www.example.com/customers/12345
• GET http://www.example.com/customers/12345/orders
– @POST: HTTP POST to *create* new resources
• POST http://www.example.com/customers
• POST http://www.example.com/customers/12345/orders
JAX-RS
25. • Annotation
– @PUT: HTTP PUT to create/update a resource, this is an idempotent
– @DELETE: HTTP DELETE use to delete a resource
– @PathParam: retrieval based on id like GET /employee/{id}
– @QueryParam: for filtering, allows to inject individual URI query
parameter
GET /customers?start=0&size=10 ->
@GET(“/customers”) @Produces("application/xml")
public String getCustomers(@QueryParam("start") int start,
@QueryParam("size") int size)
– @FormParam: used to access application/x-www-formurlencoded
request bodies.
– @DefaultValue
– @Cookie: use to retrieve the cookie value sending by client.
JAX-RS
26. • Asynchronous
– Client asynchronous call by polling using Future or callback using
AsyncInvoker interface.
– Server side asynchronous implementation
• Bean validation
– Supports the Bean Validation to verify JAX-RS resource classes.
– Using annotation: @NotNull, @Email..
• Filter and handler
– Server filter: Request Filter and Response Filter by implementing
ContainerRequestFilter, ContainerRequestFilter.
– Client filter: Request Filter and Response Filter by implementing
ClientRequestFilter, ClientResponseFilter.
JAX-RS
27. • Content negotiation
– Client/Server can specify the expected content:
• Media: GET /library Accept: application/json
• Language: GET /stuff Accept-Language: en-us, es
• Encode:
– Using annotation:
• @Consumes: specify which MIME media types of representations a resource can
accept, or consume, sending from the client.
• @Produces: specify the MIME media types of representations a resource can
produce and send back to the client: application/json, application/xml,
text/html, image/jpeg, image/png
• Client API
• HATEOAS
JAX-RS
28. SOAP or Restful
SOAP Restful
Protocol->Standard Yes No, an architectural style
Behavior Services-> processing Resource-> represent the state
of application, data
Transport HTTP, FTP, JMS, SMTP HTTP,…
Message Format XML XML, Json, Text
State management State-full Stateless
Cache No Yes
Client/Server model
need
No Yes