I'm just doing a Front-End Dashboard for an ERP using PHP. Which is possible to integrate the ERP with XML Request and Response. The ERP URL would be something like http://localhost:9000
.
To fetch the Data from that ERP, I must send the XML Request to the ERP server URL in a particular Template (These details are given in the ERP integration Manual)
XML Request Template:
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>TrialBalance</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<EXPLODEFLAG>Yes</EXPLODEFLAG>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>
If I send this Request to the ERP server http://localhost:9000
It would give a response like below:
XML Response Template:
<ENVELOPE>
<DSPACCNAME>
<DSPDISPNAME>Purchase Accounts</DSPDISPNAME>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA>-49566060.80</DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA></DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
</ENVELOPE>
Now I Have no idea how to send the XML request to an URL and Capture this Response using php.
I'm new to curl Where in curl I Know to send the Request but I have no idea how to receive this response store it and display it.
I'm sure if i capture this response and display it. I can parse the XML and get the values which I want from the ERP. I'm right now in the dark, can some one throw the light so that it could unlock my way to the next step.
Thanks in Advance!!!