add progress box for webservice calls
This commit is contained in:
@@ -13,6 +13,8 @@ Namespace Winline
|
||||
Private ReadOnly Serializer As Serializer
|
||||
Private ReadOnly AppDataPath As String
|
||||
|
||||
Public Event WebServiceProgress As EventHandler(Of String)
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pConfig As Config, pAppDataPath As String)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
Serializer = New Serializer(pLogConfig)
|
||||
@@ -32,6 +34,8 @@ Namespace Winline
|
||||
IO.Directory.CreateDirectory(oPath)
|
||||
End If
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Einstellungen laden")
|
||||
|
||||
' --- Build all teh filenamez and pathz
|
||||
|
||||
Dim oBaseFileName As String = GetBaseFilenameForRequest()
|
||||
@@ -46,6 +50,8 @@ Namespace Winline
|
||||
|
||||
' --- Serialize Data into XML string
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Dateien schreiben")
|
||||
|
||||
Dim oOutputFilePath = IO.Path.Combine(GetBaseWebServicePath(), oFileName)
|
||||
IO.File.WriteAllBytes(oOutputFilePath, oBytes)
|
||||
|
||||
@@ -77,6 +83,8 @@ Namespace Winline
|
||||
|
||||
Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl)
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Anfrage absenden")
|
||||
|
||||
' --- Bring the action!
|
||||
Try
|
||||
Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL)
|
||||
@@ -97,6 +105,8 @@ Namespace Winline
|
||||
Dim oContentType = pResponse.Content.Headers.ContentType.MediaType
|
||||
Dim oSerializer = Serializer.GetSerializer(GetType(Schemas.MESOWebServiceResult))
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Antwort verarbeiten")
|
||||
|
||||
Select Case oContentType
|
||||
Case "text/xml"
|
||||
WriteResponseFile(pPath, pBaseFileNAme, oResponseBody, "xml")
|
||||
|
||||
Reference in New Issue
Block a user