1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
try {
// Send the request
URL url = new URL("http://127.0.0.1:8080/wssecu1/services/ServiceImpl");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
wr = new OutputStreamWriter(conn.getOutputStream(),"UTF-8");
wr.write(messageSecu);
wr.flush();
// Get the response
System.out.println(conn.getInputStream());
rd = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
String line;
while ((line = rd.readLine()) != null) {
System.out.println(line);
}
} catch (Exception e) {
e.printStackTrace();
} |
Partager