SlideShare a Scribd company logo
1 of 37
Download to read offline
IBM Software Group
1
http://tuscany.apache.org
RESTful SCA with Apache Tuscany
Luciano Resende
lresende@apache.org
http://lresende.blogspot.com
Jean-Sebastien Delfino
jsdelfino@apache.org
http://jsdelfino.blogspot.com
IBM Software Group
2
http://tuscany.apache.org
Agenda
•  What is Apache Tuscany
•  What is Apache Wink
•  RESTFul SCA Overview
•  Usage and architecture walk-through
-  Including a look at various scenarios
•  What’s next
•  Getting involved
IBM Software Group
3
http://tuscany.apache.org
What is Apache Tuscany ?
IBM Software Group
4
http://tuscany.apache.org
Apache Tuscany
•  Apache Tuscany provides a component based
programming model which simplifies development,
assembly and deployment and management of
composite applications.
•  Apache Tuscany implements SCA standards
defined by OASIS OpenCSA and extensions
based on real user feedback.
4
IBM Software Group
5
http://tuscany.apache.org
Building Applications using SCA
•  Business functions are
defined as SCA
Components
–  That expose services
-  Using different
communication
protocols (bindings)
–  And have dependencies on
other services through
References
Store
Catalog
Currency
Converter
http
currencyCode=USD
Fruit
Catalog
ShoppingCart
atom
jsonrpc
Collection
Total
IBM Software Group
6
http://tuscany.apache.org
SCA Overview
Composite A
Component
AService
Service Binding
Web Service
JMS
SLSB
Rest
JSONRPC
JCA
…
Reference Binding
Web Service
JMS
SLSB
Rest
JSONRPC
JCA
…
Component
B
Service Interface
- Java
- WSDL
Reference Interface
Reference
property setting
Property
promotepromote wire
Implementation
Java
BPEL
PHP
SCA composite
Spring
EJB module
…
- Java
- WSDL
IBM Software Group
7
http://tuscany.apache.org
What is Apache Wink?
IBM Software Group
8
http://tuscany.apache.org
Apache Wink
•  Apache Wink is a simple yet solid open source framework for building
RESTful Web services. It is comprised of a Server module and a Client
module for developing and consuming RESTful Web services.
•  The Wink Server module is a complete implementation of the JAX-RS
v1.0 specification. On top of this implementation, the Wink Server
module provides a set of additional features that were designed to
facilitate the development of RESTful Web services.
•  The Wink Client module is a Java based framework that provides
functionality for communicating with RESTful Web services. The
framework is built on top of the JDK HttpURLConnection and adds
essential features that facilitate the development of such client
applications.
IBM Software Group
9
http://tuscany.apache.org
RESTful SCA
Overview
IBM Software Group
10
http://tuscany.apache.org
REST-related user stories
•  As a developer, I want to expose new or existing services over HTTP in
REST styles with the flexibility to use different wire formats including (but
not limited to) JSON, XML.
•  As a developer, I want to allow RPC services to be accessed via HTTP
GET method in REST styles to take advantage of HTTP caching.
•  As a developer, I want to configure a service exposed using REST to use
different cache control mechanisms to maximize performance of static
resources and or cache dynamic content.
•  As a developer, I want to invoke existing RESTful services via a business
interface without dealing with the HTTP client APIs.
•  As a developer, I want to compose services (both RESTful and non-
RESTful) into a solution using SCA.
November 4, 2010
IBM Software Group
11
http://tuscany.apache.org
A win-win situation using SCA and JAX-RS
•  SCA gives us the power to declare, configure and compose services in
a technology neutral fashion.
•  REST is an important aspect of the Web 2.0 world. Building RESTful
services can be a challenge as REST is just an architectural style.
JAX-RS emerges as the standard REST programming model.
•  A balanced middle-ground to leverage the power of declarative
services using SCA and annotation based REST/HTTP mapping using
JAX-RS (without tying business logic to the technology specifics) (try to
avoid JAX-RS APIs directly).
IBM Software Group
12
http://tuscany.apache.org
Tuscany’s offerings for REST
•  The Tuscany Java SCA runtime provides the integration with REST
services out of the box via several extensions.
-  Tuscany REST binding type (binding.rest)
•  Leverage JAX-RS annotations to map business operations to HTTP operations
such as POST, GET, PUT and DELETE to provide a REST view to SCA
services.
•  Support RPC over HTTP GET
•  Allow SCA components to invoke existing RESTful services via a JAX-RS
annotated interfaces without messing around HTTP clients.
-  Tuscany JAX-RS implementation type (implementation.jaxrs)
•  JAX-RS applications and resources can be dropped into the SCA assembly as
JAX-RS implementation (implementation.jaxrs).
-  Tuscany also enrich the JAX-RS runtime with more databindings to provide
support for data representations and transformation without the
interventions from application code.
IBM Software Group
13
http://tuscany.apache.org
Runtime overview
•  Related Tuscany modules
-  interface-java-jaxrs (Introspection of JAX-RS annotated interfaces)
-  binding-rest (binding.rest XML/Java model)
-  binding-rest-runtime (runtime provider)
-  implementation-jaxrs (implementation.jaxrs XML/Java model)
-  implementation-jaxrs-runtime (runtime provider)
•  Tuscany uses Apache Wink 1.1.1-incubating as the JAX-RS runtime
-  Contributions were made to the Wink runtime to facilitate embedding Wink
and it’s going to be available in Wink 1.1.2 which should be available in the
near future
IBM Software Group
14
http://tuscany.apache.org
Usage and architecture walk-through
IBM Software Group
15
http://tuscany.apache.org
Use Case #1:
Exposing an SCA service to HTTP using REST
•  We have an existing SCA service and want to make it RESTful
1.  Define a Java interface with JAX-RS annotations
•  Provide URI
•  Map between business operations and HTTP methods
•  Map Input/Output (Path segments, query parameters, headers, etc)
•  Configure wire formats
2.  Each method should have a compatible operation in the SCA service
IBM Software Group
16
http://tuscany.apache.org
REST Services
•  Supports exposing existing SCA components as RESTFul services
•  Exposing a service as RESTful resource
•  Consuming REST Services
- Multiple JavaScript frameworks such as Dojo (XHR)
- Regular Web browsers
- Regular utilities such as cUrl, wGet, etc
- SCA component
<component name=”Catalog">
<implementation.java class="services.FruitsCataloglmpl" />
<service name=”Catalog">
<t:binding.rest uri="http://localhost:8080/Cartalog" >
<t:wireFormat.json />
<t:operationSelector.jaxrs />
</t:binding.rest>
</service>
</component>
Fruit
Catalog
json
IBM Software Group
17
http://tuscany.apache.org
Mapping business interfaces using JAX-RS
@Remotable
public interface Catalog{
@GET
Item[] getItem();
@GET
@Path("{id}")
Item getItemById(@PathParam("id") String itemId);
@POST
void addItem(Item item);
@PUT
void updateItem(Item item);
@DELETE
@Path("{id}")
void deleteItem(@PathParam("id") String itemId);
}
IBM Software Group
18
http://tuscany.apache.org
REST service binding runtime architecture
IBM Software Group
19
http://tuscany.apache.org
Use Case #2:
Allowing HTTP GET access to an SCA RPC service
•  We have an existing RPC SCA service and want to allow remote
accesses using HTTP GET
-  No standard JAX-RS client is defined by the JAX-RS spec
-  We need to figure the URI, parameter passing (positional or name/value
pairs, headers, etc)
IBM Software Group
20
http://tuscany.apache.org
RPC Services over HTTP GET
•  The REST binding provides mapping your RPC style calls over HTTP
GET
•  Exposing a service as RESTful resource
•  Client Invocation
- http://localhost:8085/EchoService?method=echo&msg=Hello RPC
- http://localhost:8085/EchoService?
method=echoArrayString&msgArray=Hello RPC1&msgArray=Hello RPC2"
<component name=”Catalog">
<implementation.java class="services.FruitsCataloglmpl" />
<service name=”Catalog">
<t:binding.rest uri="http://localhost:8080/Cartalog" />
<t:wireFormat.json />
<t:operationSelector.rpc />
</t:binding.rest>
</service>
</component>
Fruit
Catalog
json
IBM Software Group
21
http://tuscany.apache.org
Mapping queryString to RPC method parameters
@Remotable
public interface Echo {
String echo(@QueryParam("msg") String msg);
int echoInt(int param);
boolean echoBoolean(boolean param);
String [] echoArrayString(@QueryParam("msgArray") String[] stringArray);
int [] echoArrayInt(int[] intArray);
}
IBM Software Group
22
http://tuscany.apache.org
Design note
•  As of today, we have a special path to handle the RPC over HTTP
GET in the REST binding runtime (operationSelector.rpc). Potentially,
we can unify this approach with the runtime design that implements the
logic for Use case #1.
-  Imaging that you are writing a JAX-RS resource method that supports the
RPC style (GET with a list of query parameters, one of them is the
“method”)
•  For a service method that is not annotated with JAX-RS http method
annotations, we will generate a JAX-RS resource class with a mapping
so that:
-  @GET
-  @Path
-  @QueryParam for each of the arguments
IBM Software Group
23
http://tuscany.apache.org
Use Case #3:
Access external RESTful services using SCA
•  We want to access external RESTful services from an SCA component
using SCA references (w/ dependency injection) instead of calling
technology APIs such as HTTP client
IBM Software Group
24
http://tuscany.apache.org
Tuscany SCA client programming model for JAX-RS
•  Model as an SCA reference configured with binding.rest in the client
component
•  Use a JAX-RS annotated interface to describe the outbound HTTP
invocations (please note we use the same way to handle inbound
HTTP invocations for RESTful services exposed by SCA)
•  A proxy is created by Tuscany to dispatch the outbound invocation per
the metadata provided by the JAX-RS annotations (such as Path for
URI, @GET for HTTP methods, @QueryParam for parameters, etc).
-  If no HTTP method is mapped, we use the RPC over HTTP GET
IBM Software Group
25
http://tuscany.apache.org
Sample configuration
•  To invoke a RESTful resource such as getPhotoById(String id):
@GET
@Path(“/photos/{id}”)
InputStream getPhotoById(@PathParam(“id”) String id);
•  SCA Reference
<reference name=“photoService”>
<interface.java interface=“…”/>
<tuscany:binding.rest uri=“http://example.com/”/>
</reference>
IBM Software Group
26
http://tuscany.apache.org
REST reference binding runtime architecture
IBM Software Group
27
http://tuscany.apache.org
Use case #4:
Drop in a JAX-RS application into SCA
•  We already have a JAX-RS application that is written following JAX-RS
programming model (to take full advantage of JAX-RS for the HTTP
protocol beyond just business logic).
•  We want to encapsulate it as an SCA component so that it can be used
in the SCA composite application. (Potentially be able to use SCA
@Reference or @Property to inject service providers or property
values).
IBM Software Group
28
http://tuscany.apache.org
Tuscany implemention.jaxrs
•  Tuscany introduced an implementation type (under tuscany
namespace) to provide out-of-box support for component using JAX-
RS
IBM Software Group
29
http://tuscany.apache.org
implementation.jaxrs runtime archirecture
•  Each root resource is translated into an SCA service with binding.rest
IBM Software Group
30
http://tuscany.apache.org
Sample configuration for implementation.jaxrs
•  Composite
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
targetNamespace="http://sample/jaxrs"
name="HelloWorld">
<component name="HelloWorldApp">
<tuscany:implementation.jaxrs application="helloworld.jaxrs.HelloWorldApp"/>
</component>
</composite>
HelloWorldApp
IBM Software Group
31
http://tuscany.apache.org
Summary
IBM Software Group
32
http://tuscany.apache.org
Summary
•  What do we support today ?
-  Expose SCA Services as RESTFul services
-  Expose RPC SCA Services via HTTP
-  Declaratively configure RESTFul services
•  Cache Controls Headers and general HTTP Headers
-  Consume RESTFul services as SCA References
-  Re-use JAX-RS Resources into your composite applications
IBM Software Group
33
http://tuscany.apache.org
What’s Next ?
IBM Software Group
34
http://tuscany.apache.org
What’s next ?
•  What’s on my “next” todo list ?
-  WADL Support via service endpoint ?wadl
-  Support for partial response and partial updates
•  What’s on yours ?
-  Submit your suggestions to our user / development list
IBM Software Group
35
http://tuscany.apache.org
Getting Involved
IBM Software Group
36
http://tuscany.apache.org
Resources
 Apache Tuscany
  http://tuscany.apache.org
 Getting Involved
  http://tuscany.apache.org/getting-involved.html
 Tuscany SCA Java Releases
  http://tuscany.apache.org/sca-java-2x-releases.html
 Tuscany SCA Java Documentation
  http://tuscany.apache.org/java-sca-documentation-menu.html
 Apache Wink
  http://incubator.apache.org/wink
 Getting Involved
  http://incubator.apache.org/wink/community.html
 Apache Wink Downloads
  http://incubator.apache.org/wink/downloads.html
IBM Software Group
37
http://tuscany.apache.org
Thank You !!!

More Related Content

What's hot

Hive ACID Apache BigData 2016
Hive ACID Apache BigData 2016Hive ACID Apache BigData 2016
Hive ACID Apache BigData 2016alanfgates
 
Connecting Apache Kafka With Mule ESB
Connecting Apache Kafka With Mule ESBConnecting Apache Kafka With Mule ESB
Connecting Apache Kafka With Mule ESBJitendra Bafna
 
Muhammad Hameed Chaudhry
Muhammad Hameed ChaudhryMuhammad Hameed Chaudhry
Muhammad Hameed ChaudhryAamir Chaudhry
 
Ubicity pure tosca orchestration 2021-04-28
Ubicity pure tosca orchestration 2021-04-28Ubicity pure tosca orchestration 2021-04-28
Ubicity pure tosca orchestration 2021-04-28Chris Lauwers
 
Hive2.0 big dataspain-nov-2016
Hive2.0 big dataspain-nov-2016Hive2.0 big dataspain-nov-2016
Hive2.0 big dataspain-nov-2016alanfgates
 
Apache Falcon - Simplifying Managing Data Jobs on Hadoop
Apache Falcon - Simplifying Managing Data Jobs on HadoopApache Falcon - Simplifying Managing Data Jobs on Hadoop
Apache Falcon - Simplifying Managing Data Jobs on HadoopDataWorks Summit
 
