Hi,
I have few common tables having a same table structure (e.g, f1, f2) but different contents. So I created a function to perform the same download process for those tables by passing in the table name for the job to process (as below). I got no problem by running the job after one job is finished. But the XML parser (jobxxx_EndElement) will confused when I run multiple jobs simultaneously.
How can I overcome this problem on running the jobs simultaneously without the problem.
Any advice on this? Thanks in advance.
I have few common tables having a same table structure (e.g, f1, f2) but different contents. So I created a function to perform the same download process for those tables by passing in the table name for the job to process (as below). I got no problem by running the job after one job is finished. But the XML parser (jobxxx_EndElement) will confused when I run multiple jobs simultaneously.
How can I overcome this problem on running the jobs simultaneously without the problem.
Any advice on this? Thanks in advance.
B4X:
Sub StartDownload(tablename As String)
If xfs.CheckConnection Then
template = File.ReadString(File.DirAssets, tablename & ".xml")
parser.Initialize
Dim job As HttpJob
job.Initialize(tablename, Me)
job.PostString(URL, BuildRequest)
job.GetRequest.SetContentType("text/xml; charset=utf-8")
job.GetRequest.SetHeader("SOAPAction", """http://tempuri.org/" & tablename & """")
Else
Activity.Finish
End If
End Sub
StartDownload("Table1")
StartDownload("Table2")
StartDownload("Table3")
StartDownload("Table4")