Add Edit Row Button, Transfer multiple files at once, F5 for Row Editor, Timeout for HTTP Client of 60 seconds
This commit is contained in:
@@ -5,6 +5,7 @@ Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Filesystem
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports MultiTool.Shared.Documents
|
||||
Imports MultiTool.Shared.Exceptions
|
||||
Imports MultiTool.Shared.Templates
|
||||
Imports MultiTool.Shared.Templates.GeneralConfig
|
||||
Imports MultiTool.Shared.Winline.Entities
|
||||
@@ -35,6 +36,17 @@ Namespace Winline
|
||||
End Sub
|
||||
|
||||
#Region "Import"
|
||||
''' <summary>
|
||||
''' Transfers a document to winline via Webservices
|
||||
''' </summary>
|
||||
''' <param name="pDocument"></param>
|
||||
''' <param name="pTemplate"></param>
|
||||
''' <param name="pMandator"></param>
|
||||
''' <param name="pIsTest"></param>
|
||||
''' <exception cref="HttpRequestException"></exception>
|
||||
''' <exception cref="WebServiceException"></exception>
|
||||
''' <exception cref="TaskCanceledException"></exception>
|
||||
''' <returns>True if request was successful.</returns>
|
||||
Public Async Function TransferDocumentToWinline(pDocument As Documents.Document, pTemplate As Template, pMandator As Mandator, Optional pIsTest As Boolean = False) As Task(Of Boolean)
|
||||
Dim oBytes As Byte() = GetBytesFromDocument(pDocument)
|
||||
Dim oWS = Config
|
||||
@@ -91,7 +103,9 @@ Namespace Winline
|
||||
Dim oByref = 1
|
||||
|
||||
Dim oURL As String = $"{oWS.BaseUrl}/ewlservice/import?User={oWS.Username}&Password={oWS.Password}&Company={pMandator.Id}&Type={oTemplateType}&Vorlage={oTemplateName}&ActionCode={oActionCode}&Byref={oByref}&Data={oImportRelativeFilePath}"
|
||||
Dim oClient As New HttpClient()
|
||||
Dim oClient As New HttpClient With {
|
||||
.Timeout = TimeSpan.FromSeconds(Constants.HTTP_REQUEST_TIMEOUT_IN_SECONDS)
|
||||
}
|
||||
|
||||
Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl)
|
||||
|
||||
@@ -146,17 +160,17 @@ Namespace Winline
|
||||
If oResponseObject.OverallSuccess = False Then
|
||||
Dim oMessage = $"Request to Webservice was unsuccessful:{vbNewLine}{vbNewLine}{String.Join(vbNewLine, oErrorStrings.ToArray)}"
|
||||
|
||||
Throw New ApplicationException(oMessage)
|
||||
Throw New WebServiceException(oMessage)
|
||||
End If
|
||||
End Using
|
||||
|
||||
Case "text/html"
|
||||
WriteResponseFileWithSuffix(pTemplate.OutputWebserviceDirectory, pBaseFileNAme, oResponseBody, "txt", "Response")
|
||||
|
||||
Throw New ApplicationException(oResponseBody)
|
||||
Throw New WebServiceException(oResponseBody)
|
||||
|
||||
Case Else
|
||||
Throw New ApplicationException(oResponseBody)
|
||||
Throw New WebServiceException(oResponseBody)
|
||||
End Select
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user