Trying to get the Server TMs by query fails with internal server error, if the size parameter of the query is set to a value higher than 100 (Groupshare 2020 SR 1 CU9)

Dim ServerUri As New System.Uri(ServerURL & ":" & Portnumber)
Dim TMServer As New TranslationProviderServer(ServerUri, False, Username, Password)
Dim query = New Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryQuery() With {.ResourceGroupPath = "/", .IsProject = True, .IsMain = True, .IncludeChildResourceGroups = True, .Size = 120}
Dim PagedTMs() = TMServer.GetTranslationMemoriesByQuery(query).TranslationMemories

Hi - the code above will fail with an internal server error, since the size parameter is set to a value > 100. Set it to 100 or lower, will work, but will not retrieve all TMs that are on the server.

Is this by design or is this product flaw?

Many thanks,

Tom

Parents
  • Found this to be working alright:

    Dim ServerUri As New System.Uri(ServerURL & ":" & Portnumber)
    Dim TMServer As New TranslationProviderServer(ServerUri, False, Username, Password)
    Dim queryNoOfTMs = New Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryQuery() With {.Index = 0, .ResourceGroupPath = "/", .IsProject = True, .IsMain = True, .IncludeChildResourceGroups = True, .Size = 10}
    Dim TMCount As Integer = TMServer.GetTranslationMemoriesByQuery(queryNoOfTMs).TotalEntities
    For i = 0 To TMCount - 1
    	Dim queryTMs = New Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryQuery() With {.Index = i, .ResourceGroupPath = "/", .IsProject = True, .IsMain = True, .IncludeChildResourceGroups = True, .Size = 1}
    	Dim PagedTMs() = TMServer.GetTranslationMemoriesByQuery(queryTMs).TranslationMemories
    	Dim ServerTM As String = PagedTMs(0).Name
    Next

Reply
  • Found this to be working alright:

    Dim ServerUri As New System.Uri(ServerURL & ":" & Portnumber)
    Dim TMServer As New TranslationProviderServer(ServerUri, False, Username, Password)
    Dim queryNoOfTMs = New Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryQuery() With {.Index = 0, .ResourceGroupPath = "/", .IsProject = True, .IsMain = True, .IncludeChildResourceGroups = True, .Size = 10}
    Dim TMCount As Integer = TMServer.GetTranslationMemoriesByQuery(queryNoOfTMs).TotalEntities
    For i = 0 To TMCount - 1
    	Dim queryTMs = New Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryQuery() With {.Index = i, .ResourceGroupPath = "/", .IsProject = True, .IsMain = True, .IncludeChildResourceGroups = True, .Size = 1}
    	Dim PagedTMs() = TMServer.GetTranslationMemoriesByQuery(queryTMs).TranslationMemories
    	Dim ServerTM As String = PagedTMs(0).Name
    Next

Children
No Data