Forum Stats

  • 3,769,817 Users
  • 2,253,026 Discussions
  • 7,875,216 Comments

Discussions

Calling Restful service from BPM 11.1.1.7

3468888
3468888 Member Posts: 3

Hi , My project is running on BPM 11.1.1.7 version. We have a requirement  to call Restful service from BPM. We created a java client and calling Restful service. We followed the below two approaches , still it is not working.

1. Calling Restful from java  using the below code snippet. When I run this class directly from linux server , then it is working fine. If i deploy this class in weblogic and run it , then  i am getting SSL Handshake error. We found that restful service has  TLS with SNI enablement. Will weblogic support SNI or no ? We imported all the certs required . JDK version is jdk1.7.0.141

URL url = new URL(restful url);

URLConnection urlConnection = url.openConnection();

urlConnection.setRequestProperty("Authorization", "Basic " + authStringEnc);

InputStream is = urlConnection.getInputStream();

InputStreamReader isr = new InputStreamReader(is);

2. As the above approach is not working , then we created a shell script with Restfull service is called Curl command. And calling this shell script from java client. If i run this java client directly from linux , it is invoking shell  and curl is getting executed successfully. But when we deploy this java client on weblogic and call shell script , all statements in shell are executing except curl command.

how can we get curl executed when we call from java ?

3. Using Jersey Client : Then we tried calling using Jersey Client approach using below code snippet. This is also throwing SSL Handshake error  from weblogic , but working when ran it from linux server.

import com.sun.jersey.api.client.Client;

Client restClient = Client.create();

WebResource webResource = restClient.resource(url);

ClientResponse resp = webResource.accept("application/json").header("Authorization", "Basic " + authStringEnc).get(ClientResponse.class);

          

-------------------------

Please provide solution how to get rid off SSL handshake error or calling Curl from java client ?

Answers

This discussion has been closed.