Created
October 18, 2012 22:23
-
-
Save bshaffer/3915143 to your computer and use it in GitHub Desktop.
Gist for this step: https://developer.omniture.com/en_US/content_page/enterprise-api/c-retrieve-the-report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(request.getMessage().equalsIgnoreCase("completed")) { | |
try { | |
/* Connect to the URL */ | |
URL url = new URL( request.getData_url() ); | |
URLConnection connection = url.openConnection(); | |
/* Attach the Security Header (X-WSSE) */ | |
connection.addRequestProperty("X-WSSE", getSecurityHeader( "<your user name>","<your shared secret>" )); | |
connection.setDoOutput(false); | |
/* Establish an InputStream/BufferedReader to read the report */ | |
InputStream in = connection.getInputStream(); | |
BufferedReader res = new BufferedReader(new InputStreamReader(in, "UTF-8")); | |
/* Print each line of the report */ | |
String inputLine; | |
while ((inputLine = res.readLine()) != null) { | |
System.out.println(inputLine); | |
} | |
res.close(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} else { | |
System.out.println("DW Check, message = " + request.getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment