Wednesday, November 7, 2012

Tally - XML Integration Formats.


Tally - XML Messaging Formats.

XML (Extensible Markup Language) is the standard for information exchange with external systems. Tally.ERP 9 supports standardized message formats for Request/Response. Tally can act as an HTTP Server capable of receiving an XML Request and responding with an XML Response. The entire Tally Data can be made available to the requesting application. It is also possible for the application to store data into Tally Database.

XML Messaging format is specified for exchanging structured information in the implementation of Web Services in computer networks. An XML interface can form the foundation layer of a web services protocol stack, providing a basic messaging framework upon which web services can be built.

In Tally.ERP 9, XML messaging format is used for the purpose of integration. Here Tally.ERP 9 uses XML format for communication with external applications including other instances of Tally.ERP 9. The data exchange happens by way of Request / Response. Tally.ERP 9 identifies certain tags for Request and sends a Response accordingly based on the Request.

All Requests and Responses are used in Tally.NET Messages contain custom HTTP headers to identify the requests that needs to be processed or forwarded.

Template used for XML Message Format.

Tally.ERP 9 follows the XML interface for exchanging data with other systems or with other Tally.ERP 9 instances. This XML interface specifies the following format for communication.

<ENVELOPE>
<HEADER> . . . </HEADER>
<BODY> . . . </BODY>
</ENVELOPE>

Request Template.

The XML structure used for requesting messages is as follows:

<ENVELOPE>
<HEADER>
<VERSION>Version Number</VERSION>
<TALLYREQUEST>Request Type</TALLYREQUEST>
<TYPE>Information Type</TYPE>
<SUBTYPE>Sub Type</SUBTYPE>
<ID >Identifier</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
Static Variables Specification
</STATICVARIABLES>
<REPEATVARIABLES>
Repeat Variables Specification
</REPEATVARIABLES>
<FETCHLIST>
Fetch Specification
</FETCHLIST>
<FUNCPARAMLIST>
Parameter Specification in the case of function type
</FUNCPARAMLIST>
<TDL>
TDL Information
                                                </TDL>
</DESC>
<DATA>
Data (if applicable)
                                    </DATA>
</BODY>
</ENVELOPE>

Response Template.

The XML structure used for response is as follows:

<ENVELOPE>
<HEADER>
<VERSION>Version Number</VERSION>
<STATUS>-1/0/1</STATUS>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
Static Variables Specification
</STATICVARIABLES>
<REPEATVARIABLES>
Repeat Variables Specification
</REPEATVARIABLES>
<FETCHLIST>
Fetch Specification
</FETCHLIST>
<FUNCPARAMLIST>
Parameter Specification
</FUNCPARAMLIST>
<TDL>
TDL Information
</TDL>
</DESC>
<DATA>
Data (if applicable)
</DATA>
</BODY>
</ENVELOPE>

Generic Failure Format.

 In case of a failure, all responses could be made to respond using the following format:

<ENVELOPE>
<HEADER>
<VERSION>Version</VERSION>
<STATUS>0</STATUS>
</HEADER>
<BODY>
<DATA>
<STATUS.LIST>
<STATUS>
<CODE>Code</CODE>
<DESC>Description</DESC>
</STATUS>
<STATUS.LIST>
</DATA>
</BODY>
</ENVELOPE>

Components of  Request  / Response.

<ENVELOPE> is the top element of the XML fragment which is representing the message. Both Request and Response consists of two sections:
  • Header
  • Body
Header Information.

Header section will give all identification information to the recipient such as authentication, transaction management, and payment so on. This section determines how the recipient of the message should process the information. Header information is classified in two ways, one is for Request and the other is for Response. All the information about Request or Response is enclosed with Header Tags.

In case of Request, header information includes mainly four elements which are Version, TallyRequest, Type and ID. Version gives the version of the message format. Second element TallyRequest will identify the type of request as Import or Export in the messaging format. If the value of Tally Request is Import then the type of information would be Data, and the request will be identified by the report name specified in ID. If the value of Tally Request is Export then the type of information would be Data, Collection, Object or Function. The ID specifies the name of Report, Collection, Object or function.

In the case of Response, there are mainly two elements which are Version and Status. Version gives the version of the message format. Status indicates whether the request is success or failure.

Body Information.

It exchanges the information intended for the recipient of the message. This section gives the actual details of the message. It is further divided into two sections:
  • Description for Request/Response.
  • Data required for the Request/Response.
Description section is used to give the description for message, request or response. Description element mainly includes all types of variable information, storage information, computational information and user defined TDLs. All the description information is enclosed with <DESC> tags.

Data section includes all the data information being transferred. All the data should be enclosed within the <DATA> tags.

4 comments:

  1. sir, i am using excel vba programing to enter data in excel and then importing it to tally. in this first i import all ledgers from tally to excel and in the entry for these ledgers are selected. now my problems is that when a new ledger is required. how can i create new ledgers automatically while importing data from excel to tally.

    ReplyDelete
  2. I would like to appreciate your work and would like to tell to my friends

    Accounts Data Entry

    ReplyDelete
  3. Sir,

    My query is how to update/correction could be made in tally master addresses through excel ODBC or another software.

    Please help.

    Thanks,

    ReplyDelete
  4. sir,

    How can i pass date format to get data in between given from and to dates

    Please help.

    ReplyDelete