Ibm mobilefirst 调用Worklight适配器http错误
我已使用此方法创建了一个适配器:Ibm mobilefirst 调用Worklight适配器http错误,ibm-mobilefirst,worklight-adapters,Ibm Mobilefirst,Worklight Adapters,我已使用此方法创建了一个适配器: function getLocation(gpsLat, gpsLong) { path = "/maps/api/geocode/json?latlng=" + gpsLat + "," + gpsLong + "&sensor=false"; var input = { method : 'get', returnedContentType : 'json', path : path }; return WL.Server.invokeHttp(in
function getLocation(gpsLat, gpsLong) {
path = "/maps/api/geocode/json?latlng=" + gpsLat + "," + gpsLong + "&sensor=false";
var input = {
method : 'get',
returnedContentType : 'json',
path : path
};
return WL.Server.invokeHttp(input);
}
适配器配置如下所示:
<displayName>GPSLocator</displayName>
<description>GPSLocator</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>maps.googleapis.com</domain>
<port>80</port>
<!-- Following properties used by adapter's key manager for choosing specific certificate from key store
<sslCertificateAlias></sslCertificateAlias>
<sslCertificatePassword></sslCertificatePassword>
-->
<proxy>
<protocol>http</protocol>
<domain>15.1.0.111</domain>
<port>8080</port>
</proxy>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
<procedure name="getLocation" />
如果我从浏览器在google maps中运行请求,例如:
然后我得到了正确的回答。所以问题是从WL呼叫它
我正在使用worklight studio 6.1
我还可以正常访问我的控制台并查看部署的应用程序,这样我的服务器就可以正常运行了
有什么建议吗?我相信这与使用以下设置运行的代理有关:
http
15.1.0.111
8080
我能够在没有代理的情况下成功运行上述适配器。您可能需要查看代理配置。此外,您的请求在适配器中通过http传输,但在您的示例地址中通过https传输:
我认为这与您使用以下设置运行的代理有关:
http
15.1.0.111
8080
我能够在没有代理的情况下成功运行上述适配器。您可能需要查看代理配置。此外,您的请求在适配器中通过http传输,但在您的示例地址中通过https传输:
确认它可以解决代理设置问题。验证这些设置。确认它可以解决代理设置问题。验证这些设置。
{
"errors": [
"Runtime: Http request failed: org.apache.http.conn.HttpHostConnectException: Connection to http:\/\/maps.googleapis.com:80 refused"
],
"info": [
],
"isSuccessful": false,
"warnings": [
]
}