On this page: Target audience: Users of the extension providing Web services calls from Java. |
com.castsoftware.java.service
See REST service call for Java - 1.0 - Release Notes for more information.
This extension provides support for some web services calls from Java.
Function Points (transactions) | Quality and Sizing |
---|---|
CAST AIP release | Supported |
---|---|
8.3.x |
This extension is compatible with the following DBMS servers:
CAST AIP release | CSS | Oracle | Microsoft |
---|---|---|---|
All supported releases |
Installation of any compatible release of CAST AIP (see table above) |
The REST Service Calls for Java extension requires that ≥ 1.2.8-funcrel of the JEE Analyzer is also installed and used in order to ensure the most complete set of results. This dependency with the JEE Analyzer is not automatically handled when downloading the REST Service Calls for Java extension via CAST Extension Downloader, CAST Server Manager or AIP Console, therefore you must MANUALLY download and install the JEE Analyzer before starting an analysis.
Please see:
The latest release status of this extension can be seen when downloading it from the CAST Extend server. |
Package your JEE code as described in JEE - Prepare and deliver the source code - the REST Service Calls for Java extension will be run when you perform the analysis.
This extension analyses some web services call made from Java code through some classical fluent APIs. For example with com.sun.jersey:
import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; class Main { public static void main(String[] args) { Client client = Client.create(); WebResource webResource = client .resource("http://localhost:8080/RESTfulExample/rest/json/metallica/get"); ClientResponse response = webResource.accept("application/json") .get(ClientResponse.class); } } |
API analysed:
API analysed:
API analysed:
API analysed:
org.apache.wink.client.Resource
API analysed:
The following objects are displayed in CAST Enlighten:
Icon | Description |
---|---|
Delete Resource Service | |
Get Resource Service | |
Post Resource Service | |
Put Resource Service |
None.
class MyHttpCall { void execute(String url, String method) { Client client = ClientBuilder.newClient(); WebTarget myResource = client.target(url); if (method == "GET") { String response = myResource.request(MediaType.TEXT_PLAIN).get(String.class); } else if (method == "PUT") { myResource.request(MediaType.TEXT_PLAIN).put(null); } } } |