From c2fe1c8240a2b5f5bb19f37caa2814cadd797a0b Mon Sep 17 00:00:00 2001 From: kske Date: Sun, 6 Oct 2019 13:33:23 +0200 Subject: [PATCH] Fixed runtime error related to XML marshaling --- src/main/java/envoy/client/EnvoyClient.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/envoy/client/EnvoyClient.java b/src/main/java/envoy/client/EnvoyClient.java index e97a9e4..c659c4e 100644 --- a/src/main/java/envoy/client/EnvoyClient.java +++ b/src/main/java/envoy/client/EnvoyClient.java @@ -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();