SlideShare una empresa de Scribd logo
1 de 54
Descargar para leer sin conexión
BuildingJSONRESTfulWebServices
Using JBoss Fuse
ejlp12@gmail.com
AboutTHisPresentation
This presentation will focus on:
● RESful Web Service
● JSON Format - No detail about XML or other format message transformation
● JAX-RS standard - No detail about JAX-WS
● Apache CXF
● JBoss Fuse 6.2
RESTfulWebService
RESTfulWebServices- INTRODUCTION
Representational State Transfer(REST)
● a software architecture style that centers around the transmission of data
over HTTP, using only the four basic HTTP verbs.
● everything is a resource
● The state/data of the resource can be retrieved, changed, deleted commonly
using HTTP verbs (GET, POST, PUT, DELETE, etc.)
● resource identified by Uniform Resource Identifiers (URIs), for example
/people/unyil
ResourceRepresentation
Commonly used:
● JSON
{
"ID": "1",
"Name": "Unyil Kucing",
"Email": "unyil.kucing@gmail.com",
"Country": "Indonesia"
}
● XML
<Person>
<ID>1</ID>
<Name>Unyil Kucing</Name>
<Email>unyil.kucing@gmail.com</Email>
<Country>India</Country>
</Person>
Request-ResponseExample
POST http://hostname/Person/ HTTP/1.1
Host: hostname
Content-Type: text/xml; charset=utf-8
Content-Length: 123
<?xml version="1.0" encoding="utf-8"?>
<Person>
<ID>1</ID>
<Name>Unyil Kucing</Name>
<Email>unyil.kucing@gmail.com</Email>
<Country>Indonesia</Country>
</Person>
HTTP/1.1 200 OK
Server: ejlp-web-engine 1.0
Content-Length: 263
Content-Type: application/json; charset=utf-8
{
"ID": "1",
"Name": "Unyil Kucing",
"Email": "unyil.kucing@gmail.com",
"Country": "Indonesia"
}
CommonlyURI&HTTPMethodUsage
Resource GET PUT POST DELETE
Collection URI, such as
http://api.example.com/resources/
List the URIs and perhaps
other details of the
collection's members.
Replace the
entire collection
with another
collection.
Create a new entry in the
collection. The new entry's
URI is assigned
automatically and is usually
returned by the operation.[11]
Delete the
entire
collection.
Element URI, such as
http://api.example.com/resources/item17
Retrieve a representation
of the addressed member
of the collection,
expressed in an
appropriate Internet media
type.
Replace the
addressed
member of the
collection, or if it
does not exist,
create it.
Not generally used. Treat the
addressed member as a
collection in its own right
andcreate a new entry in it.
[11]
Delete the
addressed
member of
the
collection.
HTTPMethod
Method Operation performed on server Quality
GET Read a resource. Does not have any effect on
the original value of the
resource
PUT Insert a new resource or update if the
resource already exists.
Gives the same result no
matter how many times you
perform it
POST Insert a new resource. Also can be
used to update an existing resource.
N/A
DELETE Delete a resource . Gives the same result no
matter how many times you
perform it
OPTIONS List the allowed operations on a
resource.
Does not have any effect on
the original value of the
resource
HEAD Return only the response headers and
no response body.
Does not have any effect on
the original value of the
resource
HTTPResponseCode
200 OK
General success status code. This is the most common code. Used to indicate success.
201 CREATED
Successful creation occurred (via either POST or PUT). Set the Location header to contain a link to the newly-created resource
(on POST). Response body content may or may not be present.
204 NO CONTENT
Indicates success but nothing is in the response body, often used for DELETE and PUT operations.
400 BAD REQUEST
General error for when fulfilling the request would cause an invalid state. Domain validation errors, missing data, etc. are some
examples.
401 UNAUTHORIZED
Error code response for missing or invalid authentication token.
403 FORBIDDEN
Error code for when the user is not authorized to perform the operation or the resource is unavailable for some reason (e.g.
time constraints, etc.).
404 NOT FOUND
Used when the requested resource is not found, whether it doesn't exist or if there was a 401 or 403 that, for security reasons,
the service wants to mask.
HTTPResponseCode
405 METHOD NOT ALLOWED
Used to indicate that the requested URL exists, but the requested HTTP method is not applicable. For example, POST
/users/12345 where the API doesn't support creation of resources this way (with a provided ID). The Allow HTTP header must
be set when returning a 405 to indicate the HTTP methods that are supported. In the previous case, the header would look like
"Allow: GET, PUT, DELETE"
409 CONFLICT
Whenever a resource conflict would be caused by fulfilling the request. Duplicate entries, such as trying to create two customers
with the same information, and deleting root objects when cascade-delete is not supported are a couple of examples.
500 INTERNAL SERVER ERROR
Never return this intentionally. The general catch-all error when the server-side throws an exception. Use this only for errors
that the consumer cannot address from their end.
JSONFORMAT
JSONoverXML
● Still readable by human
● Simple
● JSON does not have many concepts found in XML such as namespaces,
attributes or entity references
● Support interface definition? YES
○ WADL
○ Swagger
○ RAML
○ API Blueprint
SwaggerUI
SwaggerExample
{
"swagger": "2.0",
"info": {
[...]
},
"schemes": ["https"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/user": {
"get": {
"responses": {
"200": {
"description": "users retrieved",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/User"
}
}
}
}
}
}
},
"definitions": {
"User": {
"type": "object",
"additionalProperties": false,
"properties": {
"uid": {
"type": "string"
},
"email": {
"type": "string"
},
"phone": {
"type": "string"
}
},
"required": ["uid", "email", "phone"]
}
}
}
JSONandRESTfulWS
in
JBossFuse
RESTfulWebServiceinJBossFuse
● RESTful Web Service is supported in JBoss Fuse by Apache CXF component
● CXF implement JAX-RS standard
● CXF can be used as REST Client or Server
ApacheCFX
CXF provides:
● Java API for building Web Service using JAX-WS
○ Generating WSDL from Java classes and generating Java classes from WSDL
○ WS-* standards support e.g. WS-Addressing, WS-Policy, WS-ReliableMessaging and
WS-Security
○ etc
● Java API for RESTful Web Services JAX-RS 2.0 (JSR-339), JAX-RS 1.1 (JSR-
311)
○ Generating WADL from services, generating Java Interface from WADL
● Can be embedded in standalone app, used in Java EE Server app or in OSGi
engine (JBoss Fuse)
RESTfulWebServicesinJBossFuse
Can be developed WITH or WITHOUT Camel
● WITH Camel
○ Good for RESTful-ized a non JAX-RS Java Class
○ URI defined in config file (blueprint.xml)
○ Options:
■ Using CXFRS component (http://camel.apache.org/cxfrs.html)
■ Using REST wrapper layers
● REST DSL (in camel-core)
● Rest component (in camel-core)
● WITHOUT Camel:
○ Good for Atomic Service
○ No Routing (Integration flow)
○ Create a RESTful (JAX-RS) web service using CXF and expose it with the OSGi HTTP
Service.
○ URI, HTTP method is defined in Java Class using Anotation
○ Quickstart project: https://github.com/jboss-fuse/quickstarts/tree/5715944/rest
RESTfulserviceinCamel
Wrapper Layer:
● REST DSL (in camel-core)
● Rest component (in camel-core)
rest("/say").get("/hello/{name}")
.route()
.transform()
.simple("Hello ${header.name}");
from("rest:get:say:/hello/{name}")
.transform()
.simple("Hello ${header.name}");
RESTfulserviceinCamel
● Spark-Rest component (in camel-spark-rest)
● Restlet component (in camel-restlet)
● Servlet component (in camel-servlet)
JAX-RS
1. The root URI for the resources exposed
by the service
2. Public constructor
3. HTTP verbs
4. Sub-resource, URI for the sub-resource,
as specified using the the @Path
annotation, is
customerservice/order/id
Install&RunFuse
Before building and running this quick start you need:
● Maven 3.0.4 or higher
● JDK 1.6 or 1.7
● JBoss Fuse 6.2.1
unzip ~/RH_JBOSS_INSTALLER/Fuse_6.2.1/jboss-fuse-full-6.2.1.redhat-084.zip -d /Servers/
sed -i.orig 's/#admin/admin/g' /Servers//jboss-fuse-6.2.1.redhat-084/etc/users.properties
/Servers/jboss-fuse-6.2.1.redhat-084/bin/start
tail -f /Servers/jboss-fuse-6.2.1.redhat-084/data/log/fuse.log
$FUSE_HOME=/Servers/jboss-fuse-6.2.1.redhat-084
1. Install Fuse 6.2.1
2. Uncomment line “#admin” (remove “#”) to
set a username and password
3. Start Fuse
4. See the log file
OpentoFuseClient
cd /Servers/jboss-fuse-6.2.1.redhat-084/
./client
FuseDirectoryStructure
Folder quickstart:
Simple sample project
ImportQuickstartProject
● Open Eclipse (JBDS), Create new Workspace
● File > Import, “Existing Maven Projects”, Next
● Root Directory: “/Servers/jboss-fuse-6.2.1.redhat-084/quickstarts/”
● Next, Finish
Eclipse/JBDSSetting
● Help > Preferences
● Type “Maven” in the search textbox
● Select Errors/Warning, change “Plugin execution…” to “Ignore”
Eclipse/JBDSSetting
● Help > Preferences
● Type “Maven” in the search textbox
● JBoss Maven Integration > “Configure Maven Repositories..”
Maven repo: https://repository.jboss.org/nexus/content/groups/ea/
ProjectStructure
Some POJOs
(Business Objects)
RESTful Service
OSGi Configuration File
Maven Configuration File
For real project, better to
separate Business Object and
Service classes in different
Maven Project
Navigate to Package Explorer view, and expand “cfx-rest” project
JAX-RSServiceProvider
Using Java annotation
to define URI of the
service and
documentation
Defining HTTP method,
URI, resource type,
documentation, HTTP
response code
ImportedPackage
JAX-RS
SWAGGER
OSGI-INF/bluerprint/blueprint.xml
Define the Service
Provider bean to be
able to used by other
Documentation:
JAX-RS Endpoint: https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1/html/Apache_CXF_Development_Guide/JAXRSEndpointConfig.html
http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Blueprint
Create a REST server
address: http://hostname:
port/cfx/crm
Create a REST server
address: http://hostname:
port/cfx/crm
blueprint.xml
XML Namespace for JAX-RS using CXF
Prefix Namespace
(default) http://www.osgi.org/xmlns/blueprint/v1.0.0
cxf http://cxf.apache.org/blueprint/core
jaxrs http://cxf.apache.org/blueprint/jaxrs
blueprint.xml
Documentation (Fuse 6.2.1):
● 6.1.2. jaxrs:server Attributes
● 16.1.3. jaxrs:server Child Elements
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1
InstallProject
osgi:install -s mvn:org.jboss.quickstarts.fuse/cxf-rest/6.2.1.redhat-084
OSGiServerInformation
OSGi > Server
Standalone
server
information
JBossFUSEManagementConsole
Access to http://localhost:8181/hawtio
$FUSE_HOME/etc/jetty.xml:
<Property name="jetty.port" default="8181"/>
$FUSE_HOME/etc/org.ops4j.pax.web.cfg:
org.osgi.service.http.port=8181
InstallNewBundle(Application)
OSGi > Bundles
Textbox for Maven
library
MAVEN REPOSITORY DIRECTORY:
Files as a result of Maven build
and install command:
`mvn clean install`
Click this to deploy application
(cxf-res-6.2.1.redhat-084.jar)
OSGiBundleList
OSGi > Bundles - Click Table View button
New
installed
bundle
BundleDetailInformationandActions
OSGi > Bundles - Click “JBoss Fuse Quickstart: rest”
Action Button:
Stop, Start, Refresh,
Update, Delete
Bundle Information
● Maven Repo location
● Some info from Maven POM file
● Start level: order number when
Fuse starting
OSGi Service
Additional info
CFXRESTServiceExample
● http://localhost:8181/cxf/crm?_wadl
● http://localhost:8181/cxf/crm/customerservice?_wadl&_type=xml
CFXRESTServiceExample
OSGiFeatures
OSGi > Features Select package
to see
available
features that
not installed
YET
CXF’sJAX-RS
AdditionalTopics
CXF:AttachingaWADLdocument
<jaxrs:server address="/rest" docLocation="wadl/bookStore.wadl">
<jaxrs:serviceBeans>
<bean class="org.bar.generated.BookStore"/>
</jaxrs:serviceBeans>
</jaxrs:server>
CXF:Schemavalidation
To enable schema validation on incoming messages:
<jaxrs:server address="/rest"
docLocation="wadl/bookStore.wadl">
<jaxrs:serviceBeans>
<bean class="org.bar.generated.BookStore"/>
</jaxrs:serviceBeans>
<jaxrs:schemaLocations>
<jaxrs:schemaLocation>classpath:/schemas/person.xsd</jaxrs:schemaLocation>
<jaxrs:schemaLocation>classpath:/xsd/</jaxrs:schemaLocation>
</jaxrs:schemaLocations>
</jaxrs:server>
CXF:Specifyingthedatabinding
To enable schema validation on incoming messages
<jaxrs:server id="jaxbbook" address="/jaxb">
<jaxrs:serviceBeans>
<ref bean="serviceBean" />
</jaxrs:serviceBeans>
<jaxrs:dataBinding>
<bean class="org.apache.cxf.jaxb.JAXBDataBinding"/>
</jaxrs:dataBinding>
</jaxrs:server>
<jaxrs:dataBinding>
<bean class="org.apache.cxf.aegis.databinding.AegisDatabinding">
<property name="aegisContext">
<bean class="org.apache.cxf.aegis.AegisContext">
<property name="writeXsiTypes" value="true"/>
</bean>
</property>
</bean>
</jaxrs:dataBinding>
CXF:Extensionmappings
to map the .xml or .json suffix automatically
OR
<jaxrs:server id="customerService" address="/">
<jaxrs:serviceBeans>
<bean class="org.apache.cxf.jaxrs.systests.CustomerService" />
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="json" value="application/json"/>
<entry key="xml" value="application/xml"/>
</jaxrs:extensionMappings>
</jaxrs:server>
GET /resource.xml HTTP/1.1
GET /resource.json HTTP/1.1
CXF:RESTfulserviceswithoutannotations
We can defining REST services with XML (Model schema)
<jaxrs:server id="customerService"
address="/customers"
modelRef="classpath:/org/example/schemas/customer-resources.xml" />
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1/html/Apache_CXF_Development_Guide/JAXRSEndpointConfig-Model.html
<model xmlns="http://cxf.apache.org/jaxrs">
<resource name="org.apache.cxf.systest.jaxrs.BookStoreNoAnnotations" path="bookstore"
produces="application/json" consumes="application/json">
<operation name="getBook" verb="GET" path="/books/{id}" produces="application/xml">
<param name="id" type="PATH"/>
</operation>
<operation name="getBookChapter" path="/books/{id}/chapter">
<param name="id" type="PATH"/>
</operation>
<operation name="updateBook" verb="PUT">
<param name="book" type="REQUEST_BODY"/>
</operation>
</resource>
<resource name="org.apache.cxf.systest.jaxrs.ChapterNoAnnotations">
<operation name="getItself" verb="GET"/>
<operation name="updateChapter" verb="PUT" consumes="application/xml">
<param name="content" type="REQUEST_BODY"/>
</operation>
</resource>
</model>
CXF:Swagger
<jaxrs:server id="xx" address="/address" />
<jaxrs:features>
<bean class="io.fabric8.cxf.endpoint.SwaggerFeature">
<property name="title" value="Fabric8:CXF:Quickstarts - Customer Service" />
<property name="description" value="Sample REST-based Customer Service" />
<property name="version" value="${project.version}" />
</bean>
</jaxrs:features>
</jaxrs:server>
CXF:Swagger
http://localhost/cxf/crm/api-docs
TestingREST
RESTSampleTesting
curl -X POST -T src/test/resources/add_customer.xml -H "Content-Type: application/xml" http://localhost:
8181/cxf/crm/customerservice/customers
curl http://localhost:8181/cxf/crm/customerservice/customers/123
curl -X PUT -T src/test/resources/update_customer.xml -H "Content-Type: application/xml" http://localhost:
8181/cxf/crm/customerservice/customers
curl -v -H "Accept: application/json" http://localhost:8181/cxf/crm/customerservice/customers/123
curl http://localhost:8181/cxf/crm/customerservice/customers/123?_type=json
ThankYou:-).

Más contenido relacionado

La actualidad más candente

Big Data Technology Stack : Nutshell
Big Data Technology Stack : NutshellBig Data Technology Stack : Nutshell
Big Data Technology Stack : NutshellKhalid Imran
 
Power BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | EdurekaPower BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | EdurekaEdureka!
 
Agile vs Waterfall Project Management Presentation
Agile vs Waterfall Project Management PresentationAgile vs Waterfall Project Management Presentation
Agile vs Waterfall Project Management PresentationPrateek Sharma
 
Introduction to jQuery Mobile
Introduction to jQuery MobileIntroduction to jQuery Mobile
Introduction to jQuery Mobileejlp12
 
Overview of Agile Methodology
Overview of Agile MethodologyOverview of Agile Methodology
Overview of Agile MethodologyHaresh Karkar
 
Power BI Governance, Why it is important?
Power BI Governance, Why it is important?Power BI Governance, Why it is important?
Power BI Governance, Why it is important?Soheil Bakhshi
 
Agile Methodology PPT
Agile Methodology PPTAgile Methodology PPT
Agile Methodology PPTMohit Kumar
 
What Is Hadoop | Hadoop Tutorial For Beginners | Edureka
What Is Hadoop | Hadoop Tutorial For Beginners | EdurekaWhat Is Hadoop | Hadoop Tutorial For Beginners | Edureka
What Is Hadoop | Hadoop Tutorial For Beginners | EdurekaEdureka!
 
