Skip to content

Commit

Permalink
XMLA driver now uses HTTP POST (some server's don't support GET)
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@57 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Jan 9, 2008
1 parent 728d79c commit 9bcadc8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/org/olap4j/driver/xmla/XmlaOlap4jDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,19 @@ Future<byte[]> 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];
Expand Down

0 comments on commit 9bcadc8

Please sign in to comment.