Accounting-Companion / TallyConnector

You can use Tally Connector to Connect your desktop/Mobile Applications with Tally seamlessly.
47 stars 29 forks source link

GetLicenseInfoAsync crashes (unhandled exception) if Tally is running without any Company #34

Closed haldark closed 2 months ago

haldark commented 9 months ago

Hi, In order to get familiar with TallyConnector, I installed Tally ERP9 in a VM, and wrote a test C# program to see if my test program can connect with Tally via TallyConnector. It is brand new installation of Tally, with no company setup yet.

CheckAync returned true, but GetLicenseInfoAsync threw exception.

TallyConnector.Core.Exceptions.TallyXMLParsingException
  HResult=0x80131500
  Message=There is an error in XML document (1, 2). - <ENVELOPE>
  Source=TallyConnector
  StackTrace:
   at TallyConnector.Services.XMLToObject.GetObjfromXml[T](String Xml, XmlAttributeOverrides attrOverrides, ILogger Logger)
   at TallyConnector.Services.TallyService.<GetTDLReportAsync>d__42`2.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TallyConnector.Services.TallyService.<GetLicenseInfoAsync>d__33.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at TCTest.FormMain.<getTallyLicenseData>d__6.MoveNext() in C:\Users\KISH\Data\MyProjects\.NET\VS 2019\Winform\TCTest\TCTest\frmMain.cs:line 38

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
InvalidOperationException: There is an error in XML document (1, 2).

Inner Exception 2:
InvalidOperationException: <ENVELOPE xmlns=''> was not expected.

"View Details" of this exception shows this XML. Seems like this is response from Tally.

"<ENVELOPE>\r\n <HEADER>\r\n <VERSION>1</VERSION>\r\n <STATUS>0</STATUS>\r\n </HEADER>\r\n <BODY>\r\n <DATA>\r\n <LINEERROR>Could not find Company &apos;&apos;</LINEERROR>\r\n </DATA>\r\n </BODY>\r\n</ENVELOPE>\r\n"

None of the properties of LicenseInfo class has any relation with active company. I wonder, then why GetLicenseInfoAsync is depending on any company?

saivineeth100 commented 9 months ago

Thats the response we are getting from Tally, We don't have control over that.

saivineeth100 commented 2 months ago

Shifted from report to collection for fecthing license info, now GetLicenseInfoAsync does not require any company to be opened