Support Article

Connect-REST giving 302 server redirection exception

SA-29540

Summary



The environment here is one where two Pega frameworks are installed on a single node.

Two distinct sets of credentials define the user's access to one of two applications and rulesets. The functionality being tested is one where a Service-REST in one application is attempted to be accessed from a Connect-REST in the other application.

The Service-REST is fully functional when accessed from the network. However, the Connect-REST is failing when trying to access the service. There is no indication the service method is being triggered.


Error Messages



When testing the Data Page that is implemented with the Copnnect-REST as its data source, the following error is displayed.


 "the HTTP response code of 302 indicated a server redirection. Redirection is not enabled for this Connector. The body of the service's response, which is set up for mapping in the Connector rule, was empty for this service call."




Steps to Reproduce



1) Create service rest.
2) Create connect rest using above service rest in same pega instance.
3) Test the connect rest.


Root Cause



The user had this setup on an Apache Tomcat configuration and when examining the server.xml file in the tomcat_home/conf directory, it was observed that all http traffic hitting port 80 or 8080 was being redirected to 8443. Therefore, the webserver was detecting redirection to an  "SSL-enabled" port and refusing it. This was confirmed by executing a command line curl command to access localhost:8080.



Note: The call made from the Connect-REST is not being made from a browser. It is being made by the jvm which is executing at the same level as this curl command. Therefore, access should be configured inside the Connect-REST so an endpoint uses https://localhost:8443.

Resolution



Change Endpoint for Connect-REST  to use localhost and port 8443. This change enables the connector to succeed.

Further research was suggested for the Apache Admin in the user's environment to explore changing the configuration of the server so that this solution is not needed.
The additional layer of encryption introduced in this approach is not useful and could affect performance.

 

Published October 24, 2016 - Updated November 3, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.