Node.js in SAP HANA SPS11
Node.js in SAP HANA SPS11Node.js in SAP HANA SPS11
Node.js in SAP HANA SPS11Jan Penninkhof
 
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...Trieu Nguyen
 
Autoconfig r12
Autoconfig r12Autoconfig r12
Autoconfig r12techDBA
 
Kafka and Kafka Streams Intro at iwomm in London
Kafka and Kafka Streams Intro at iwomm in LondonKafka and Kafka Streams Intro at iwomm in London
Kafka and Kafka Streams Intro at iwomm in LondonErik Schmiegelow
 
Spark and scala reference architecture
Spark and scala reference architectureSpark and scala reference architecture
Spark and scala reference architectureAdrian Tanase
 
De-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerDe-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerJosh Elser
 

What's hot (18)

Hive ACID Apache BigData 2016
Hive ACID Apache BigData 2016Hive ACID Apache BigData 2016
Hive ACID Apache BigData 2016
 
8i r3 nfs
8i r3 nfs8i r3 nfs
8i r3 nfs
 
Apache Kafka - Strakin Technologies Pvt Ltd
Apache Kafka - Strakin Technologies Pvt LtdApache Kafka - Strakin Technologies Pvt Ltd
Apache Kafka - Strakin Technologies Pvt Ltd
 
