Panel | ||
---|---|---|
On this page:
Target audience: Users of the extension providing Web services calls from Java. |
Extension ID
com.castsoftware.java.service
What's new?
See REST service call for Java - 1.0 - Release Notesfor for more information.
Description
...
Native |
|
---|---|
JAX-RS |
|
Spring |
|
Apache |
|
Vert.x |
|
okhttp |
|
Other |
|
...
Function Points (transactions) | Quality and Sizing |
---|---|
...
CAST AIP Core release | Supported |
---|---|
8.3.x |
Supported DBMS servers
...
Installation of any compatible release of CAST AIP Core (see table above) |
Dependencies with other extensions
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 AnalyzerAnalyzer 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.
Download and installation instructions
Please see:
- Download an extension
- Install an extension
...
...
Packaging, delivering and analyzing your source code
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.
...
Client side load balancing
Usage of org.springframework.cloud.client.loadbalancer.LoadBalancerClient allows to choose a service to call so impacts the URL called.:
Code Block | ||
---|---|---|
| ||
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.client.RestTemplate; import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; import org.springframework.cloud.client.ServiceInstance; import java.net.URI; class Main { @Autowired private LoadBalancerClient loadBalancerClient; void f() { RestTemplate client ; ServiceInstance serviceInstance = loadBalancerClient.choose("user-auth"); String path = serviceInstance.getUri().toString() + "/oauth/token"; client.put(path, client); } } |
...
Code Block |
---|
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); } } } |
...
- Manual creation of feign clients is not supported