0
votes

I have configured Open Weather API in API Manager (Version 1.6.0). Steps:

  • Add API
  • Name: weather
  • Context: /weather
  • Version: v1
  • Tier Availability: All
  • Transports: HTTP & HTTPS
  • Endpoint Type: HTTP endpoint Production Endpoint: http://api.openweathermap.org/data/2.5/weather

    ==> At this point, if I click "Test", I get "Invalid" error.

I still go ahead and save and publish the API.

In Store, subscribe to the API and try to run in REST Client:

  • http://localhost:8280/weather/v1
  • Authorization: xxxx

Error response is seen after a while:

<am:fault 
    xmlns:am="http://wso2.org/apimanager">
    <am:code>101503</am:code>
    <am:type>Status report</am:type>
    <am:message>Runtime Error</am:message>
    <am:description>Error connecting to the back end</am:description>
</am:fault>

Error seen on the console:

[2014-05-22 14:11:39,067] WARN - ConnectCallback Connection refused or failed f or : api.openweathermap.org/162.243.44.32:80 [2014-05-22 14:11:39,093] INFO - LogMediator STATUS = Executing default 'fault' sequence, ERROR_CODE = 101503, ERROR_MESSAGE = Error connecting to the back end

I am running the AM behind a proxy. I assume AM needs to be told to go through proxy when connecting to external URLs.

I have tried below option: When starting the server use the command:

wso2server.bat -Dhttp.proxyHost= -Dhttp.proxyPort=8085 start

With this, I am unable to login to publisher or store. When clicked on the Login prompt, nothing happens.

How to configure the proxy server in AM, so that that AM uses the proxy server to connect to external URLs?

1

1 Answers

0
votes

You can set the proxyhost and prort number in de axis2.xml file:

$WSO2APU_HOME/repository/conf/axis2/axis2.xml

Note: you must set http.proxyHost=your.internet.proxy.com, do not leave it empty