Connecting Apache Kafka With Mule ESB
Connecting Apache Kafka With Mule ESBConnecting Apache Kafka With Mule ESB
Connecting Apache Kafka With Mule ESB
 
Muhammad Hameed Chaudhry
Muhammad Hameed ChaudhryMuhammad Hameed Chaudhry
Muhammad Hameed Chaudhry
 
Ubicity pure tosca orchestration 2021-04-28
Ubicity pure tosca orchestration 2021-04-28Ubicity pure tosca orchestration 2021-04-28
Ubicity pure tosca orchestration 2021-04-28
 
Hive2.0 big dataspain-nov-2016
Hive2.0 big dataspain-nov-2016Hive2.0 big dataspain-nov-2016
Hive2.0 big dataspain-nov-2016
 
Apache Falcon - Simplifying Managing Data Jobs on Hadoop
Apache Falcon - Simplifying Managing Data Jobs on HadoopApache Falcon - Simplifying Managing Data Jobs on Hadoop
Apache Falcon - Simplifying Managing Data Jobs on Hadoop
 
Node.js in SAP HANA SPS11
Node.js in SAP HANA SPS11Node.js in SAP HANA SPS11
Node.js in SAP HANA SPS11
 
Oracle API Gateway Installation
Oracle API Gateway InstallationOracle API Gateway Installation
Oracle API Gateway Installation
 
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...Apache Phoenix with Actor Model (Akka.io)  for real-time Big Data Programming...
Apache Phoenix with Actor Model (Akka.io) for real-time Big Data Programming...
 
Autoconfig r12
Autoconfig r12Autoconfig r12
Autoconfig r12
 
What is LAMP?
What is LAMP?What is LAMP?
What is LAMP?
 
Kafka and Kafka Streams Intro at iwomm in London
Kafka and Kafka Streams Intro at iwomm in LondonKafka and Kafka Streams Intro at iwomm in London
Kafka and Kafka Streams Intro at iwomm in London
 
Mule connectors-session1
Mule connectors-session1Mule connectors-session1
Mule connectors-session1
 
Spark and scala reference architecture
Spark and scala reference architectureSpark and scala reference architecture
Spark and scala reference architecture
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
De-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerDe-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServer
 

Viewers also liked

S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyLuciano Resende
 
Building Asynchronous Services With Sca
Building Asynchronous Services With ScaBuilding Asynchronous Services With Sca
Building Asynchronous Services With ScaLuciano Resende
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The FactLuciano Resende
 
How mentoring programs can help newcomers get started with open source
How mentoring programs can help newcomers get started with open sourceHow mentoring programs can help newcomers get started with open source
How mentoring programs can help newcomers get started with open sourceLuciano Resende
 
Building apps with tuscany
Building apps with tuscanyBuilding apps with tuscany
Building apps with tuscanyLuciano Resende
 
Data access layer and schema definitions
Data access layer and schema definitionsData access layer and schema definitions
Data access layer and schema definitionsLuciano Resende
 
Luciano Resende's keynote at Apache big data conference
Luciano Resende's keynote at Apache big data conferenceLuciano Resende's keynote at Apache big data conference
Luciano Resende's keynote at Apache big data conferenceLuciano Resende
 
How mentoring can help you start contributing to open source
How mentoring can help you start contributing to open sourceHow mentoring can help you start contributing to open source
How mentoring can help you start contributing to open sourceLuciano Resende
 
Writing Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache BahirWriting Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache BahirLuciano Resende
 