Power BI Overview, Deployment and Governance
Power BI Overview, Deployment and GovernancePower BI Overview, Deployment and Governance
Power BI Overview, Deployment and GovernanceJames Serra
 
Agile Methodology
Agile MethodologyAgile Methodology
Agile MethodologySapna Sood
 
Agile Methology Seminar Report
Agile Methology Seminar ReportAgile Methology Seminar Report
Agile Methology Seminar ReportMohit Kumar
 
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)Cathrine Wilhelmsen
 
Introduction to Pig | Pig Architecture | Pig Fundamentals
Introduction to Pig | Pig Architecture | Pig FundamentalsIntroduction to Pig | Pig Architecture | Pig Fundamentals
Introduction to Pig | Pig Architecture | Pig FundamentalsSkillspeed
 
PDD - Rolling Wave Planning v4
PDD - Rolling Wave Planning v4PDD - Rolling Wave Planning v4
PDD - Rolling Wave Planning v4Candi Rai
 
Agile Patterns and Anti-Patterns
Agile Patterns and Anti-PatternsAgile Patterns and Anti-Patterns
Agile Patterns and Anti-PatternsRichard Cheng
 
Best Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar DatabasesBest Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar DatabasesDATAVERSITY
 
Kanban Agile.pptx
Kanban Agile.pptxKanban Agile.pptx
Kanban Agile.pptxuhcougar1
 

