error running bing translation api

491 views
Skip to first unread message

swapnil jadhav

unread,
Nov 8, 2012, 4:51:09 AM11/8/12
to microsoft-tran...@googlegroups.com
Can you help regarding this.
Running in eclipse.

import com.memetix.mst.language.Language;
import com.memetix.mst.translate.Translate;

public class transLate
{
    public static void main(String[] args) throws Exception
    {
        System.setProperty("http.proxyHost", "172.20.0.100");
        System.setProperty("http.proxyPort", "8080");
       
       Translate.setClientId("xxxxxxx");
       Translate.setClientSecret("xxxxxxxxxxxxxxxxxxxxx");

       String translatedText = Translate.execute("Bonjour le monde", Language.FRENCH, Language.ENGLISH);
       System.out.println("French -> English : " + translatedText);
     }
}



Error :

Exception in thread "main" java.lang.Exception: [microsoft-translator-api] Error retrieving translation : Connection timed out
    at com.memetix.mst.MicrosoftTranslatorAPI.retrieveString(MicrosoftTranslatorAPI.java:202)
    at com.memetix.mst.translate.Translate.execute(Translate.java:61)
    at smsHindiMain.main(smsHindiMain.java:15)
Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
    at java.net.Socket.connect(Socket.java:546)
    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:584)
    at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:160)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:332)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:979)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
    at com.memetix.mst.MicrosoftTranslatorAPI.getToken(MicrosoftTranslatorAPI.java:133)
    at com.memetix.mst.MicrosoftTranslatorAPI.retrieveResponse(MicrosoftTranslatorAPI.java:160)
    at com.memetix.mst.MicrosoftTranslatorAPI.retrieveString(MicrosoftTranslatorAPI.java:199)
    ... 2 more

Hert Hertus

unread,
Nov 30, 2012, 7:56:44 AM11/30/12
to microsoft-tran...@googlegroups.com
what I think, microsoft-translator-java-api doesn't use the new Azure API. (https://api.datamarket.azure.com/Bing/MicrosoftTranslator/v1/)
as some one mentioned as an "Issue" in Jul 2012: 
"I think translations over the old API will just be available until 1. August."

Reply all
Reply to author
Forward
0 new messages