Hi community,
i started to use the XS Engine today and i'm getting an error when trying to send a request to a external webservice:
"
Found the following errors:
===========================
Error: HttpClient.request: request failed. The following error occured: unable to establish connection to http://gt-systems.de:80 - internal error code: resolving DNS host name failed (line 8 position 0 in /webservice/test.xsjs)
"
For testing, i wrote a very simple script on my webserver that just returns you the value of the parameter "val".
http://gt-systems.de/test.php?val=thisisatest
First i thought the error could be caused by the cloudshare server, but when i try it on terminal with wget it works perfect:
hanacloud:/tmp/test # wget http://gt-systems.de/test.php?val=thisisatest
--2014-03-19 08:08:04-- http://gt-systems.de/test.php?val=thisisatest
Resolving gt-systems.de... 109.73.52.91
Connecting to gt-systems.de|109.73.52.91|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11 [text/html]
Saving to: `test.php?val=thisisatest'
100%[======================================>] 11 --.-K/s in 0s
2014-03-19 08:08:05 (1.40 MB/s) - `test.php?val=thisisatest' saved [11/11]
So i think there is some trouble with HANA.
At least my httpdest:
host = "http://gt-systems.de";
port = 80;
description = "test case";
useSSL = false;
pathPrefix = "/test.php";
authType = none;
useProxy = false;
proxyHost = "";
proxyPort = 0;
timeout = 0;
and xsjs:
$.response.contentType = "text/plain";
var dest = $.net.http.readDestination("webservice", "test");
var client = new $.net.http.Client();
var req = new $.web.WebRequest($.net.http.GET, "?val=bla");
client.request(req, dest);
var response = client.getResponse();
$.response.setBody(response);
So what i'm doing wrong? Thanks a lot for your help.