From 9bcadc87cbe084168d8f7d3ed3468d6f2ce700a3 Mon Sep 17 00:00:00 2001 From: Julian Hyde Date: Wed, 9 Jan 2008 08:31:56 +0000 Subject: [PATCH] XMLA driver now uses HTTP POST (some server's don't support GET) git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@57 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- src/org/olap4j/driver/xmla/XmlaOlap4jDriver.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jDriver.java b/src/org/olap4j/driver/xmla/XmlaOlap4jDriver.java index b3c9480..721157a 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jDriver.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jDriver.java @@ -205,11 +205,19 @@ Future submit( } /** - * Implementation of {@link Proxy} which uses HTTP. + * Implementation of {@link Proxy} which uses HTTP POST. */ protected static class HttpProxy implements Proxy { public byte[] get(URL url, String request) throws IOException { + // Open connection to manipulate the properties URLConnection urlConnection = url.openConnection(); + urlConnection.setDoOutput(true); + urlConnection.setRequestProperty("content-type", "text/xml"); + + // Send data (i.e. POST). Assume default encoding. + urlConnection.getOutputStream().write(request.getBytes()); + + // Get the response, again assuming default encoding. InputStream is = urlConnection.getInputStream(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[1024];