将 xml 发送到 tally 以从 tally 获取任何信息到 VB 中,然后响应 xml 仅显示 TallyPrime 服务器正在运行。当 xml 已更改或在 EXRes 接收来自计数的响应之前插入暂停/定时时,响应是相同的。
Public Sub LdrEx()
Dim ExCd As String
ExCd = LedXmCd()
Dim objXML As MSXML2.ServerXMLHTTP
Set objXML = New MSXML2.ServerXMLHTTP
objXML.Open "POST", "http://localhost:9000", False
objXML.send ExCd
Dim EXRes As String
EXRes = objXML.responseXML
Set objXML = Nothing
Dim TFile As String
TFile = Environ("HOMEDRIVE") & Environ("HOMEPATH") & "\Desktop\LdReceived.xml"
Open TFile For Output As #1
Print #1, EXRes
Close #1
End Sub
来自 LedXmCd() 的 XML 是:
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>DATA</TYPE>
<ID>Voucher Register</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVFROMDATE TYPE="Date">20210101</SVFROMDATE>
<SVTODATE TYPE="Date">20210101</SVTODATE>
<VOUCHERTYPENAME TYPE="STRING">Receipt</VOUCHERTYPENAME>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>