How to setup Proxy when making outbound REST calls in a Gel script?
search cancel

How to setup Proxy when making outbound REST calls in a Gel script?

book

Article ID: 264977

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

You want to interface Clarity On-Prem with an external REST API.

However when making API call from Clarity - the response is always NULL/Blank. 

How can you enable a proxy server?

Environment

Release : 16.0.3, 16.1, 16.1.1

Resolution

Here is a partial sample that may help

  <core:new className="java.net.InetSocketAddress" var="socketAddress">
    <core:arg type="java.lang.String" value="proxy.example.com"/>
    <core:arg type="java.lang.Integer" value="80"/>
  </core:new>
  
<core:getStatic var="proxyType" className="java.net.Proxy.Type" field="HTTP"/>

<core:new className="java.net.Proxy" var="httpProxy">
  <core:arg type="java.net.Proxy.Type" value="${proxyType}"/>
  <core:arg type="java.net.InetSocketAddress" value="${socketAddress}"/>
</core:new>​

<core:new className="java.net.Proxy" var="httpProxy">
  <core:arg type="java.net.Proxy.Type" value="${proxyType}"/>
  <core:arg type="java.net.InetSocketAddress" value="${socketAddress}"/>
</core:new>​

https://community.broadcom.com/enterprisesoftware/communities/community-home/digestviewer/viewthread?GroupId=1747&MessageKey=bdb7a1ab-3343-40fb-a512-3e05510477da&CommunityKey=7f0cbca3-5f93-4d44-a369-1a8ce98f5578