Database Reference
In-Depth Information
....
DefaultHttpClient client = new DefaultHttpClient();
HttpGet getRequest = new HttpGet(url);
try {
HttpResponse getResponse =
client.execute(getRequest);
final int statusCode
=getResponse.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
log.error(getClass().getSimpleName(), "Error "
+ statusCode + " for URL " + url);
return null;
}
HttpEntity getResponseEntity =
getResponse.getEntity();
return getResponseEntity.getContent();
}
catch (IOException e){…}
You can expose this service using OSB now as shown in the previous screenshot. Job
done, no Protocol Bridging of Data Format Transformation required for this simple imple-
mentation.
As you can imagine, a complete enterprise-ready implementation will require a little more
effort and another common adapter-related pattern will be necessary. What we will need
to do is:
1. Implement URL Builder for constructing the REST query string accepting more
than one parameter (for example, title , List<sources> , actor , rating ,
num_hits_returned ).
2. Implement SearchObject (ABO) for every external resource/application.
3. Validate canonical SearchObject (EBO) for internal resources.
4. Implement casting of individual ABOs to the consolidated EBO.
5. Finally, expose consolidated services on ESB (OSB), for JSON and XML.
Step four signifies that the Data Model Transformation SOA pattern ( ABO->EBO ) should
be used.
Search WWH ::




Custom Search