Guest User

Untitled

a guest
Nov 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  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();
Add Comment
Please, Sign In to add comment