@Test public void paringManusega() throws XRoadServiceConsumptionException { String result = epriaXRoadServiceImpl.epriaParingManusega("<andmeParing xmlns:xsi=\"http: null, null); Assert.assertNotNull(result); }
@Override public String epriaParingManusega(String xml, String securityServer, String isikukood) throws XRoadServiceConsumptionException { try { XRoadMessage<EpriaManusegaRequest> request = new XmlBeansXRoadMessage<EpriaManusegaRequest>(EpriaManusegaRequest.Factory.newInstance()); BinaarfailNest xmlManus = request.getContent().addNewParingXml(); xmlManus.setAttachmentHandler(new DataHandler(new ByteArrayDataSource("text/xml", xml.getBytes("UTF-8")))); XRoadMessage<EpriaManusegaResponse> response = send(request, "epriaManusega", "v1", isikukood, securityServer); InputStream in = response.getContent().getVastusXml().getAttachmentHandler().getInputStream(); int read = 0; byte[] bytes = new byte[1024]; ByteArrayOutputStream out = new ByteArrayOutputStream(); while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } out.flush(); in.close(); return new String(out.toByteArray(), "UTF-8"); } catch (XRoadServiceConsumptionException ex) { ex.printStackTrace(); throw ex; } catch (Exception ex) { ex.printStackTrace(); throw new XRoadServiceConsumptionException(new NonTechnicalFaultException("1", "P2ring eba6nnestus"), "epria", "epriaParingManusega", "v1"); } }
EpriaXRoadServiceImpl extends XRoadDatabaseService implements EpriaXRoadService { @Override public String epriaParingManusega(String xml, String securityServer, String isikukood) throws XRoadServiceConsumptionException { try { XRoadMessage<EpriaManusegaRequest> request = new XmlBeansXRoadMessage<EpriaManusegaRequest>(EpriaManusegaRequest.Factory.newInstance()); BinaarfailNest xmlManus = request.getContent().addNewParingXml(); xmlManus.setAttachmentHandler(new DataHandler(new ByteArrayDataSource("text/xml", xml.getBytes("UTF-8")))); XRoadMessage<EpriaManusegaResponse> response = send(request, "epriaManusega", "v1", isikukood, securityServer); InputStream in = response.getContent().getVastusXml().getAttachmentHandler().getInputStream(); int read = 0; byte[] bytes = new byte[1024]; ByteArrayOutputStream out = new ByteArrayOutputStream(); while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } out.flush(); in.close(); return new String(out.toByteArray(), "UTF-8"); } catch (XRoadServiceConsumptionException ex) { ex.printStackTrace(); throw ex; } catch (Exception ex) { ex.printStackTrace(); throw new XRoadServiceConsumptionException(new NonTechnicalFaultException("1", "P2ring eba6nnestus"), "epria", "epriaParingManusega", "v1"); } } }
EpriaXRoadServiceImpl extends XRoadDatabaseService implements EpriaXRoadService { @Override public String epriaParingManusega(String xml, String securityServer, String isikukood) throws XRoadServiceConsumptionException { try { XRoadMessage<EpriaManusegaRequest> request = new XmlBeansXRoadMessage<EpriaManusegaRequest>(EpriaManusegaRequest.Factory.newInstance()); BinaarfailNest xmlManus = request.getContent().addNewParingXml(); xmlManus.setAttachmentHandler(new DataHandler(new ByteArrayDataSource("text/xml", xml.getBytes("UTF-8")))); XRoadMessage<EpriaManusegaResponse> response = send(request, "epriaManusega", "v1", isikukood, securityServer); InputStream in = response.getContent().getVastusXml().getAttachmentHandler().getInputStream(); int read = 0; byte[] bytes = new byte[1024]; ByteArrayOutputStream out = new ByteArrayOutputStream(); while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } out.flush(); in.close(); return new String(out.toByteArray(), "UTF-8"); } catch (XRoadServiceConsumptionException ex) { ex.printStackTrace(); throw ex; } catch (Exception ex) { ex.printStackTrace(); throw new XRoadServiceConsumptionException(new NonTechnicalFaultException("1", "P2ring eba6nnestus"), "epria", "epriaParingManusega", "v1"); } }  }
EpriaXRoadServiceImpl extends XRoadDatabaseService implements EpriaXRoadService { @Override public String epriaParingManusega(String xml, String securityServer, String isikukood) throws XRoadServiceConsumptionException { try { XRoadMessage<EpriaManusegaRequest> request = new XmlBeansXRoadMessage<EpriaManusegaRequest>(EpriaManusegaRequest.Factory.newInstance()); BinaarfailNest xmlManus = request.getContent().addNewParingXml(); xmlManus.setAttachmentHandler(new DataHandler(new ByteArrayDataSource("text/xml", xml.getBytes("UTF-8")))); XRoadMessage<EpriaManusegaResponse> response = send(request, "epriaManusega", "v1", isikukood, securityServer); InputStream in = response.getContent().getVastusXml().getAttachmentHandler().getInputStream(); int read = 0; byte[] bytes = new byte[1024]; ByteArrayOutputStream out = new ByteArrayOutputStream(); while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } out.flush(); in.close(); return new String(out.toByteArray(), "UTF-8"); } catch (XRoadServiceConsumptionException ex) { ex.printStackTrace(); throw ex; } catch (Exception ex) { ex.printStackTrace(); throw new XRoadServiceConsumptionException(new NonTechnicalFaultException("1", "P2ring eba6nnestus"), "epria", "epriaParingManusega", "v1"); } }  @Override String epria(String xml, String securityServer, String isikukood); @Override String epriaParingManusega(String xml, String securityServer, String isikukood); @Override DhsVaataTaotluseDigiDokResponse vaataTaotluseDigiDok(String kandeNumber); @Override DhsVaataTaotluseDigiDokResponse vaataTaotluseDigiDok(String securityServer, String kandeNumber); @Override DhsVaataTaotlusePdfResponse vaataTaotlusePdf(String kandeNumber); @Override DhsVaataTaotlusePdfResponse vaataTaotlusePdf(String securityServer, String kandeNumber); @Override DhsVaataTaotluseManusResponse vaataTatoluseManus(String kandeNumber,
                                                          String portaaliId,
                                                          String sisuFailId,
                                                          String vaataja,
                                                          Integer priaRoll); @Override DhsVaataTaotluseManusResponse vaataTatoluseManus(String securityServer,
                                                          String kandeNumber,
                                                          String portaaliId,
                                                          String sisuFailId,
                                                          String vaataja,
                                                          Integer priaRoll); @Override VastuseKood saadaTaotlus(String kandeNumber, ManusModel digiDoc, ManusModel pdf, List<ManusModel> manused); @Override VastuseKood saadaTaotlus(String securityServer,
                                  String kandeNumber,
                                  ManusModel digiDoc,
                                  ManusModel pdf,
                                  List<ManusModel> manused); }
