خرید بک لینک

Vote count: 0

I want to get XML data from the web server https://ruralfire.qld.gov.au/bushfirealert/bushfireAlert.xml

However, I can't do it because my codes always have an error "javax.net.ssl.SSLHandshakeException: Coection closed by peer".

And my InputStream is always null, so I can't do anything with it (such as parsing).

I ensure that the problem is in my coection but I don't know how to solve it.

This is my code in coecting to the web server:

private InputStream downloadUrl(String urlString) throws IOException {

    URL url;
    url = new URL(urlString);

    InputStream is = null;

    try {
        HttpsURLCoection con = (HttpsURLCoection)url.openCoection();
        is = con.getInputStream();

    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    retu is;
}

May you help me to solve this problem ?

Thank you so much.

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 12 ارديبهشت 1395 ساعت: 10:35

صفحه بندی