I am trying to do an invoice request on IQIntAPI and I am getting the below error message
<?xml version="1.0" encoding="UTF-8"?>
<IQ_API_Result>
<IQ_API_Error>
<IQ_Error_Code>5</IQ_Error_Code>
<IQ_Error_Description>Unable to open Data Tables for Company [FMC]</IQ_Error_Description>
<IQ_Error_Data>
<IQ_Error_Data_Item>
<IQ_Error_Code>7</IQ_Error_Code>
<IQ_Error_Description>IQ_User_Password Is Invalid</IQ_Error_Description>
<IQ_Error_Extended_Data />
</IQ_Error_Data_Item>
<IQ_Error_Data_Item>
<IQ_Error_Code>5</IQ_Error_Code>
<IQ_Error_Description>Unable to open Data Tables for Company [FMC]</IQ_Error_Description>
<IQ_Error_Extended_Data />
</IQ_Error_Data_Item>
</IQ_Error_Data>
</IQ_API_Error>
</IQ_API_Result>
Company_Number, IQ_Terminal_Number, IQ_User_Number and IQ_User_Password is correct for the API user I have tried running the REST Server, giving all access permissions to Company Folder but the API still gives the same error.Below is part of my sourcecode:
IntPtr FResult;
string FResultString;
int FResultLength;
string FMessage;
int FMessageLength;
int FCallResult;
StringWriter FStringWriter = new StringWriter();
using (XmlWriter FWriter = XmlWriter.Create(FStringWriter))
{
FWriter.WriteStartDocument();
FWriter.WriteStartElement("IQ_API");
FWriter.WriteStartElement("IQ_API_Request_Document_Invoice");
FWriter.WriteElementString("IQ_Company_Number", "FMC");
FWriter.WriteElementString("IQ_Terminal_Number", "1");
FWriter.WriteElementString("IQ_User_Number", "100");
FWriter.WriteElementString("IQ_User_Password", "KIDD");
FWriter.WriteEndElement(); //IQ_API_Request_Stock
FWriter.WriteEndElement(); //IQ_API
FWriter.WriteEndDocument();
FWriter.Flush();
}
FMessage = FStringWriter.ToString();
FMessageLength = FMessage.Length;
FResultLength = 0;
FCallResult = IQ_API_Request_Document_Invoice(FMessage, FMessageLength, out FResult, ref FResultLength);
FResultString = Marshal.PtrToStringAnsi(FResult);
if (FCallResult != 0)
{
MessageBox.Show("An Error Occurred. Error Code [" + FCallResult.ToString() + "]");
}
lstResult.Text = FormatXML(FResultString.Substring(0, FResultLength));
Where might I be going wrong in my source code or IQ Retail setup?