Bing Translator Web Service
Bing Translator Web Service / All Operations Resource Group / /V2/Soap.svc/TranslateArray (Method)
In This Topic
    Method/V2/Soap.svc/TranslateArray
    In This Topic
    Description
    Translates an array of text strings from one language to another.
    Request (LanguageService_TranslateArray_InputMessage)

    The request body is of type TranslateArray.

    Request Body Parameters

    NameDescriptionData Type
     xml:string
     ArrayOfstring
     xml:string
     xml:string
     TranslateOptions
    User Element Uri Element State Element ReservedFlags Element ProfanityAction Element IncludeMultipleMTAlternatives Element GenderTo Element GenderFrom Element ContentType Element Category Element Sequence options Element to Element from Element string Element Sequence texts Element appId Element Sequence TranslateArray Element

    Overview

    Sequence
    appId optional xs:string
    A string containing "Bearer" + " " + access token.
    texts optional ArrayOfstring Complex Type
    A string array representing the text from an unknown language. The size of the text must not exceed 10000 characters.
    Sequence
    string 0..∞ xs:string
    from optional xs:string
    A string containing the language code of the source language. Must be a valid culture name.
    to optional xs:string
    A string containing the language code of the target language. Must be a valid culture name.
    options optional TranslateOptions Complex Type
    A TranslateOptions element containing the values below. They are all optional and default to the most common settings.
    • Category: A string containing the category (domain) of the translation. Defaults to "general".
    • ContentType: The format of the text being translated. The supported formats are "text/plain" and "text/html". Any HTML needs to be well-formed.
    • Uri: A string containing the content location of this translation.
    • User: A string used to track the originator of the submission.
    • State: User state to help correlate request and response. The same contents will be returned in the response.
    Sequence
    Category optional xs:string
    A string containing the category (domain) of the translation. Defaults to "general".
    ContentType optional xs:string
    A string containing the type of content. Either "text/html" or "text/plain". Defaults to "text/plain".
    GenderFrom optional xs:string
    GenderTo optional xs:string
    IncludeMultipleMTAlternatives optional xs:boolean
    ProfanityAction optional xs:string
    ReservedFlags optional xs:string
    State optional xs:string
    User state to help correlate request and response. The same contents will be returned in the response.
    Uri optional xs:string
    A string containing the content location of this translation.
    User optional xs:string
    A string used to track the originator of the submission.
    Response (LanguageService_TranslateArray_OutputMessage)

    The response body is of type TranslateArrayResponse.

    A string representing the translated text. If you previously use AddTranslation or AddTranslationArray to enter a translation with a rating of 5 or higher for the same source sentence, Translate returns only the top choice that is available to your system. The "same source sentence" means the exact same (100% matching), except for capitalization, white space, tag values, and punctuation at the end of a sentence. If no rating is stored with a rating of 5 or above then the returned result will be the automatic translation by Microsoft Translator.

    Response Body Parameters

    NameDescriptionData Type
     ArrayOfTranslateArrayResponse
    TranslatedTextSentenceLengths Element TranslatedText Element State Element OriginalTextSentenceLengths Element From Element Error Element Sequence TranslateArrayResponse Element Sequence TranslateArrayResult Element Sequence TranslateArrayResponse Element

    Overview

    Sequence
    Sequence
    Sequence
    Error optional xs:string
    Indicates an error if one has occurred. Otherwise set to null.
    From optional xs:string
    A string containing the language code of the source language. Must be a valid culture name.
    OriginalTextSentenceLengths optional ArrayOfint Complex Type
    An array of integers indicating the length of each sentence in the original source text. The length of the array indicates the number of sentences.
    Sequence
    int 0..∞ xs:int
    State optional xs:string
    User state to help correlate request and response. Returns the same content as in the request.
    TranslatedText optional xs:string
    The translated text.
    TranslatedTextSentenceLengths optional ArrayOfint Complex Type
    An array of integers indicating the length of each sentence in the translated text. The length of the array indicates the number of sentences.
    Sequence
    int 0..∞ xs:int
    See Also