Fixed runtime error related to XML marshaling

This commit is contained in:
Kai S. K. Engelbart 2019-10-06 13:33:23 +02:00
parent b39cecbfbc
commit c2fe1c8240

View File

@ -78,12 +78,11 @@ public class EnvoyClient {
}
// Send message
String url = String.format("%s:%s/envoy-server/rest/message/send",
serverProps.getProperty("server"),
serverProps.getProperty("port"));
Client client = ClientBuilder.newClient();
WebTarget target = client.target(url);
Response response = target.request().post(Entity.entity(message, "application/xml"));
WebTarget target = client.target(String.format("%s:%s/envoy-server/rest/message/send",
serverProps.getProperty("server"),
serverProps.getProperty("port")));
Response response = target.request().post(Entity.entity(messages, "application/xml"));
System.out.println("Response code: " + response.getStatus());
response.close();
client.close();