SystemML - Declarative Machine Learning
SystemML - Declarative Machine LearningSystemML - Declarative Machine Learning
SystemML - Declarative Machine LearningLuciano Resende
 

Viewers also liked (11)

S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
 
Building Asynchronous Services With Sca
Building Asynchronous Services With ScaBuilding Asynchronous Services With Sca
Building Asynchronous Services With Sca
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
 
How mentoring programs can help newcomers get started with open source
How mentoring programs can help newcomers get started with open sourceHow mentoring programs can help newcomers get started with open source
How mentoring programs can help newcomers get started with open source
 
SCA Reaches the Cloud
SCA Reaches the CloudSCA Reaches the Cloud
SCA Reaches the Cloud
 
Building apps with tuscany
Building apps with tuscanyBuilding apps with tuscany
Building apps with tuscany
 
Data access layer and schema definitions
Data access layer and schema definitionsData access layer and schema definitions
Data access layer and schema definitions
 
Luciano Resende's keynote at Apache big data conference
Luciano Resende's keynote at Apache big data conferenceLuciano Resende's keynote at Apache big data conference
Luciano Resende's keynote at Apache big data conference
 
How mentoring can help you start contributing to open source
How mentoring can help you start contributing to open sourceHow mentoring can help you start contributing to open source
How mentoring can help you start contributing to open source
 
Writing Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache BahirWriting Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache Bahir
 
SystemML - Declarative Machine Learning
SystemML - Declarative Machine LearningSystemML - Declarative Machine Learning
SystemML - Declarative Machine Learning
 

Similar to Building RESTful services using SCA and JAX-RS

RESTful SCA with Apache Tuscany
RESTful SCA with Apache TuscanyRESTful SCA with Apache Tuscany
RESTful SCA with Apache TuscanyRaymond Feng
 
Building REST API using Akka HTTP with Scala
Building REST API using Akka HTTP with ScalaBuilding REST API using Akka HTTP with Scala
Building REST API using Akka HTTP with ScalaKnoldus Inc.
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyAndrew Coleman
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaSolutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaGuido Schmutz
 
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)Kai Wähner
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaMax Alexejev
 
Web Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC ProjectWeb Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC ProjectSaltlux Inc.
 
Apache Stratos Hangout VI
Apache Stratos Hangout VIApache Stratos Hangout VI
Apache Stratos Hangout VIpradeepfn
 
Create Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integrationCreate Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integrationRutul Shah
 
Stratos Grouping
Stratos GroupingStratos Grouping
Stratos GroupingWSO2
 
ApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA RuntimesApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA RuntimesJean-Sebastien Delfino
 
Orchestration service v2
Orchestration service v2Orchestration service v2
Orchestration service v2Raman Gupta
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyJean-Sebastien Delfino
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Cask Data
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfLuca Mattia Ferrari
 

Similar to Building RESTful services using SCA and JAX-RS (20)

RESTful SCA with Apache Tuscany
RESTful SCA with Apache TuscanyRESTful SCA with Apache Tuscany
RESTful SCA with Apache Tuscany
 
Building REST API using Akka HTTP with Scala
Building REST API using Akka HTTP with ScalaBuilding REST API using Akka HTTP with Scala
Building REST API using Akka HTTP with Scala
 
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economy
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaSolutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
 
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
 
Web Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC ProjectWeb Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC Project
 
Apache Stratos Hangout VI
Apache Stratos Hangout VIApache Stratos Hangout VI
Apache Stratos Hangout VI
 
Create Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integrationCreate Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integration
 
SynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax DevelopmentSynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax Development
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
SCDJWS 6. REST JAX-P
SCDJWS 6. REST  JAX-PSCDJWS 6. REST  JAX-P
SCDJWS 6. REST JAX-P
 
Stratos Grouping
Stratos GroupingStratos Grouping
Stratos Grouping
 
ApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA RuntimesApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
 
Orchestration service v2
Orchestration service v2Orchestration service v2
Orchestration service v2
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?
 
Java one2013
Java one2013Java one2013
Java one2013
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdf
 

More from Luciano Resende

A Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdfA Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdfLuciano Resende
 
Using Elyra for COVID-19 Analytics
Using Elyra for COVID-19 AnalyticsUsing Elyra for COVID-19 Analytics
Using Elyra for COVID-19 AnalyticsLuciano Resende
 
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Luciano Resende
 
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...Luciano Resende
 
Ai pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksAi pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksLuciano Resende
 
Strata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise GatewayStrata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise GatewayLuciano Resende
 
Scaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloadsScaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloadsLuciano Resende
 
Jupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway OverviewJupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway OverviewLuciano Resende
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeLuciano Resende
 
IoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache BahirIoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache BahirLuciano Resende
 
Getting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache BahirGetting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache BahirLuciano Resende
 
Open Source AI - News and examples
Open Source AI - News and examplesOpen Source AI - News and examples
Open Source AI - News and examplesLuciano Resende
 
