locked
Getting connectivity error when trying to translate

    Question

  • Hi,

    I am getting the below error when trying to connect to the MS translator via SQL server 2008:

    "Msg 6522, Level 16, State 1, Procedure spCallTranslator, Line 0

    A .NET Framework error occurred during execution of user-defined routine or aggregate "spCallTranslator":

    System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 70.37.92.127:443

    System.Net.Sockets.SocketException:

       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)

       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

    System.Net.WebException:

       at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)

       at System.Net.HttpWebRequest.GetRequestStream()

       at StoredProcedures.GetAccessToken()

       at StoredProcedures.CallTranslator(String txtToTranslate, String txtTranslationFromLanguageCode, String txtTranslationToLanguageCode)

       at StoredProcedures.spCallTranslator(String txtToTranslate, String txtTranslationFromLanguageCode, String txtTranslationToLanguageCode, String& txtTranslated)"

    Regards,

    Nilesh G

    Thursday, January 28, 2016 8:26 AM

All replies

  • Hi Nilesh,

    The IP address 70.37.92.127 is not a Microsoft Translator end point. Are you sure you have outbound connectivity to https://api.microsofttranslator.com from your SQL server?

    Did this work before, or are you developing the sp new?

    Chris Wendt
    Microsoft Translator

    Thursday, January 28, 2016 10:32 PM
  • Hi Chris,

    Was a bit busy with other priorities so could not respond.

    The above is working on my local machine. However we are getting this error when we are trying to implement the same on a network machine.

    Also we tried using the below proxy but the problem persists:

    using (WebClient wc = new WebClient())
                {
                    wc.Proxy = new WebProxy(new Uri("http://proxy:80/"), false, null, CredentialCache.DefaultCredentials);
                    wc.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36");
                    wc.DownloadFile(url, outputFile);
                }

    Any help is appreciated. 

    Thanks

    Nilesh G


    Wednesday, February 24, 2016 4:02 PM
  • Hi Nilesh,

    my suspicion is that your datacenter uses a different proxy or firewall than your local machine, which doesn't allow connections to the translator API. You could try running a standalone app on your server to see if it can connect. If nothing else, try the document translator http://github.com/microsofttranslator/documenttranslator.

    Chris Wendt
    Microsoft Translator

    Wednesday, February 24, 2016 4:13 PM
  • Thanks Chris.

    Will try the alternative.

    Regards,

    Nilesh G

    Wednesday, February 24, 2016 4:22 PM