daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Nov 21st, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. File arq = new File("C:\Users\EX-PHP\Desktop\ArquivosNfse\xml.xml");
  2.  
  3.     OkHttpClient client= new OkHttpClient();
  4.     MediaType type = MediaType.parse("application/soap+xml;charset=utf-8");
  5.     RequestBody body = RequestBody.create(type,arq);
  6.  
  7.     Request request = new Request.Builder()
  8.             .url("http://isscuritiba.curitiba.pr.gov.br/Iss.NfseWebService/Nfsews.asmx")
  9.             .post(body)
  10.             .build();
  11.  
  12.     Response response = client.newCall(request).execute();
  13.     String res = response.body().string();
  14.     System.out.println(res);
  15.  
  16.     FileOutputStream out = new FileOutputStream("C:\Users\EX-PHP\Desktop\result.xml");
  17.     out.write(res.getBytes());
  18.     out.close();
RAW Paste Data
Top