tweaking, graphql job, add graphql test gui
This commit is contained in:
42
GUIs.Test.GraphQLTest/Form1.vb
Normal file
42
GUIs.Test.GraphQLTest/Form1.vb
Normal file
@@ -0,0 +1,42 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Interfaces
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class Form1
|
||||
Private _LogConfig As LogConfig
|
||||
Private _Interface As GraphQLInterface
|
||||
|
||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
_LogConfig = New LogConfig(LogConfig.PathType.CurrentDirectory)
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
Try
|
||||
_Interface = New GraphQLInterface(_LogConfig,
|
||||
txtBaseUrl.Text,
|
||||
txtUsername.Text,
|
||||
txtPassword.Text,
|
||||
txtCertFile.Text,
|
||||
txtCertPass.Text)
|
||||
|
||||
Dim oLoginResponse = _Interface.Login()
|
||||
_Interface.SaveCookies(oLoginResponse.Cookies.Item(0))
|
||||
|
||||
Dim oDataResponse = _Interface.GetData(txtQuery.Text, "Nls")
|
||||
Dim oResult As String
|
||||
|
||||
Using oStream = oDataResponse.GetResponseStream()
|
||||
Using oReader As New StreamReader(oStream)
|
||||
oResult = oReader.ReadToEnd()
|
||||
End Using
|
||||
End Using
|
||||
|
||||
File.WriteAllText("E:\JenneJ\WISAG\results.json", oResult)
|
||||
txtResults.Text = oResult
|
||||
|
||||
Dim oLogoutResponse = _Interface.Logout()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user