Building analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernelsBuilding analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernelsLuciano Resende
 
Building iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache BahirBuilding iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache BahirLuciano Resende
 
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache SparkAn Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache SparkLuciano Resende
 
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017Luciano Resende
 
What's new in Apache SystemML - Declarative Machine Learning
What's new in Apache SystemML  - Declarative Machine LearningWhat's new in Apache SystemML  - Declarative Machine Learning
What's new in Apache SystemML - Declarative Machine LearningLuciano Resende
 
Big analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel GatewayBig analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel GatewayLuciano Resende
 
Jupyter con meetup extended jupyter kernel gateway
Jupyter con meetup   extended jupyter kernel gatewayJupyter con meetup   extended jupyter kernel gateway
Jupyter con meetup extended jupyter kernel gatewayLuciano Resende
 

More from Luciano Resende (20)

A Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdfA Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdf
 
Using Elyra for COVID-19 Analytics
Using Elyra for COVID-19 AnalyticsUsing Elyra for COVID-19 Analytics
Using Elyra for COVID-19 Analytics
 
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
 
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
 
Ai pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksAi pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooks
 
Strata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise GatewayStrata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise Gateway
 
Scaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloadsScaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloads
 
Jupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway OverviewJupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway Overview
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for Code
 
IoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache BahirIoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache Bahir
 
Getting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache BahirGetting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache Bahir
 
Open Source AI - News and examples
Open Source AI - News and examplesOpen Source AI - News and examples
Open Source AI - News and examples
 
Building analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernelsBuilding analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernels
 
Building iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache BahirBuilding iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache Bahir
 
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache SparkAn Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
 
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
 
What's new in Apache SystemML - Declarative Machine Learning
What's new in Apache SystemML  - Declarative Machine LearningWhat's new in Apache SystemML  - Declarative Machine Learning
What's new in Apache SystemML - Declarative Machine Learning
 
Big analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel GatewayBig analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel Gateway
 
Jupyter con meetup extended jupyter kernel gateway
Jupyter con meetup   extended jupyter kernel gatewayJupyter con meetup   extended jupyter kernel gateway
Jupyter con meetup extended jupyter kernel gateway
 
Asf icfoss-mentoring
Asf icfoss-mentoringAsf icfoss-mentoring
Asf icfoss-mentoring
 

