Good morning,
I have an image of a microservice running in the docker accessible via http://localhost:8080/.
Essentially, this microservice has an engine where it is possible to run BPMN workflow files which are made in the Eclipse IDE.
On the other hand, this microservice also contains a REST service in which it is possible to send an XML description to interact with the Engine.
So, through the Windows 10 powersheell, I can send the following CURL command to the Engine:
curl.exe --user admin:adminadmin -H "Content-Type: application/xml" -H 'Accept: application/xml' -d '<document xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">
<item name=\"$modelversion\"><value xsi:type=\"xs:string\">1.0.0</value></item>
<item name=\"$taskid\"><value xsi:type=\"xs:int\">1000</value></item>
<item name=\"$eventid\"><value xsi:type=\"xs:int\">10</value></item>
<item name=\"_budget\"><value xsi:type=\"xs:int\">150</value></item>
</document>' http://localhost:8080/api/workflow/workitem
Getting the following response from the Engine:
>> </document>' http://192.168.1.65:8080/api/workflow/workitem --user admin:adminadmin
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"><document><item name="$created"><value xsi:type="xs:dateTime">2021-07-03T13:42:17.037+02:00</value></item><item name="$creator"><value xsi:type="xs:string">admin</value></item><item name="$editor"><value xsi:type="xs:string">admin</value></item><item name="$eventid"><value xsi:type="xs:int">0</value></item><item name="$eventlog"><value xsi:type="xs:string">2021-07-03T13:42:17.018|1.0.0|1000.10|1000|</value></item><item name="$isauthor"><value xsi:type="xs:boolean">true</value></item><item name="$lastevent"><value xsi:type="xs:int">10</value></item><item name="$lasteventdate"><value xsi:type="xs:dateTime">2021-07-03T13:42:16.987+02:00</value></item><item name="$lasttask"><value xsi:type="xs:int">1000</value></item><item name="$modelversion"><value xsi:type="xs:string">1.0.0</value></item><item name="$modified"><value xsi:type="xs:dateTime">2021-07-03T13:42:17.037+02:00</value></item><item name="$participants"><value xsi:type="xs:string">admin</value></item><item name="$processid"><value xsi:type="xs:int">1600</value></item><item name="$taskid"><value xsi:type="xs:int">1600</value></item><item name="$transactionid"><value xsi:type="xs:string">52bc23820da0f9ee</value></item><item name="$uniqueid"><value xsi:type="xs:string">701eed86-e627-4b73-bc95-a217c9ea6bd6</value></item><item name="$workflowgroup"><value xsi:type="xs:string">Simple</value></item><item name="$workflowstatus"><value xsi:type="xs:string">Task 7</value></item><item name="$workitemid"><value xsi:type="xs:string">d132ec54-0142-47e1-a0c2-a541662741f9</value></item><item name="_budget"><value xsi:type="xs:int">150</value></item><item name="namcreator"><value xsi:type="xs:string">admin</value></item><item name="namcurrenteditor"><value xsi:type="xs:string">admin</value></item><item name="numlastactivityid"><value xsi:type="xs:int">10</value></item><item name="txtworkflowgroup"><value xsi:type="xs:string">Simple</value></item><item name="txtworkflowstatus"><value xsi:type="xs:string">Task 7</value></item><item name="type"><value xsi:type="xs:string">workitem</value></item></document></data>
Confirming the successful sending of the xml message, through the curl command.
I have an Arduino Uno Wifi Rev.2 and I'm having trouble trying to send this XML description to the Engine.
Essentially, I searched here on this forum as well as on Google and made the following code, however without success:
#include <WiFiNINA.h>
#include <ArduinoHttpClient.h>
char ssid[] = "#"; // your network SSID (name)
char pass[] = "Qm5TYs$%123GHYd5)#-_|/M-]<>!;,[+.:/-&I=Ghio95nh)9aWn%#}(9]?*";
int port = 8080;
const char serverAddress[] = "http://192.168.1.65"; // server name
WiFiClient wifi;
HttpClient client = HttpClient(wifi, serverAddress, port);
int status = WL_IDLE_STATUS;
void setup() {
Serial.begin(9600);
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
delay(5000);
}
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
IPAddress ip = WiFi.localIP();
IPAddress gateway = WiFi.gatewayIP();
Serial.print("IP Address: ");
Serial.println(ip);
}
void loop() {
client.connectionKeepAlive();
Serial.println("making POST request");
String postData = "<document xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><item name=\"$modelversion\"><value xsi:type=\"xs:string\">1.0.0</value></item><item name=\"$taskid\"><value xsi:type=\"xs:int\">1000</value></item><item name=\"$eventid\"><value xsi:type=\"xs:int\">10</value></item><item name=\"_budget\"><value xsi:type=\"xs:int\">150</value></item></document>";
Serial.print("Post Data Length: ");
Serial.println(postData.length());
client.beginRequest();
client.post("/api/workflow/workitem");
client.sendHeader("--user admin:adminadmin");
client.sendHeader("Content-Type", "application/xml");
client.sendHeader("Accept", "application/xml");
client.endRequest();
client.println(postData);
while (client.connected()) { // while connected to the server,
if (client.available()) { // if there is a response from the server,
String result = client.readString(); // read it
Serial.print(result); // and print it
}
}
// read the status code and body of the response
int statusCode = client.responseStatusCode();
String response = client.responseBody();
Serial.print("Status code: ");
Serial.println(statusCode);
Serial.print("Response: ");
Serial.println(response);
Serial.println("Wait five seconds");
delay(5000);
}
If I run the code in Arduino, I'm faced with the following output:
Essentially what's happening is that I'm not getting any response from the microservice. I honestly don't really understand what I might be doing wrong.
Thanks You,
Best regards

