Please login or register to access secure site features.

Note: By continuing to use DevConnect Program Services you agree to our latest Registered Member Terms.

Sign in using DevConnect ID

Forgot password?

Trouble logging in?

Submit a ticket for Registration Support.

I have an SSO ID

?
sign in

Don't have a DevConnect or SSO ID ?

Create a DevConnect account or join the program.

register now
^
Forum Index » Avaya Orchestration Designer » execute json post request receiving exception   XML
 
Author Message
IdanBen-Shlush3



Joined: 10/11/2010 02:17:25
Messages: 37
Offline

Hi,

When execute HttpResponse response = httpclient.execute(request); from orchestration designer simulator at my pc (version 7.0.1.0804) to customer web service working fine and getting data information
when deploying project to tomcat application server (version 7.0.55) and making test getting the following exception:

javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at flow.GetReportDetails_WS.servletImplementation(GetReportDetails_WS.java:112)
at com.avaya.sce.runtime.BasicServlet.handleRequest(BasicServlet.java:99)
at com.avaya.sce.runtime.AppServlet.processRequest(AppServlet.java:96)
at com.avaya.sce.runtime.SCEServlet.requestHandler(SCEServlet.java:285)
at com.avaya.sce.runtime.SCEServlet.doPost(SCEServlet.java:190)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at com.avaya.sce.runtime.SCEServlet.forward(SCEServlet.java:1364)
at com.avaya.sce.runtime.Data.evaluateActions(Data.java:211)
at flow.SetWSParams.executeDataActions(SetWSParams.java:83)
at com.avaya.sce.runtime.Data.handleRequest(Data.java:104)
at com.avaya.sce.runtime.AppServlet.processRequest(AppServlet.java:96)
at com.avaya.sce.runtime.SCEServlet.requestHandler(SCEServlet.java:285)
at com.avaya.sce.runtime.SCEServlet.doPost(SCEServlet.java:190)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at com.avaya.sce.runtime.SCEServlet.forward(SCEServlet.java:1364)
at com.avaya.sce.runtime.Data.handleRequest(Data.java:153)
at com.avaya.sce.runtime.AppServlet.processRequest(AppServlet.java:96)
at com.avaya.sce.runtime.SCEServlet.requestHandler(SCEServlet.java:285)
at com.avaya.sce.runtime.SCEServlet.doPost(SCEServlet.java:190)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)


the following is servlet code for your review:


public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {

IVariableField incoming_number = mySession.getVariableField(IProjectVariables.CALLED__NUM);
IVariableField reportNumber = mySession.getVariableField(IProjectVariables.REPORT__NUM);
IVariableField retCode = mySession.getVariableField(IProjectVariables.RET__CODE);

// System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
try {
System.out.println("GetReportDetails_WS , Before SSLContext");
SSLContext sslContext = null;
try {
sslContext = SSLContext.getInstance("TLSv1.2");
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
sslContext.init(null, null, null);
} catch (KeyManagementException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SSLContext.setDefault(sslContext);

CloseableHttpClient httpclient = HttpClientBuilder
.create()
.build();

System.out.println("GetReportDetails_WS , SET HttpPost request");
HttpPost request = new HttpPost("https://pay24.co.il/WCF/RestIvr/RestIvrService.svc/GetReportDetails");


//String bodyContent = "{\"IncomingNumber\":\"0747642910\", \"ReportNumber\":\"109\"}";
String bodyContent = "{\"IncomingNumber\":\"" + incoming_number.getStringValue() + "\", \"ReportNumber\":\"" + reportNumber.getStringValue() + "\"}";
System.out.println("GetReportDetails_WS , SET bodyContent == " + bodyContent);

StringEntity requestBody = new StringEntity(bodyContent);
request.setEntity(requestBody);
request.setHeader("Content-Type", "application/json");

System.out.println("GetReportDetails_WS , execute request " );

HttpResponse response = httpclient.execute(request);

System.out.println(response.getStatusLine().getStatusCode());

String responseJSON = EntityUtils.toString(response.getEntity());



if (responseJSON.isEmpty()){
retCode.setValue("0");
return;

}else{

StringTokenizer st = new StringTokenizer(responseJSON);
String key = st.nextToken("{\"");
String value = st.nextToken(":\"");
System.out.println("KEY is : " + key);
System.out.println("Value is : " + value);
retCode.setValue(value);
return;
}


} catch (ClientProtocolException e) {
System.out.println("GetReportDetails_WS , ClientProtocolException " );
e.printStackTrace();
}catch (IOException e) {
System.out.println("GetReportDetails_WS , IOException " );
e.printStackTrace();
} //finally {
// request.releaseConnection();
//}
}


I have install certificate at tomcat server also the same jar files under tomcat lib

java version install at tomcat server:
java version "1.7.0_75"
OpenJDK Runtime Environment (rhel-2.5.4.0.el6_6-x86_64 u75-b13)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

java version at orchestration designer jre1.8.0_261

any idea what might cause this issue ?

Thanks
Idan
WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3796
Offline

Java 1.7 does support TLS v1.2 well. Try Java 1.8
IdanBen-Shlush3



Joined: 10/11/2010 02:17:25
Messages: 37
Offline

H,

I have similar version developed by OD and installed at tomcat server contains same web service call to same web server which works, but unfortunately I don't have the source code to find what is wrong at my code. so I guess I don't need to change Java version at EPM.
Any other idea why it's not working ?

Thanks
Idan.
IdanBen-Shlush3



Joined: 10/11/2010 02:17:25
Messages: 37
Offline

I made some code changes based on example I found at the following web site https://www.programmersought.com/article/83981813280/
and it helped me to fix the problem.

In addition I replaced JRE Home to use jdk1.7.0_80 which is similar to what is installed at tomcat server and it works.

Thanks for the hint you gave me

Idan

This message was edited 2 times. Last update was at 10/06/2021 03:46:32

 
 
Go to: