We use XML to carry data between server and client. XML simplify the data transportation and carry data in plain text format which is readable by both human and machine. It is the biggest reason to provide a software and hardware independent way of transporting, storing, and sharing data. This feature of XML give the reason to send request in XML format in server communication.

In case of POS (point of sale) we generally send the Request in XML, JSON or ISO bit map format to communicate with payment gateway or middle-ware server. A lot of API available in “C” to create XML or bit map request for server communication.
In this article I will describe a simple project to create a XML request for server communication.

Let’s talk an  example

Consider a scenario where we want to send some user credential and a message to the server in XML format. In this situation first we need to create an xml tag and feel these tag with desire data.
Note:  XML language has no predefined tag. It’s provide flexibility to give any name to your XML tag.

Below API create an XML tag and set the desire data. If there is no source data then tag automatically fill by “0”.You can modify these API as per your requirements. When finally tag have created then simply copy these tag to the request buffer.

API To Create the XML Tag

Program to create a XML request for server communication

OutPut:

server communication