diff --git a/gazelle-proxy-jar/src/main/java/net/ihe/gazelle/proxy/gui/MessageBean.java b/gazelle-proxy-jar/src/main/java/net/ihe/gazelle/proxy/gui/MessageBean.java index 1171e8f69159f26f3cd6fcf61095bb7952f18a38..2784440c995c3e56fdb57013a6bcdde35d69c4d6 100644 --- a/gazelle-proxy-jar/src/main/java/net/ihe/gazelle/proxy/gui/MessageBean.java +++ b/gazelle-proxy-jar/src/main/java/net/ihe/gazelle/proxy/gui/MessageBean.java @@ -36,6 +36,7 @@ import org.apache.commons.exec.PumpStreamHandler; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.multipart.ByteArrayPartSource; import org.apache.commons.httpclient.methods.multipart.FilePart; import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; import org.apache.commons.httpclient.methods.multipart.Part; @@ -328,7 +329,13 @@ public class MessageBean { // use the type as file name String messageType = message.getChannelType().name(); - PartSource partSource = message.getPartSource(messageType); + // encode byte before send it to EVS + byte[] bytes = message.getMessageReceived(); + bytes = Base64.encodeBase64(bytes); + + PartSource partSource = new ByteArrayPartSource(messageType, bytes); + +// PartSource partSource = message.getPartSource(messageType); Part[] parts = { new FilePart("message", partSource) }; filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams())); int status = -1; @@ -338,7 +345,7 @@ public class MessageBean { status = -1; e.printStackTrace(); } - log.info("proxyId : "+proxyId); + log.info("proxyId : " + proxyId); // redirect the user to the good page if (status == HttpStatus.SC_OK) { try {