La actualidad más candente (20)

Big Data Technology Stack : Nutshell
Big Data Technology Stack : NutshellBig Data Technology Stack : Nutshell
Big Data Technology Stack : Nutshell
 
Power BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | EdurekaPower BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | Edureka
 
Agile vs Waterfall Project Management Presentation
Agile vs Waterfall Project Management PresentationAgile vs Waterfall Project Management Presentation
Agile vs Waterfall Project Management Presentation
 
Introduction to jQuery Mobile
Introduction to jQuery MobileIntroduction to jQuery Mobile
Introduction to jQuery Mobile
 
Overview of Agile Methodology
Overview of Agile MethodologyOverview of Agile Methodology
Overview of Agile Methodology
 
Power BI Governance, Why it is important?
Power BI Governance, Why it is important?Power BI Governance, Why it is important?
Power BI Governance, Why it is important?
 
What is agile?
What is agile?What is agile?
What is agile?
 
Agile Methodology PPT
Agile Methodology PPTAgile Methodology PPT
Agile Methodology PPT
 
What Is Hadoop | Hadoop Tutorial For Beginners | Edureka
What Is Hadoop | Hadoop Tutorial For Beginners | EdurekaWhat Is Hadoop | Hadoop Tutorial For Beginners | Edureka
What Is Hadoop | Hadoop Tutorial For Beginners | Edureka
 
Waterfall model in SDLC
Waterfall model in SDLCWaterfall model in SDLC
Waterfall model in SDLC
 
Power BI Overview, Deployment and Governance
Power BI Overview, Deployment and GovernancePower BI Overview, Deployment and Governance
Power BI Overview, Deployment and Governance
 
Agile Methodology
Agile MethodologyAgile Methodology
Agile Methodology
 
Agile Methology Seminar Report
Agile Methology Seminar ReportAgile Methology Seminar Report
Agile Methology Seminar Report
 
Power Bi Basics
Power Bi BasicsPower Bi Basics
Power Bi Basics
 
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
 
Introduction to Pig | Pig Architecture | Pig Fundamentals
Introduction to Pig | Pig Architecture | Pig FundamentalsIntroduction to Pig | Pig Architecture | Pig Fundamentals
Introduction to Pig | Pig Architecture | Pig Fundamentals
 
PDD - Rolling Wave Planning v4
PDD - Rolling Wave Planning v4PDD - Rolling Wave Planning v4
PDD - Rolling Wave Planning v4
 
Agile Patterns and Anti-Patterns
Agile Patterns and Anti-PatternsAgile Patterns and Anti-Patterns
Agile Patterns and Anti-Patterns
 
Best Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar DatabasesBest Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar Databases
 
Kanban Agile.pptx
Kanban Agile.pptxKanban Agile.pptx
Kanban Agile.pptx
 

Destacado

PMP Training - 01 introduction to framework
PMP Training - 01 introduction to frameworkPMP Training - 01 introduction to framework
PMP Training - 01 introduction to frameworkejlp12
 
PMP Training - 04 project integration management
PMP Training - 04 project integration managementPMP Training - 04 project integration management
PMP Training - 04 project integration managementejlp12
 
PMP Training - 11 project risk management
PMP Training - 11 project risk managementPMP Training - 11 project risk management
PMP Training - 11 project risk managementejlp12
 
PMP Training - 08 project quality management
PMP Training - 08 project quality managementPMP Training - 08 project quality management
PMP Training - 08 project quality managementejlp12
 
PMP Training - 06 project time management2
PMP Training - 06 project time management2PMP Training - 06 project time management2
PMP Training - 06 project time management2ejlp12
 
PMP Training - 10 project communication management
PMP Training - 10 project communication managementPMP Training - 10 project communication management
PMP Training - 10 project communication managementejlp12
 
PMP Training - 09 project human resource management
PMP Training - 09 project human resource managementPMP Training - 09 project human resource management
PMP Training - 09 project human resource managementejlp12
 
PMP Training - 12 project procurement management
PMP Training - 12 project procurement managementPMP Training - 12 project procurement management
PMP Training - 12 project procurement managementejlp12
 
PMP Training - 05 project scope management
PMP Training - 05 project scope managementPMP Training - 05 project scope management
PMP Training - 05 project scope managementejlp12
 
PMP Training - 07 project cost management
PMP Training - 07 project cost managementPMP Training - 07 project cost management
PMP Training - 07 project cost managementejlp12
 
Agile & SCRUM
Agile & SCRUMAgile & SCRUM
Agile & SCRUMejlp12
 
