title: using Microsoft Translate ( GetTranslation Service )
body: <p>I'm going to build website that uses the translation service from Microsoft. I need to get all the available translations for each word but the code I have provides only one translation while it is supposed to give all available translations. Here's the code: </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using microsofttranslator;
  using System.Text;
  using System.Net;
  using System.IO;
  using System.Runtime.Serialization.Json;
  using System.Runtime.Serialization;
  using System.ServiceModel.Channels;
  using System.ServiceModel;
  using TranslatorService;
  
  public partial class _Default : System.Web.UI.Page
  {
  protected void Page_Load(object sender, EventArgs e)
  {
  
  }
  protected void Button1_Click(object sender, EventArgs e)
  {string Appid="my Appid";
  string t="any text";
       microsofttranslator.TranslateOptions options = new      microsofttranslator.TranslateOptions();
  
      options.Category = "general";
          options.ContentType = "text/plain";
          options.User = "TestUserId";
          options.Uri = "";
      bool a=true;
      SoapService s = new SoapService();
      microsofttranslator.GetTranslationsResponse translations = s.GetTranslations(Appid, t, "ar", "en", 5,a, options);
      Response.Write(string.Format("Available translations for source text '{0}' are", t));
  
      foreach (microsofttranslator.TranslationMatch translationMatch in translations.Translations)
      {
          Response.Write(string.Format("Translated text: {0}" + Environment.NewLine + " Rating:{1}" + Environment.NewLine + "Count:{2}" + Environment.NewLine, translationMatch.TranslatedText, translationMatch.Rating.ToString(), translationMatch.Count.ToString()));
  
      } }}                
  </code></pre>
  
  <p>I added Microsft translate WSDL as a web reference <a href="http://api.microsofttranslator.com/v2/Soap.svc?wsdl" rel="nofollow">http://api.microsofttranslator.com/v2/Soap.svc?wsdl</a> and I added TranslatorService as a service reference <a href="http://api.microsofttranslator.com/V2/Soap.svc" rel="nofollow">http://api.microsofttranslator.com/V2/Soap.svc</a></p>
  
  <p>This code works well but as I said it gives only one translation while it is supposed to give all the available translations of a word. I cannot figure out what I am doing wrong.</p>