Friday Feb 20, 2015

OSB12c: Errorhandling in REST by Martien van den Akker

clip_image002Yesterday, I had an OSB consulting day at a customer. We looked into a REST service that was to be extended with update functionality. Since calling an update service of an EIS (Enterprise Information System) can go wrong with all sorts of errors, it is important to be able to return a fault-message with the errors, jason format.
Now in OSB12c it's very apparent how you define possible fault-messages and even how the should be formatted in JSON:

In this sample case we created a more or less simple xsd for faults (dutch: fouten). To test with different fault messages we simply duplicated the 'fouten' element in the xsd to 'fouten2'. You can assign different HTTP-status codes to the different fault.
So this is configuration is pretty simple and straight forward. But it is not quite clear in the documents how you would return a specific fault within your error-handlers in the pipeline.
Internally OSB works not only 'XML'-based but actually SOAP-based. So the trick in the end is to replace the body with a soap-fault message and the selection of the REST/JSON errormessage is done based on the structure of the document in the details-section of the SOAP-Fault. In the screen above, you would define for each fault message an xsd-element and apparently it validates the soap-fault-details content against each XSD defined, and the xsd against which the detail-content is valid points to the returned fault, with the corresponding HTTP Status.

Read the complete article here

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

Thursday Feb 12, 2015

Creating a Mobile-Optimized REST API Using Oracle Service Bus by Steven Davelaar

clip_image002

Fusion Middleware A-Team architect Steven Davelaar kicks off a new series that shows you how to use Oracle Service Bus (OSB) 12c to transform SOAP-based enterprise system interfaces into a mobile-optimized REST-JSON API.  Read part 1 and Read part 2

Introduction

To build functional and performant mobile apps, the back-end data services need to be optimized for mobile consumption. RESTful web services using JSON as payload format are widely considered as the best architectural choice for integration between mobile apps and back-end systems. At the same time, most existing enterprise back-end systems provide a SOAP-based web service application programming interface (API) or proprietary file-based interfaces. In this article series we will discuss how Oracle Service Bus (OSB) 12c can be used to transform these enterprise system interfaces into a mobile-optimized REST-JSON API. This architecture layer is sometimes referred to as Mobile Oriented Architecture (MOA) or Mobile Service Oriented Architecture (MOSOA). A-Team has been working on a number of projects with OSB 12c to build this architecture layer. We will explain step-by-step how to build this layer, and we will  share tips, lessons learned and best practices we discovered along the way. In this first part we will discuss how to design the REST API.

Main Article

Design Considerations

Let’s start with the first challenge: how do you design an API that is truly optimized for mobile apps? A common pitfall is to start with the back-end web services, and take that back-end payload as a starting point. While that may limit the complexity of transformations you have to do in OSB 12c (you could even use the automated “Publish-As-REST” function on a SOAP business service) it leads to an API which is everything but optimized for mobile. This brings us to our first recommendation:

The REST API design should be driven by the mobile developer.

He (or she) is the only one who can combine all the requirements, information and knowledge required for a good design:

  • he designs and builds the various screens, knows the supported form factors and knows exactly which data should be retrieved for which screen.
  • he knows the requirements for working in offline mode, and knows how this can be supported and implemented using his mobile development tool set.
  • he is responsible for data caching strategies to optimize performance in both online and offline scenarios
  • he decides which read and write actions can be performed in a background thread not impacting the user-perceived performance.

To illustrate how the above aspects impact the design of the API, we will introduce the sample “human resources” app that we will use throughout this article series. Lets start with the three screen mockups our API should support: Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

Wednesday Oct 15, 2014

REST Enabling Oracle Fusion Sales Cloud using Java By Angelo Santagata

Oracle Fusion Sales Could (Rel7) currently has a WebServices/SOAP interface however many clients & partners are interested in accessing Oracle Fusion Sales Cloud using REST & JSON. The main difference between a SOAP service and a REST service is the “way” you get access to the data and methods you use. Whilst SOAP is very powerful, very complete and also can be quite complex perhaps over-complex. REST in comparison is rather simple and uses the http verbs (GET,POST,PUT etc) to define the operation and can be as powerful as you desire.
There are many documents on the web which discuss REST vs SOAP but in summary :

SOAP

Originally defined as Simple Object Access Protocol. A protocol specification for exchanging structured information in the implementation of Web Services in computer networks.
An envelope, which defines what is in the message and how to process it A set of encoding rules for expressing instances of application-defined datatypes And a convention for representing procedure calls and responses.
Relies on eXtensible Markup Language (XML) as its message format, and usually relies on other Application Layer protocols (most notably Remote Procedure Call (RPC) and HTTP) for message negotiation and transmission. This XML based protocol consists of three parts:

REST

RESTful web service (also called a RESTful web API) is a simple web service implemented using HTTP and the principles of REST. Such a web service can be thought about as a collection of resources. The definition of such a web service can be thought of as comprising three aspects:
The base URI for the web service, such as http://example.com/resources/
The MIME type of the data supported by the web service. This is often JSON, XML or YAML but can be any other valid MIME type.
The set of operations supported by the web service using HTTP methods (e.g., POST, GET, PUT or DELETE).

References : · http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services & · http://en.wikipedia.org/wiki/SOAP
Why would you want to use REST instead of SOAP?
There are many reasons why one would/could want to use REST instead of SOAP, one reasons is that SOAP is considered too heavy-weight for mobile applications, where payload size is critical, and also instead of XML, JSON is the preferred message format.
The JSON message format is also very appropriate when interfacing with systems that use JavaScript (such as browsers or node.js) and hence adds weight to the desire to use REST instead of SOAP for accessing Oracle Fusion Sales Cloud.
So getting to the matter at hand and getting RESTful
So enough of why REST , how does one do it for Oracle Sales Cloud (aka CRM). Thankfully this is rather straightforward, at Oracle OpenWorld 2013 you would have seen Thomas Kurian demonstrate our new Oracle SOA Suite and how it can transform a SOAP service into a REST service whilst this is excellent and incredibly productive some clients dont want to install SOA Suite soley for this purpose. Thankfully its possible to do the same using pure Java and deploy it to a cloud infrastructure, like the newly release Oracle Java Cloud Service. It is however worth noting that using SOA Suite is preferable because it accelerates the deployment tremendously and would ultimately be more "agile".
So what are the basic steps to REST enable a Fusion Sales Cloud Service?

  1. Download and install the Jersey REST libraries, we'll use these for the creation of the RESTful service
  2. Generate the SOAP Client Side Proxie(s) for Oracle Sales Cloud. In this example we're using static proxies however for a more industrialized approach Id recommend going down the dynamic proxy route, more flexible and less likely to break at runtime, however at a development cost.
  3. Create "wrapper" JAXB Objects so that you can return XML data. This is needed because the baseline SOAP clients dont have @RootElement (s) defined.
  4. Create the RESTful project and expose the services you require.
  5. Deploy to your runtime Java contain, like the Oracle Java Cloud Service
  6. Consume by your favourite client, like a mobile phone etc

For the purpose of the tutorial (in the document), I've documented step by step how you can build the above, query Oracle Fusion Sales Cloud, manage security (for development & production) and how to deploy the code to the Oracle Java Cloud. Obviously take note that this document is more of a tutorial than anything else when building your own custom REST Adaptor you would tailor it specifically to what services your client (mobile phone, javascript widget etc) requires.
Happy reading Material: Document & Template Files & Complete Solution (needs Jersey files downloadable separately)
Note : This document and source code is sample code and assumes no support from Oracle Corporation or myself. Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

Sunday Sep 14, 2014

Java Cloud Service Integration to REST Service By Jani Rautiainen

Service (JCS) provides a platform to develop and deploy business applications in the cloud. In Fusion Applications Cloud deployments customers do not have the option to deploy custom applications developed with JDeveloper to ensure the integrity and supportability of the hosted application service. Instead the custom applications can be deployed to the JCS and integrated to the Fusion Application Cloud instance.

This series of articles will go through the features of JCS, provide end-to-end examples on how to develop and deploy applications on JCS and how to integrate them with the Fusion Applications instance.
In this article a custom application integrating with REST service will be implemented. We will use REST services provided by Taleo as an example; however the same approach will work with any REST service. In this example the data from the REST service is used to populate a dynamic table.
Pre-requisites
Access to Cloud instance

In order to deploy the application access to a JCS instance is needed, a free trial JCS instance can be obtained from Oracle Cloud site. To register you will need a credit card even if the credit card will not be charged. To register simply click "Try it" and choose the "Java" option. The confirmation email will contain the connection details. See this video for example of the registration.
Once the request is processed you will be assigned 2 service instances; Java and Database. Applications deployed to the JCS must use Oracle Database Cloud Service as their underlying database. So when JCS instance is created a database instance is associated with it using a JDBC data source.
The cloud services can be monitored and managed through the web UI. For details refer to Getting Started with Oracle Cloud.

JDeveloper

JDeveloper contains Cloud specific features related to e.g. connection and deployment. To use these features download the JDeveloper from JDeveloper download site by clicking the "Download JDeveloper 11.1.1.7.1 for ADF deployment on Oracle Cloud" link, this version of JDeveloper will have the JCS integration features that will be used in this article. For versions that do not include the Cloud integration features the Oracle Java Cloud Service SDK or the JCS Java Console can be used for deployment.
For details on installing and configuring the JDeveloper refer to the installation guide
For details on SDK refer to Using the Command-Line Interface to Monitor Oracle Java Cloud Service and Using the Command-Line Interface to Manage Oracle Java Cloud Service.
Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

Tuesday Jul 22, 2014

BPM update adds Case Management Web Interface and REST APIs by Mark Nelson

Oracle has just released BPM 11.1.1.7 Bundle Patch 3 which adds the out of the box web interface for Advanced Case Management and REST APIs for working with BPM.

The patch is available from Oracle Support, it is patch number 18072286.

The Case Management interface looks a bit like this:
acm

And here is an example of using the REST API.  You can call the REST URL (GET) http://yourserver:port/bpm/services/rest/application.wadl to get details of the available services:
Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

Sunday Jun 29, 2014

SOA 11g – Create RESTful Service In Oracle SOA by Vivek Garg

There are two types of web services. SOAP and REST web services. We usually deal with SOAP web services in Oracle SOA but we can also create RESTful web services in SOA.

RESTful web services are built to work best on the Web. Representational State Transfer (REST) is an architectural style. In REST data can be transmitted over a standardized interface (such as HTTP).

This post shows how we can create RESTful web service in Oracle SOA. Follow below steps to create it. We will use below schema for this post.

First create one SOA project. In composite.xml file drag “HTTP Binding” adapter and start configure it. Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

About





Search

Archives
« May 2015
SunMonTueWedThuFriSat
     
13
23
24
25
26
27
28
29
30
31
      
Today