IBM WebSphere Application Server (Clustering) Concept
IBM WebSphere Application Server (Clustering) ConceptIBM WebSphere Application Server (Clustering) Concept
IBM WebSphere Application Server (Clustering) Conceptejlp12
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & dockerejlp12
 
JBoss Data Virtualization (JDV) Sample Physical Deployment Architecture
JBoss Data Virtualization (JDV) Sample Physical Deployment ArchitectureJBoss Data Virtualization (JDV) Sample Physical Deployment Architecture
JBoss Data Virtualization (JDV) Sample Physical Deployment Architectureejlp12
 
GSM/UMTS network architecture tutorial (Indonesia)
GSM/UMTS network architecture tutorial (Indonesia)GSM/UMTS network architecture tutorial (Indonesia)
GSM/UMTS network architecture tutorial (Indonesia)ejlp12
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introductionejlp12
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)ejlp12
 
IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction ejlp12
 

Destacado (20)

PMP Training - 01 introduction to framework
PMP Training - 01 introduction to frameworkPMP Training - 01 introduction to framework
PMP Training - 01 introduction to framework
 
PMP Training - 04 project integration management
PMP Training - 04 project integration managementPMP Training - 04 project integration management
PMP Training - 04 project integration management
 
PMP Training - 11 project risk management
PMP Training - 11 project risk managementPMP Training - 11 project risk management
PMP Training - 11 project risk management
 
PMP Training - 08 project quality management
PMP Training - 08 project quality managementPMP Training - 08 project quality management
PMP Training - 08 project quality management
 
PMP Training - 06 project time management2
PMP Training - 06 project time management2PMP Training - 06 project time management2
PMP Training - 06 project time management2
 
PMP Training - 10 project communication management
PMP Training - 10 project communication managementPMP Training - 10 project communication management
PMP Training - 10 project communication management
 
PMP Training - 09 project human resource management
PMP Training - 09 project human resource managementPMP Training - 09 project human resource management
PMP Training - 09 project human resource management
 
PMP Training - 12 project procurement management
PMP Training - 12 project procurement managementPMP Training - 12 project procurement management
PMP Training - 12 project procurement management
 
PMP Training - 05 project scope management
PMP Training - 05 project scope managementPMP Training - 05 project scope management
PMP Training - 05 project scope management
 
PMP Training - 07 project cost management
PMP Training - 07 project cost managementPMP Training - 07 project cost management
PMP Training - 07 project cost management
 
Agile & SCRUM
Agile & SCRUMAgile & SCRUM
Agile & SCRUM
 
IBM WebSphere Application Server (Clustering) Concept
IBM WebSphere Application Server (Clustering) ConceptIBM WebSphere Application Server (Clustering) Concept
IBM WebSphere Application Server (Clustering) Concept
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & docker
 
JBoss Data Virtualization (JDV) Sample Physical Deployment Architecture
JBoss Data Virtualization (JDV) Sample Physical Deployment ArchitectureJBoss Data Virtualization (JDV) Sample Physical Deployment Architecture
JBoss Data Virtualization (JDV) Sample Physical Deployment Architecture
 
GSM/UMTS network architecture tutorial (Indonesia)
GSM/UMTS network architecture tutorial (Indonesia)GSM/UMTS network architecture tutorial (Indonesia)
GSM/UMTS network architecture tutorial (Indonesia)
 
Java EE 7 - Overview and Status
Java EE 7  - Overview and StatusJava EE 7  - Overview and Status
Java EE 7 - Overview and Status
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)
 
IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction
 
IBM MQ V9 Overview
IBM MQ V9 OverviewIBM MQ V9 Overview
IBM MQ V9 Overview
 

Similar a RESTful web service with JBoss Fuse

Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jerseyb_kathir
 
Java EE7
Java EE7Java EE7
Java EE7Jay Lee
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesJustin Michael Raj
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
05 status-codes
05 status-codes05 status-codes
05 status-codessnopteck
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsCarol McDonald
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHPZoran Jeremic
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHPZoran Jeremic
 
03 form-data
03 form-data03 form-data
03 form-datasnopteck
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSCosmin Mereuta
 
Android App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web ServicesAndroid App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web ServicesAnuchit Chalothorn
 
112815 java ee8_davidd
112815 java ee8_davidd112815 java ee8_davidd
112815 java ee8_daviddTakashi Ito
 
About REST. Архитектурные семинары Softengi
About REST. Архитектурные семинары SoftengiAbout REST. Архитектурные семинары Softengi
About REST. Архитектурные семинары SoftengiSoftengi
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Mindfire Solutions
 

Similar a RESTful web service with JBoss Fuse (20)

Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 
Java EE7
Java EE7Java EE7
Java EE7
 
API
APIAPI
API
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data Services
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
05 status-codes
05 status-codes05 status-codes
05 status-codes
 
Rest
RestRest
Rest
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHP
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
03 form-data
03 form-data03 form-data
03 form-data
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JS
 
Android and REST
Android and RESTAndroid and REST
Android and REST
 
Android App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web ServicesAndroid App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web Services
 
112815 java ee8_davidd
112815 java ee8_davidd112815 java ee8_davidd
112815 java ee8_davidd
 
About REST. Архитектурные семинары Softengi
About REST. Архитектурные семинары SoftengiAbout REST. Архитектурные семинары Softengi
About REST. Архитектурные семинары Softengi
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 
Android networking-2
Android networking-2Android networking-2
Android networking-2
 

Más de ejlp12

Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageejlp12
 
Java troubleshooting thread dump
Java troubleshooting thread dumpJava troubleshooting thread dump
Java troubleshooting thread dumpejlp12
 
WebSphere Application Server Information Resources
WebSphere Application Server Information ResourcesWebSphere Application Server Information Resources
WebSphere Application Server Information Resourcesejlp12
 
WebSphere Application Server Family (Editions Comparison)
WebSphere Application Server Family (Editions Comparison)WebSphere Application Server Family (Editions Comparison)
WebSphere Application Server Family (Editions Comparison)ejlp12
 
BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)ejlp12
 
BPMN Introduction
BPMN IntroductionBPMN Introduction
BPMN Introductionejlp12
 
WebSphere Application Server Topology Options
WebSphere Application Server Topology OptionsWebSphere Application Server Topology Options
WebSphere Application Server Topology Optionsejlp12
 
IBM WebSphere Application Server version to version comparison
IBM WebSphere Application Server version to version comparisonIBM WebSphere Application Server version to version comparison
IBM WebSphere Application Server version to version comparisonejlp12
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)ejlp12
 
Introduction to JavaBeans Activation Framework v1.1
Introduction to JavaBeans Activation Framework v1.1Introduction to JavaBeans Activation Framework v1.1
Introduction to JavaBeans Activation Framework v1.1ejlp12
 
Arah pengembangan core network architecture (Indonesia)
Arah pengembangan core network architecture (Indonesia)Arah pengembangan core network architecture (Indonesia)
Arah pengembangan core network architecture (Indonesia)ejlp12
 

Más de ejlp12 (11)

Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
 
Java troubleshooting thread dump
Java troubleshooting thread dumpJava troubleshooting thread dump
Java troubleshooting thread dump
 
WebSphere Application Server Information Resources
WebSphere Application Server Information ResourcesWebSphere Application Server Information Resources
WebSphere Application Server Information Resources
 
WebSphere Application Server Family (Editions Comparison)
WebSphere Application Server Family (Editions Comparison)WebSphere Application Server Family (Editions Comparison)
WebSphere Application Server Family (Editions Comparison)
 
BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)
 
BPMN Introduction
BPMN IntroductionBPMN Introduction
BPMN Introduction
 
WebSphere Application Server Topology Options
WebSphere Application Server Topology OptionsWebSphere Application Server Topology Options
WebSphere Application Server Topology Options
 
IBM WebSphere Application Server version to version comparison
IBM WebSphere Application Server version to version comparisonIBM WebSphere Application Server version to version comparison
IBM WebSphere Application Server version to version comparison
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)
 
Introduction to JavaBeans Activation Framework v1.1
Introduction to JavaBeans Activation Framework v1.1Introduction to JavaBeans Activation Framework v1.1
Introduction to JavaBeans Activation Framework v1.1
 
Arah pengembangan core network architecture (Indonesia)
Arah pengembangan core network architecture (Indonesia)Arah pengembangan core network architecture (Indonesia)
Arah pengembangan core network architecture (Indonesia)
 

Último

Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Último (20)

Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