EpriaXRoadServiceImpl extends XRoadDatabaseService implements EpriaXRoadService { @Override public String epriaParingManusega(String xml, String securityServer, String isikukood) throws XRoadServiceConsumptionException { try { XRoadMessage<EpriaManusegaRequest> request = new XmlBeansXRoadMessage<EpriaManusegaRequest>(EpriaManusegaRequest.Factory.newInstance()); BinaarfailNest xmlManus = request.getContent().addNewParingXml(); xmlManus.setAttachmentHandler(new DataHandler(new ByteArrayDataSource("text/xml", xml.getBytes("UTF-8")))); XRoadMessage<EpriaManusegaResponse> response = send(request, "epriaManusega", "v1", isikukood, securityServer); InputStream in = response.getContent().getVastusXml().getAttachmentHandler().getInputStream(); int read = 0; byte[] bytes = new byte[1024]; ByteArrayOutputStream out = new ByteArrayOutputStream(); while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } out.flush(); in.close(); return new String(out.toByteArray(), "UTF-8"); } catch (XRoadServiceConsumptionException ex) { ex.printStackTrace(); throw ex; } catch (Exception ex) { ex.printStackTrace(); throw new XRoadServiceConsumptionException(new NonTechnicalFaultException("1", "P2ring eba6nnestus"), "epria", "epriaParingManusega", "v1"); } }  @Override String epria(String xml, String securityServer, String isikukood); @Override String epriaParingManusega(String xml, String securityServer, String isikukood); @Override DhsVaataTaotluseDigiDokResponse vaataTaotluseDigiDok(String kandeNumber); @Override DhsVaataTaotluseDigiDokResponse vaataTaotluseDigiDok(String securityServer, String kandeNumber); @Override DhsVaataTaotlusePdfResponse vaataTaotlusePdf(String kandeNumber); @Override DhsVaataTaotlusePdfResponse vaataTaotlusePdf(String securityServer, String kandeNumber); @Override DhsVaataTaotluseManusResponse vaataTatoluseManus(String kandeNumber,
                                                          String portaaliId,
                                                          String sisuFailId,
                                                          String vaataja,
                                                          Integer priaRoll); @Override DhsVaataTaotluseManusResponse vaataTatoluseManus(String securityServer,
                                                          String kandeNumber,
                                                          String portaaliId,
                                                          String sisuFailId,
                                                          String vaataja,
                                                          Integer priaRoll); @Override VastuseKood saadaTaotlus(String kandeNumber, ManusModel digiDoc, ManusModel pdf, List<ManusModel> manused); @Override VastuseKood saadaTaotlus(String securityServer,
                                  String kandeNumber,
                                  ManusModel digiDoc,
                                  ManusModel pdf,
                                  List<ManusModel> manused);  }