Skip to content

Instantly share code, notes, and snippets.

@bshaffer
Created October 18, 2012 22:23
Show Gist options
  • Save bshaffer/3915143 to your computer and use it in GitHub Desktop.
Save bshaffer/3915143 to your computer and use it in GitHub Desktop.
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