I've tried the above by putting my communication in a Code Module called "Globaal".
If I call/try:
Sub RouteCall
Dim requestSoapXML As String
Dim sChar As String
Dim Soap As HttpJob
Log("in route call")
sChar = "&"
Soap.Initialize("GetRoute","Globaal")
HttpUtils.CallbackUrlDoneSub = "" 'don't want to handle this event
requestSoapXML = Main.MainUrl&"/GetRoute10/JSON?iPDA="&Main.uniqueID&sChar&"sWachtwoord="&Main.wachtwoord&sChar&"xmlParameters="
Log(requestSoapXML )
Soap.Download(requestSoapXML)
End Sub
the programm doesn't reach the JobDone sub which is in the same codemodule.
Sub JobDone(Job As HttpJob)
Dim sResult As String
Dim I As Int
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "GetRoute"
sResult = Job.GetString
If (sResult.Trim<>"" AND sResult.Contains("</b>")) Then
Log("GetRoute succes")
Route_Verwerken(sResult)
Else
Log("GetRoute failed")
End If
End Select
Else
Log("Error: " & Job.ErrorMessage)
End If
HttpUtils.Complete = False
End Sub
I've tried
soap.initialize("GetRoute",me)
But that ain't allowed in a code module.
When I had the same code (RouteCall and JobDone) in a Activity module it worked.
But I need to call the sub RouteCall at multiple places (and also others).
Therefor I would like to place the communication and XML-parsing in one global package.