Discussions

XML & Web services: Proxy setting in silverstream app server 3.7.4

  1. Proxy setting in silverstream app server 3.7.4 (1 messages)

    Hi !

    Iam running a web service deployed on SilverStream app server 3.7.4, running on my local machine. The functionality of the web service is to connect to another web application running on another (remote) machine. The network setting (for my machine) for internet connection is thru proxy.

    I have problem in running the web service. That is, on running the service, the server gives an error saying,

    -----------------------------------------------------------
    com.sssw.shr.aghttp.AgoIOException
    com.sssw.shr.aghttp.AgoHttpException: Cannot connect to server 'URL of the apps' on port 80 - server may be down or not responding.
            at com.sssw.shr.aghttp.AgoHttpServer.getConnection(AgoHttpServer.java:159)
    -----------------------------------------------------------

    My guess is, the server (service) is trying to connect to the remote application, but since it doen't know about the proxy, it's not able to connect and gives the error.

    I've done this proxy setting in weblogic, that is, in the "startWeblogic.cmd" script, the following setting should be added,
     "-Dhttp.proxyHost=hostname" and "-Dhttp.proxyPort=port" on the java command, which starts the server.

    But, Iam not sure how to implement the proxy setting in silverstream app server, the reason being Iam not able to see any start script file.

    Can anyone throw some light on this.

    Thanks alot
    AJP
  2. Hi

    SilverStream uses it's own Http Handler class and you need to bypass this if you want to use a proxy server. Easiest way to do this is to create a URL object that explicitly states that you want to use Sun's Http Handler rather than Silverstream's. You also need to set the details of the Proxy Server in the System properties.

    I think the code you need will look something like :

    <code>
          Properties prop = System.getProperties();
          prop.put("http.proxySet","true");
          prop.put("http.proxyHost",proxyServer);
          prop.put("http.proxyPort",proxyPort);

          URL url = new URL (null, theURL ,
                      new sun.net.www.protocol.http.Handler() );

    </code>

    HTH

    Andy