<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How can i call a http-session to an internet-url from ivy and to store some informations form the webpage-answer?</title><link>https://answers.axonivy.com/questions/1802/how-can-i-call-a-http-session-to-an-internet-url-from-ivy-and-to-store-some-informations-form-the-webpage-answer</link><description>&lt;p&gt;Dear all,&lt;/p&gt;
&lt;p&gt;we have the problem that the timestamp for storing in the database is the local timestamp where the database server is hosted. We need also the local time of the user request, sided all around the word.&lt;/p&gt;
&lt;p&gt;To calculate the local time of the user there is a https-api-call via Google Maps and the answer will deliver the  time zone with the off_set und the daylight saving time offset as diffenrce to UTC.&lt;/p&gt;
&lt;p&gt;For example: Today it is 2016-06-13 09:45 CEST = 07:45 UTC; the API delivers for Sydney: 36000 Seconds offset and 0 Secondes dst-offset and for Berlin 3600 Seconds offset and 3600 Seconds dst-offset; I can now calculate 
Berlin Time - 1 Hour Offset - 1 Hour DST-Offset = UTC + 10 Hours = Sidney Local Time = 17:45 &lt;/p&gt;
&lt;p&gt;&lt;a href="https://maps.googleapis.com/maps/api/timezone/xml?location=-33.510000,151.200000&amp;amp;timestamp=1696060417"&gt;https://maps.googleapis.com/maps/api/timezone/xml?location=-33.510000,151.200000&amp;amp;timestamp=1696060417&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is is possible to do this with IVY or is thera an other way to get the local time of the staff's office?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;Best regards
Dieter&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1802/how-can-i-call-a-http-session-to-an-internet-url-from-ivy-and-to-store-some-informations-form-the-webpage-answer" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 27 Jun 2016 11:56:09 -0400</lastBuildDate><item><title>Answer by Dieter Staudt</title><link>https://answers.axonivy.com/questions/1802/how-can-i-call-a-http-session-to-an-internet-url-from-ivy-and-to-store-some-informations-form-the-webpage-answer/1848</link><description>&lt;p&gt;In the meantime I found some java coding:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;String url = "https://maps.googleapis.com/maps/api/timezone/xml?location=-33.510000,151.200000&amp;amp;timestamp=1696060417"
String res = "";
int readtimeout = 10000;

try {
    java.net.URL jUrl = new java.net.URL(url);
    java.net.URLConnection jCon = jUrl.openConnection();
    jCon.setReadTimeout(readtimeout);
    java.io.InputStream ins = jCon.getInputStream();

    if (in.maxRespSize &amp;gt; 0)
    {
        int cnt = 0;
        int b = ins.read();
        while (b &amp;gt; -1 &amp;amp;&amp;amp; cnt &amp;lt; in.maxRespSize)
        {
            res += Character.toChars(b).get(0).toString();
            b = ins.read();
            cnt++;
        }
    }
}

catch (java.net.MalformedURLException e) {
    in.e.e = e.getMessage() + "#ReadTimeout="+readtimeout;
    in.e.Remark = e.stackTrace.toString();
    ivy.log.error("URLOpenStream ("+e.getClass().getName()+"):" + in.e.e + ":" + url);
}
catch (java.io.IOException e) {
    in.e.e = e.getMessage() + "#ReadTimeout="+readtimeout;
    in.e.Remark = e.stackTrace.toString();
    ivy.log.error("URLOpenStream ("+e.getClass().getName()+"):" + in.e.e + ":" + url);
    }
catch (Exception e) {
    in.e.e = e.getMessage() + "#ReadTimeout="+readtimeout;
    in.e.Remark = e.stackTrace.toString();
    ivy.log.error("URLOpenStream ("+e.getClass().getName()+"):" + in.e.e + ":" + url);
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But HTTP-Error 407 will happen -
I don't understand this, because the following parameters are in the ...\AxonIvyEngineA51\jre\lib\net.propierties-file:
http.proxyHost=xxxxxx.yyyyyy-zzzzzz.loc
http.proxyPort=8080
http.nonProxyHosts=localhost|127.&lt;em&gt;|[::1]
http.nonProxyHosts=ivy3|ivy3.thiel-logistik.loc|localhost|127.&lt;/em&gt;|[::1]&lt;/p&gt;
&lt;p&gt;Who can help me?&lt;/p&gt;
&lt;p&gt;Thank you &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dieter Staudt</dc:creator><pubDate>Mon, 27 Jun 2016 11:56:09 -0400</pubDate><guid>https://answers.axonivy.com/questions/1802/how-can-i-call-a-http-session-to-an-internet-url-from-ivy-and-to-store-some-informations-form-the-webpage-answer/1848</guid></item></channel></rss>