API translation import error: Object reference not set to an instance of an object.

What would be the reason of such message when importing translation objects?

"Object reference not set to an instance of an object"

Parents Reply Children
  • Hi Filip,

    As you state that it is using API to impor the topic, do you have the exact call that you use?
    Is this the DocumentObj2.5 Update call?

    Can you post a sample call that you make towards the API for reference?

    Kind Regards,


    Raf

  • Here it goes

    DocumentObjProdServiceReference.DocumentObjClient docProdClient;
    string edt = "EDTXML";
    string xmlRequiredCurrentMetadata = "";
    string xmlMetadata = "<ishfields>" +
                            "<ishfield name ='FSTATUS' level ='lng' ishvaluetype ='element'>VSTATUSTRANSLATIONINREVIEW</ishfield>" +
                            "<ishfield name ='FELUXTRANSREQUESTNUMBER'  level ='lng' ishvaluetype ='element'>%SubID%</ishfield>" +
                         "</ishfields>";
    docProdClient = new DocumentObjProdServiceReference.DocumentObjClient();
    docProdClient.ClientCredentials.UserName.UserName = config.TdUser;
    docProdClient.ClientCredentials.UserName.Password = config.TdPassword;
    using (MemoryStream ms = pdClient.downloadTarget(targetTicket))
    {
            string fileVersion = fInfo.Version;
        string xmlValues = xmlMetadata.Replace("%SubID%", submissionID);
        docClient.Update(fInfo.Guid, ref fileVersion, fInfo.TargetLocale, "", xmlValues, xmlRequiredCurrentMetadata, edt, ms.ToArray());
    }