Hi @Donner,
Yes you can get the data from the server side using Invoke code activity
based on your requirement you need to pass the input and output arguments to invoke code activity.
Refer the below code to get the data from the API.
Dim serviceUrl As String = "http://localhost:17757/VB/Services/Service.svc"
Dim input As Object = New With { _
.name = txtName.Text.Trim(), _
.age = txtAge.Text.Trim() _
}
Dim inputJson As String = (New JavaScriptSerializer()).Serialize(input)
Dim httpRequest As HttpWebRequest = DirectCast(WebRequest.Create(New Uri(serviceUrl & "/GetData")), HttpWebRequest)
httpRequest.Accept = "application/json"
httpRequest.ContentType = "application/json"
httpRequest.Method = "POST"
Dim bytes As Byte() = Encoding.UTF8.GetBytes(inputJson)
Using stream As Stream = httpRequest.GetRequestStream()
stream.Write(bytes, 0, bytes.Length)
stream.Close()
End Using
Using httpResponse As HttpWebResponse = DirectCast(httpRequest.GetResponse(), HttpWebResponse)
Using stream As Stream = httpResponse.GetResponseStream()
outputStr = (New StreamReader(stream)).ReadToEnd()
End Using
End Using
outputStr is the final output of the API.
Regards,
Arivu