RESTful web service with JBoss Fuse

  • 2. AboutTHisPresentation This presentation will focus on: ● RESful Web Service ● JSON Format - No detail about XML or other format message transformation ● JAX-RS standard - No detail about JAX-WS ● Apache CXF ● JBoss Fuse 6.2
  • 4. RESTfulWebServices- INTRODUCTION Representational State Transfer(REST) ● a software architecture style that centers around the transmission of data over HTTP, using only the four basic HTTP verbs. ● everything is a resource ● The state/data of the resource can be retrieved, changed, deleted commonly using HTTP verbs (GET, POST, PUT, DELETE, etc.) ● resource identified by Uniform Resource Identifiers (URIs), for example /people/unyil
  • 5. ResourceRepresentation Commonly used: ● JSON { "ID": "1", "Name": "Unyil Kucing", "Email": "unyil.kucing@gmail.com", "Country": "Indonesia" } ● XML <Person> <ID>1</ID> <Name>Unyil Kucing</Name> <Email>unyil.kucing@gmail.com</Email> <Country>India</Country> </Person>
  • 6. Request-ResponseExample POST http://hostname/Person/ HTTP/1.1 Host: hostname Content-Type: text/xml; charset=utf-8 Content-Length: 123 <?xml version="1.0" encoding="utf-8"?> <Person> <ID>1</ID> <Name>Unyil Kucing</Name> <Email>unyil.kucing@gmail.com</Email> <Country>Indonesia</Country> </Person> HTTP/1.1 200 OK Server: ejlp-web-engine 1.0 Content-Length: 263 Content-Type: application/json; charset=utf-8 { "ID": "1", "Name": "Unyil Kucing", "Email": "unyil.kucing@gmail.com", "Country": "Indonesia" }
  • 7. CommonlyURI&HTTPMethodUsage Resource GET PUT POST DELETE Collection URI, such as http://api.example.com/resources/ List the URIs and perhaps other details of the collection's members. Replace the entire collection with another collection. Create a new entry in the collection. The new entry's URI is assigned automatically and is usually returned by the operation.[11] Delete the entire collection. Element URI, such as http://api.example.com/resources/item17 Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type. Replace the addressed member of the collection, or if it does not exist, create it. Not generally used. Treat the addressed member as a collection in its own right andcreate a new entry in it. [11] Delete the addressed member of the collection.
  • 8. HTTPMethod Method Operation performed on server Quality GET Read a resource. Does not have any effect on the original value of the resource PUT Insert a new resource or update if the resource already exists. Gives the same result no matter how many times you perform it POST Insert a new resource. Also can be used to update an existing resource. N/A DELETE Delete a resource . Gives the same result no matter how many times you perform it OPTIONS List the allowed operations on a resource. Does not have any effect on the original value of the resource HEAD Return only the response headers and no response body. Does not have any effect on the original value of the resource
  • 9. HTTPResponseCode 200 OK General success status code. This is the most common code. Used to indicate success. 201 CREATED Successful creation occurred (via either POST or PUT). Set the Location header to contain a link to the newly-created resource (on POST). Response body content may or may not be present. 204 NO CONTENT Indicates success but nothing is in the response body, often used for DELETE and PUT operations. 400 BAD REQUEST General error for when fulfilling the request would cause an invalid state. Domain validation errors, missing data, etc. are some examples. 401 UNAUTHORIZED Error code response for missing or invalid authentication token. 403 FORBIDDEN Error code for when the user is not authorized to perform the operation or the resource is unavailable for some reason (e.g. time constraints, etc.). 404 NOT FOUND Used when the requested resource is not found, whether it doesn't exist or if there was a 401 or 403 that, for security reasons, the service wants to mask.
  • 10. HTTPResponseCode 405 METHOD NOT ALLOWED Used to indicate that the requested URL exists, but the requested HTTP method is not applicable. For example, POST /users/12345 where the API doesn't support creation of resources this way (with a provided ID). The Allow HTTP header must be set when returning a 405 to indicate the HTTP methods that are supported. In the previous case, the header would look like "Allow: GET, PUT, DELETE" 409 CONFLICT Whenever a resource conflict would be caused by fulfilling the request. Duplicate entries, such as trying to create two customers with the same information, and deleting root objects when cascade-delete is not supported are a couple of examples. 500 INTERNAL SERVER ERROR Never return this intentionally. The general catch-all error when the server-side throws an exception. Use this only for errors that the consumer cannot address from their end.
  • 12. JSONoverXML ● Still readable by human ● Simple ● JSON does not have many concepts found in XML such as namespaces, attributes or entity references ● Support interface definition? YES ○ WADL ○ Swagger ○ RAML ○ API Blueprint
  • 14. SwaggerExample { "swagger": "2.0", "info": { [...] }, "schemes": ["https"], "consumes": ["application/json"], "produces": ["application/json"], "paths": { "/user": { "get": { "responses": { "200": { "description": "users retrieved", "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } } } } } }, "definitions": { "User": { "type": "object", "additionalProperties": false, "properties": { "uid": { "type": "string" }, "email": { "type": "string" }, "phone": { "type": "string" } }, "required": ["uid", "email", "phone"] } } }
  • 16. RESTfulWebServiceinJBossFuse ● RESTful Web Service is supported in JBoss Fuse by Apache CXF component ● CXF implement JAX-RS standard ● CXF can be used as REST Client or Server
  • 17. ApacheCFX CXF provides: ● Java API for building Web Service using JAX-WS ○ Generating WSDL from Java classes and generating Java classes from WSDL ○ WS-* standards support e.g. WS-Addressing, WS-Policy, WS-ReliableMessaging and WS-Security ○ etc ● Java API for RESTful Web Services JAX-RS 2.0 (JSR-339), JAX-RS 1.1 (JSR- 311) ○ Generating WADL from services, generating Java Interface from WADL ● Can be embedded in standalone app, used in Java EE Server app or in OSGi engine (JBoss Fuse)
  • 18. RESTfulWebServicesinJBossFuse Can be developed WITH or WITHOUT Camel ● WITH Camel ○ Good for RESTful-ized a non JAX-RS Java Class ○ URI defined in config file (blueprint.xml) ○ Options: ■ Using CXFRS component (http://camel.apache.org/cxfrs.html) ■ Using REST wrapper layers ● REST DSL (in camel-core) ● Rest component (in camel-core) ● WITHOUT Camel: ○ Good for Atomic Service ○ No Routing (Integration flow) ○ Create a RESTful (JAX-RS) web service using CXF and expose it with the OSGi HTTP Service. ○ URI, HTTP method is defined in Java Class using Anotation ○ Quickstart project: https://github.com/jboss-fuse/quickstarts/tree/5715944/rest
  • 19. RESTfulserviceinCamel Wrapper Layer: ● REST DSL (in camel-core) ● Rest component (in camel-core) rest("/say").get("/hello/{name}") .route() .transform() .simple("Hello ${header.name}"); from("rest:get:say:/hello/{name}") .transform() .simple("Hello ${header.name}");
  • 20. RESTfulserviceinCamel ● Spark-Rest component (in camel-spark-rest) ● Restlet component (in camel-restlet) ● Servlet component (in camel-servlet)
  • 21. JAX-RS 1. The root URI for the resources exposed by the service 2. Public constructor 3. HTTP verbs 4. Sub-resource, URI for the sub-resource, as specified using the the @Path annotation, is customerservice/order/id
  • 22. Install&RunFuse Before building and running this quick start you need: ● Maven 3.0.4 or higher ● JDK 1.6 or 1.7 ● JBoss Fuse 6.2.1 unzip ~/RH_JBOSS_INSTALLER/Fuse_6.2.1/jboss-fuse-full-6.2.1.redhat-084.zip -d /Servers/ sed -i.orig 's/#admin/admin/g' /Servers//jboss-fuse-6.2.1.redhat-084/etc/users.properties /Servers/jboss-fuse-6.2.1.redhat-084/bin/start tail -f /Servers/jboss-fuse-6.2.1.redhat-084/data/log/fuse.log $FUSE_HOME=/Servers/jboss-fuse-6.2.1.redhat-084 1. Install Fuse 6.2.1 2. Uncomment line “#admin” (remove “#”) to set a username and password 3. Start Fuse 4. See the log file
  • 25. ImportQuickstartProject ● Open Eclipse (JBDS), Create new Workspace ● File > Import, “Existing Maven Projects”, Next ● Root Directory: “/Servers/jboss-fuse-6.2.1.redhat-084/quickstarts/” ● Next, Finish
  • 26. Eclipse/JBDSSetting ● Help > Preferences ● Type “Maven” in the search textbox ● Select Errors/Warning, change “Plugin execution…” to “Ignore”
  • 27. Eclipse/JBDSSetting ● Help > Preferences ● Type “Maven” in the search textbox ● JBoss Maven Integration > “Configure Maven Repositories..” Maven repo: https://repository.jboss.org/nexus/content/groups/ea/
  • 28. ProjectStructure Some POJOs (Business Objects) RESTful Service OSGi Configuration File Maven Configuration File For real project, better to separate Business Object and Service classes in different Maven Project Navigate to Package Explorer view, and expand “cfx-rest” project
  • 29. JAX-RSServiceProvider Using Java annotation to define URI of the service and documentation Defining HTTP method, URI, resource type, documentation, HTTP response code
  • 31. OSGI-INF/bluerprint/blueprint.xml Define the Service Provider bean to be able to used by other Documentation: JAX-RS Endpoint: https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1/html/Apache_CXF_Development_Guide/JAXRSEndpointConfig.html http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Blueprint Create a REST server address: http://hostname: port/cfx/crm Create a REST server address: http://hostname: port/cfx/crm
  • 32. blueprint.xml XML Namespace for JAX-RS using CXF Prefix Namespace (default) http://www.osgi.org/xmlns/blueprint/v1.0.0 cxf http://cxf.apache.org/blueprint/core jaxrs http://cxf.apache.org/blueprint/jaxrs
  • 33. blueprint.xml Documentation (Fuse 6.2.1): ● 6.1.2. jaxrs:server Attributes ● 16.1.3. jaxrs:server Child Elements https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1
  • 36. JBossFUSEManagementConsole Access to http://localhost:8181/hawtio $FUSE_HOME/etc/jetty.xml: <Property name="jetty.port" default="8181"/> $FUSE_HOME/etc/org.ops4j.pax.web.cfg: org.osgi.service.http.port=8181
  • 37. InstallNewBundle(Application) OSGi > Bundles Textbox for Maven library MAVEN REPOSITORY DIRECTORY: Files as a result of Maven build and install command: `mvn clean install` Click this to deploy application (cxf-res-6.2.1.redhat-084.jar)
  • 38. OSGiBundleList OSGi > Bundles - Click Table View button New installed bundle
  • 39. BundleDetailInformationandActions OSGi > Bundles - Click “JBoss Fuse Quickstart: rest” Action Button: Stop, Start, Refresh, Update, Delete Bundle Information ● Maven Repo location ● Some info from Maven POM file ● Start level: order number when Fuse starting OSGi Service Additional info
  • 42. OSGiFeatures OSGi > Features Select package to see available features that not installed YET
  • 44. CXF:AttachingaWADLdocument <jaxrs:server address="/rest" docLocation="wadl/bookStore.wadl"> <jaxrs:serviceBeans> <bean class="org.bar.generated.BookStore"/> </jaxrs:serviceBeans> </jaxrs:server>
  • 45. CXF:Schemavalidation To enable schema validation on incoming messages: <jaxrs:server address="/rest" docLocation="wadl/bookStore.wadl"> <jaxrs:serviceBeans> <bean class="org.bar.generated.BookStore"/> </jaxrs:serviceBeans> <jaxrs:schemaLocations> <jaxrs:schemaLocation>classpath:/schemas/person.xsd</jaxrs:schemaLocation> <jaxrs:schemaLocation>classpath:/xsd/</jaxrs:schemaLocation> </jaxrs:schemaLocations> </jaxrs:server>
  • 46. CXF:Specifyingthedatabinding To enable schema validation on incoming messages <jaxrs:server id="jaxbbook" address="/jaxb"> <jaxrs:serviceBeans> <ref bean="serviceBean" /> </jaxrs:serviceBeans> <jaxrs:dataBinding> <bean class="org.apache.cxf.jaxb.JAXBDataBinding"/> </jaxrs:dataBinding> </jaxrs:server> <jaxrs:dataBinding> <bean class="org.apache.cxf.aegis.databinding.AegisDatabinding"> <property name="aegisContext"> <bean class="org.apache.cxf.aegis.AegisContext"> <property name="writeXsiTypes" value="true"/> </bean> </property> </bean> </jaxrs:dataBinding>
  • 47. CXF:Extensionmappings to map the .xml or .json suffix automatically OR <jaxrs:server id="customerService" address="/"> <jaxrs:serviceBeans> <bean class="org.apache.cxf.jaxrs.systests.CustomerService" /> </jaxrs:serviceBeans> <jaxrs:extensionMappings> <entry key="json" value="application/json"/> <entry key="xml" value="application/xml"/> </jaxrs:extensionMappings> </jaxrs:server> GET /resource.xml HTTP/1.1 GET /resource.json HTTP/1.1
  • 48. CXF:RESTfulserviceswithoutannotations We can defining REST services with XML (Model schema) <jaxrs:server id="customerService" address="/customers" modelRef="classpath:/org/example/schemas/customer-resources.xml" /> https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1/html/Apache_CXF_Development_Guide/JAXRSEndpointConfig-Model.html <model xmlns="http://cxf.apache.org/jaxrs"> <resource name="org.apache.cxf.systest.jaxrs.BookStoreNoAnnotations" path="bookstore" produces="application/json" consumes="application/json"> <operation name="getBook" verb="GET" path="/books/{id}" produces="application/xml"> <param name="id" type="PATH"/> </operation> <operation name="getBookChapter" path="/books/{id}/chapter"> <param name="id" type="PATH"/> </operation> <operation name="updateBook" verb="PUT"> <param name="book" type="REQUEST_BODY"/> </operation> </resource> <resource name="org.apache.cxf.systest.jaxrs.ChapterNoAnnotations"> <operation name="getItself" verb="GET"/> <operation name="updateChapter" verb="PUT" consumes="application/xml"> <param name="content" type="REQUEST_BODY"/> </operation> </resource> </model>
  • 49. CXF:Swagger <jaxrs:server id="xx" address="/address" /> <jaxrs:features> <bean class="io.fabric8.cxf.endpoint.SwaggerFeature"> <property name="title" value="Fabric8:CXF:Quickstarts - Customer Service" /> <property name="description" value="Sample REST-based Customer Service" /> <property name="version" value="${project.version}" /> </bean> </jaxrs:features> </jaxrs:server>
  • 51.
  • 53. RESTSampleTesting curl -X POST -T src/test/resources/add_customer.xml -H "Content-Type: application/xml" http://localhost: 8181/cxf/crm/customerservice/customers curl http://localhost:8181/cxf/crm/customerservice/customers/123 curl -X PUT -T src/test/resources/update_customer.xml -H "Content-Type: application/xml" http://localhost: 8181/cxf/crm/customerservice/customers curl -v -H "Accept: application/json" http://localhost:8181/cxf/crm/customerservice/customers/123 curl http://localhost:8181/cxf/crm/customerservice/customers/123?_type=json