0

Good day! Trying to get the RightFax COM API working for us. At obj_Fax.Send();, I'm getting an error 0x80042710, and I haven't a clue why. I can't find any details online about this, hoping for some suggestions.

Error message:

System.Runtime.InteropServices.COMException (0x80042710): Invalid owner ID.

SendFax method:

    public DataPackage<FaxInfoResponse> SendFax(string faxNumber, string recipientName, byte[] data)
    {
        try
        {
            DataPackage<FaxInfoResponse> dp = new DataPackage<FaxInfoResponse>();
            if ((faxNumber.Length != 10) || (!faxNumber.All(Char.IsDigit)))
            {
                dp.ErrorId = Guid.NewGuid().ToString();
                dp.ErrorMessage = "Fax Number must consist of 10 numbers";
                dp.Data = new FaxInfoResponse();
                return dp;
            }
            RFCOMAPILib.Fax obj_Fax = (RFCOMAPILib.Fax)_server.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax);
            obj_Fax.ToFaxNumber = faxNumber;
            obj_Fax.ToName = recipientName;
            var filePath = String.Format("{0}{1}.pdf", ConfigurationManager.AppSettings["TempWriteDirectory"], faxNumber);

            using (var fStream = new FileStream(filePath, FileMode.Create))
            {
                fStream.Write(data, 0, data.Length);
            }

            obj_Fax.Attachments.Add(filePath, RFCOMAPILib.BoolType.True);
            /*********** ERROR OCCURS HERE ***********/
            obj_Fax.Send();
            /*****************************************/
            int faxHandle = obj_Fax.Handle;
            obj_Fax = _server.get_Fax(faxHandle);
            dp.ErrorMessage = "";
            dp.ErrorId = "";
            FaxInfoResponse resp = new FaxInfoResponse { FaxHandle = faxHandle, FaxStatus = obj_Fax.FaxStatus.ToString(), FaxUniqueId = obj_Fax.UniqueID.ToString() };
            dp.Data = resp;
            Log.Info("Fax successfully sent for fax: Fax Number = " + faxNumber + " Recipient Name = " + recipientName);
            return dp;
        }
        catch (Exception ex)
        {
            // Blah blah error handling
        }
    }
Thomas
  • 339
  • 4
  • 15

1 Answers1

0

To be fair, we didn't really "solve" this, but did a workaround. We deployed to the server in which our RightFax installation was. For whatever reason, this was the problem. Deploying locally or to any other server and installing the RF client was all that was needed. Problem solved.

Thomas
  • 339
  • 4
  • 15