Clarity

 View Only
  • 1.  Gel-Set Proxy Server and port

    Posted Jul 30, 2016 10:44 AM

    Hello Champs,

     

    Has anyone tried to access to external webservice from Gel Script but through Proxy server and port as our server can only connect to internet addresses through proxy server.

     

    Any ideas on how to set proxy server in Gel while invoking the webservice?

     

    Regards,

    Karthik



  • 2.  Re: Gel-Set Proxy Server and port
    Best Answer

    Posted Jul 30, 2016 01:08 PM

    My guess is you need to add http proxy properties (assuming the tag used to call the web service is using Axis) before making the web service call.

     

    Here is an example on how to add properties to a given gel script's context system scope variable.

     

    <?xml version="1.0" encoding="UTF-8"?>
    <gel:script
        xmlns:core="jelly:core"
        xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >    
        <core:set var="newline" value='${systemScope.getProperty("line.separator");}' />
        <gel:log>Dump systemScope Variable</gel:log>
    
        <gel:log>Before Adding Proxy Properties
             ${context.getVariable('systemScope')}<!-- ${context.getVariable('systemScope').toString().replace(',', newline)} -->
        </gel:log>
    
        <core:expr value='${context.getVariable("systemScope").setProperty("http.proxySet", "true")}' />
        <core:expr value='${context.getVariable("systemScope").setProperty("http.proxyHost", "the.proxy.com")}' />
        <core:expr value='${context.getVariable("systemScope").setProperty("http.proxyPort", "8080")}' />
    
        <gel:log>After Adding Proxy Properties 
             ${context.getVariable('systemScope')}<!-- ${context.getVariable('systemScope').toString().replace(',', newline)} -->
            </gel:log>
    </gel:script>
    

     

     

    V/r,

    Gene



  • 3.  Re: Gel-Set Proxy Server and port

    Posted Aug 01, 2016 01:51 AM

    Thanks a ton Gene  !!!

     

    This worked like a charm !!