Building RESTful services using SCA and JAX-RS

  • 1. IBM Software Group 1 http://tuscany.apache.org RESTful SCA with Apache Tuscany Luciano Resende lresende@apache.org http://lresende.blogspot.com Jean-Sebastien Delfino jsdelfino@apache.org http://jsdelfino.blogspot.com
  • 2. IBM Software Group 2 http://tuscany.apache.org Agenda •  What is Apache Tuscany •  What is Apache Wink •  RESTFul SCA Overview •  Usage and architecture walk-through -  Including a look at various scenarios •  What’s next •  Getting involved
  • 4. IBM Software Group 4 http://tuscany.apache.org Apache Tuscany •  Apache Tuscany provides a component based programming model which simplifies development, assembly and deployment and management of composite applications. •  Apache Tuscany implements SCA standards defined by OASIS OpenCSA and extensions based on real user feedback. 4
  • 5. IBM Software Group 5 http://tuscany.apache.org Building Applications using SCA •  Business functions are defined as SCA Components –  That expose services -  Using different communication protocols (bindings) –  And have dependencies on other services through References Store Catalog Currency Converter http currencyCode=USD Fruit Catalog ShoppingCart atom jsonrpc Collection Total
  • 6. IBM Software Group 6 http://tuscany.apache.org SCA Overview Composite A Component AService Service Binding Web Service JMS SLSB Rest JSONRPC JCA … Reference Binding Web Service JMS SLSB Rest JSONRPC JCA … Component B Service Interface - Java - WSDL Reference Interface Reference property setting Property promotepromote wire Implementation Java BPEL PHP SCA composite Spring EJB module … - Java - WSDL
  • 8. IBM Software Group 8 http://tuscany.apache.org Apache Wink •  Apache Wink is a simple yet solid open source framework for building RESTful Web services. It is comprised of a Server module and a Client module for developing and consuming RESTful Web services. •  The Wink Server module is a complete implementation of the JAX-RS v1.0 specification. On top of this implementation, the Wink Server module provides a set of additional features that were designed to facilitate the development of RESTful Web services. •  The Wink Client module is a Java based framework that provides functionality for communicating with RESTful Web services. The framework is built on top of the JDK HttpURLConnection and adds essential features that facilitate the development of such client applications.
  • 10. IBM Software Group 10 http://tuscany.apache.org REST-related user stories •  As a developer, I want to expose new or existing services over HTTP in REST styles with the flexibility to use different wire formats including (but not limited to) JSON, XML. •  As a developer, I want to allow RPC services to be accessed via HTTP GET method in REST styles to take advantage of HTTP caching. •  As a developer, I want to configure a service exposed using REST to use different cache control mechanisms to maximize performance of static resources and or cache dynamic content. •  As a developer, I want to invoke existing RESTful services via a business interface without dealing with the HTTP client APIs. •  As a developer, I want to compose services (both RESTful and non- RESTful) into a solution using SCA. November 4, 2010
  • 11. IBM Software Group 11 http://tuscany.apache.org A win-win situation using SCA and JAX-RS •  SCA gives us the power to declare, configure and compose services in a technology neutral fashion. •  REST is an important aspect of the Web 2.0 world. Building RESTful services can be a challenge as REST is just an architectural style. JAX-RS emerges as the standard REST programming model. •  A balanced middle-ground to leverage the power of declarative services using SCA and annotation based REST/HTTP mapping using JAX-RS (without tying business logic to the technology specifics) (try to avoid JAX-RS APIs directly).
  • 12. IBM Software Group 12 http://tuscany.apache.org Tuscany’s offerings for REST •  The Tuscany Java SCA runtime provides the integration with REST services out of the box via several extensions. -  Tuscany REST binding type (binding.rest) •  Leverage JAX-RS annotations to map business operations to HTTP operations such as POST, GET, PUT and DELETE to provide a REST view to SCA services. •  Support RPC over HTTP GET •  Allow SCA components to invoke existing RESTful services via a JAX-RS annotated interfaces without messing around HTTP clients. -  Tuscany JAX-RS implementation type (implementation.jaxrs) •  JAX-RS applications and resources can be dropped into the SCA assembly as JAX-RS implementation (implementation.jaxrs). -  Tuscany also enrich the JAX-RS runtime with more databindings to provide support for data representations and transformation without the interventions from application code.
  • 13. IBM Software Group 13 http://tuscany.apache.org Runtime overview •  Related Tuscany modules -  interface-java-jaxrs (Introspection of JAX-RS annotated interfaces) -  binding-rest (binding.rest XML/Java model) -  binding-rest-runtime (runtime provider) -  implementation-jaxrs (implementation.jaxrs XML/Java model) -  implementation-jaxrs-runtime (runtime provider) •  Tuscany uses Apache Wink 1.1.1-incubating as the JAX-RS runtime -  Contributions were made to the Wink runtime to facilitate embedding Wink and it’s going to be available in Wink 1.1.2 which should be available in the near future
  • 15. IBM Software Group 15 http://tuscany.apache.org Use Case #1: Exposing an SCA service to HTTP using REST •  We have an existing SCA service and want to make it RESTful 1.  Define a Java interface with JAX-RS annotations •  Provide URI •  Map between business operations and HTTP methods •  Map Input/Output (Path segments, query parameters, headers, etc) •  Configure wire formats 2.  Each method should have a compatible operation in the SCA service
  • 16. IBM Software Group 16 http://tuscany.apache.org REST Services •  Supports exposing existing SCA components as RESTFul services •  Exposing a service as RESTful resource •  Consuming REST Services - Multiple JavaScript frameworks such as Dojo (XHR) - Regular Web browsers - Regular utilities such as cUrl, wGet, etc - SCA component <component name=”Catalog"> <implementation.java class="services.FruitsCataloglmpl" /> <service name=”Catalog"> <t:binding.rest uri="http://localhost:8080/Cartalog" > <t:wireFormat.json /> <t:operationSelector.jaxrs /> </t:binding.rest> </service> </component> Fruit Catalog json
  • 17. IBM Software Group 17 http://tuscany.apache.org Mapping business interfaces using JAX-RS @Remotable public interface Catalog{ @GET Item[] getItem(); @GET @Path("{id}") Item getItemById(@PathParam("id") String itemId); @POST void addItem(Item item); @PUT void updateItem(Item item); @DELETE @Path("{id}") void deleteItem(@PathParam("id") String itemId); }
  • 18. IBM Software Group 18 http://tuscany.apache.org REST service binding runtime architecture
  • 19. IBM Software Group 19 http://tuscany.apache.org Use Case #2: Allowing HTTP GET access to an SCA RPC service •  We have an existing RPC SCA service and want to allow remote accesses using HTTP GET -  No standard JAX-RS client is defined by the JAX-RS spec -  We need to figure the URI, parameter passing (positional or name/value pairs, headers, etc)
  • 20. IBM Software Group 20 http://tuscany.apache.org RPC Services over HTTP GET •  The REST binding provides mapping your RPC style calls over HTTP GET •  Exposing a service as RESTful resource •  Client Invocation - http://localhost:8085/EchoService?method=echo&msg=Hello RPC - http://localhost:8085/EchoService? method=echoArrayString&msgArray=Hello RPC1&msgArray=Hello RPC2" <component name=”Catalog"> <implementation.java class="services.FruitsCataloglmpl" /> <service name=”Catalog"> <t:binding.rest uri="http://localhost:8080/Cartalog" /> <t:wireFormat.json /> <t:operationSelector.rpc /> </t:binding.rest> </service> </component> Fruit Catalog json
  • 21. IBM Software Group 21 http://tuscany.apache.org Mapping queryString to RPC method parameters @Remotable public interface Echo { String echo(@QueryParam("msg") String msg); int echoInt(int param); boolean echoBoolean(boolean param); String [] echoArrayString(@QueryParam("msgArray") String[] stringArray); int [] echoArrayInt(int[] intArray); }
  • 22. IBM Software Group 22 http://tuscany.apache.org Design note •  As of today, we have a special path to handle the RPC over HTTP GET in the REST binding runtime (operationSelector.rpc). Potentially, we can unify this approach with the runtime design that implements the logic for Use case #1. -  Imaging that you are writing a JAX-RS resource method that supports the RPC style (GET with a list of query parameters, one of them is the “method”) •  For a service method that is not annotated with JAX-RS http method annotations, we will generate a JAX-RS resource class with a mapping so that: -  @GET -  @Path -  @QueryParam for each of the arguments
  • 23. IBM Software Group 23 http://tuscany.apache.org Use Case #3: Access external RESTful services using SCA •  We want to access external RESTful services from an SCA component using SCA references (w/ dependency injection) instead of calling technology APIs such as HTTP client
  • 24. IBM Software Group 24 http://tuscany.apache.org Tuscany SCA client programming model for JAX-RS •  Model as an SCA reference configured with binding.rest in the client component •  Use a JAX-RS annotated interface to describe the outbound HTTP invocations (please note we use the same way to handle inbound HTTP invocations for RESTful services exposed by SCA) •  A proxy is created by Tuscany to dispatch the outbound invocation per the metadata provided by the JAX-RS annotations (such as Path for URI, @GET for HTTP methods, @QueryParam for parameters, etc). -  If no HTTP method is mapped, we use the RPC over HTTP GET
  • 25. IBM Software Group 25 http://tuscany.apache.org Sample configuration •  To invoke a RESTful resource such as getPhotoById(String id): @GET @Path(“/photos/{id}”) InputStream getPhotoById(@PathParam(“id”) String id); •  SCA Reference <reference name=“photoService”> <interface.java interface=“…”/> <tuscany:binding.rest uri=“http://example.com/”/> </reference>
  • 26. IBM Software Group 26 http://tuscany.apache.org REST reference binding runtime architecture
  • 27. IBM Software Group 27 http://tuscany.apache.org Use case #4: Drop in a JAX-RS application into SCA •  We already have a JAX-RS application that is written following JAX-RS programming model (to take full advantage of JAX-RS for the HTTP protocol beyond just business logic). •  We want to encapsulate it as an SCA component so that it can be used in the SCA composite application. (Potentially be able to use SCA @Reference or @Property to inject service providers or property values).
  • 28. IBM Software Group 28 http://tuscany.apache.org Tuscany implemention.jaxrs •  Tuscany introduced an implementation type (under tuscany namespace) to provide out-of-box support for component using JAX- RS
  • 29. IBM Software Group 29 http://tuscany.apache.org implementation.jaxrs runtime archirecture •  Each root resource is translated into an SCA service with binding.rest
  • 30. IBM Software Group 30 http://tuscany.apache.org Sample configuration for implementation.jaxrs •  Composite <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" targetNamespace="http://sample/jaxrs" name="HelloWorld"> <component name="HelloWorldApp"> <tuscany:implementation.jaxrs application="helloworld.jaxrs.HelloWorldApp"/> </component> </composite> HelloWorldApp
  • 32. IBM Software Group 32 http://tuscany.apache.org Summary •  What do we support today ? -  Expose SCA Services as RESTFul services -  Expose RPC SCA Services via HTTP -  Declaratively configure RESTFul services •  Cache Controls Headers and general HTTP Headers -  Consume RESTFul services as SCA References -  Re-use JAX-RS Resources into your composite applications
  • 34. IBM Software Group 34 http://tuscany.apache.org What’s next ? •  What’s on my “next” todo list ? -  WADL Support via service endpoint ?wadl -  Support for partial response and partial updates •  What’s on yours ? -  Submit your suggestions to our user / development list
  • 36. IBM Software Group 36 http://tuscany.apache.org Resources  Apache Tuscany   http://tuscany.apache.org  Getting Involved   http://tuscany.apache.org/getting-involved.html  Tuscany SCA Java Releases   http://tuscany.apache.org/sca-java-2x-releases.html  Tuscany SCA Java Documentation   http://tuscany.apache.org/java-sca-documentation-menu.html  Apache Wink   http://incubator.apache.org/wink  Getting Involved   http://incubator.apache.org/wink/community.html  Apache Wink Downloads   http://incubator.apache.org/wink/downloads.html