Java Code Examples for javax.xml.soap.SOAPException#getMessage()
The following examples show how to use
javax.xml.soap.SOAPException#getMessage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenericWsSenderImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public Node sendCertificateSecured(String url, Document payload, X509Certificate certificate, PrivateKey privateKey, String soapAction) throws TechnicalConnectorException { GenericRequest request = new GenericRequest(); request.setPayload(payload); request.setEndpoint(url); if (soapAction != null && soapAction.isEmpty()) { request.setSoapAction(soapAction); } request.setCertificateSecured(certificate, privateKey); request.setHandlerChain((new HandlerChain()).register(HandlerPosition.SECURITY, new CertificateCallback(certificate, privateKey)).register(HandlerPosition.SECURITY, new SoapActionHandler())); request.setDefaultHandlerChain(); try { return this.send(request).asNode(); } catch (SOAPException var8) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var8, new Object[]{var8.getMessage()}); } }
Example 2
Source File: GenericWsSenderImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public Node sendSamlSecured(String url, Document payload, Element assertion, Credential credential, String soapAction) throws TechnicalConnectorException { GenericRequest request = new GenericRequest(); request.setPayload(payload); request.setEndpoint(url); if (soapAction != null && soapAction.isEmpty()) { request.setSoapAction(soapAction); } SAMLToken token = SAMLTokenFactory.getInstance().createSamlToken(assertion, credential); request.setHandlerChain((new HandlerChain()).register(HandlerPosition.SECURITY, new SAMLHolderOfKeyHandler(token)).register(HandlerPosition.SECURITY, new SoapActionHandler())); request.setDefaultHandlerChain(); try { return this.send(request).asNode(); } catch (SOAPException var9) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var9, new Object[]{var9.getMessage()}); } }
Example 3
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public RequestPublicationResponse requestPublication(SAMLToken token, RequestPublicationRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build()); try { GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:RequestPublication"); genReq.setPayload((Object)request); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (RequestPublicationResponse)genResp.asObject(RequestPublicationResponse.class); } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } catch (WebServiceException var6) { throw ServiceHelper.handleWebServiceException(var6); } catch (MalformedURLException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 4
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public PutAccessRightResponse putAccessRight(SAMLToken token, PutAccessRightRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build()); try { GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:PutAccessRight"); genReq.setPayload((Object)request); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (PutAccessRightResponse)genResp.asObject(PutAccessRightResponse.class); } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } catch (WebServiceException var6) { throw ServiceHelper.handleWebServiceException(var6); } catch (MalformedURLException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 5
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public RevokeAccessRightResponse revokeAccessRight(SAMLToken token, RevokeAccessRightRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build()); try { GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:RevokeAccessRight"); genReq.setPayload((Object)request); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (RevokeAccessRightResponse)genResp.asObject(RevokeAccessRightResponse.class); } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } catch (WebServiceException var6) { throw ServiceHelper.handleWebServiceException(var6); } catch (MalformedURLException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 6
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public PutPatientConsentResponse putPatientConsent(SAMLToken token, PutPatientConsentRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build()); try { GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:PutPatientConsent"); genReq.setPayload((Object)request); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (PutPatientConsentResponse)genResp.asObject(PutPatientConsentResponse.class); } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } catch (WebServiceException var6) { throw this.handleWebServiceException(var6); } catch (MalformedURLException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 7
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public RevokeTherapeuticLinkResponse revokeTherapeuticLink(SAMLToken token, RevokeTherapeuticLinkRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build()); try { GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:RevokeTherapeuticLink"); genReq.setPayload((Object)request); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (RevokeTherapeuticLinkResponse)genResp.asObject(RevokeTherapeuticLinkResponse.class); } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } catch (WebServiceException var6) { throw this.handleWebServiceException(var6); } catch (MalformedURLException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 8
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public GetTransactionResponse getTransaction(SAMLToken token, GetTransactionRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { if (SessionUtil.getEncryptionCrypto() == null) { LOG.error("No Personal Crypto defined... Have you created a session that also loads your Personal eHealth Certificate?"); throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.SECURITY_NO_CERTIFICATE, new Object[]{"Decryption for GetTransaction"}); } else { LOG.debug("adding request with encryption id codes"); request.setRequest(RequestTypeBuilder.init().addAuthorWithEncryptionInformation().build()); GetTransactionRequest encryptedRequest = (GetTransactionRequest)IntrahubEncryptionUtil.encryptFolder(request, "hub.id", "hub.application"); LOG.debug("Sending message with KMEHR headers to hub"); try { GenericRequest genReq = ServiceFactory.getIntraHubPortWithFolderEncryption(token, "urn:be:fgov:ehealth:interhub:protocol:v1:GetTransaction"); genReq.setPayload((Object)encryptedRequest); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (GetTransactionResponse)genResp.asObject(GetTransactionResponse.class); } catch (SOAPException var6) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var6, new Object[]{var6.getMessage()}); } catch (WebServiceException var7) { throw ServiceHelper.handleWebServiceException(var7); } catch (MalformedURLException var8) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var8, new Object[]{var8.getMessage()}); } } }
Example 9
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public GetPatientResponse getPatient(SAMLToken token, GetPatientRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build()); try { GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:GetPatient"); genReq.setPayload((Object)request); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (GetPatientResponse)genResp.asObject(GetPatientResponse.class); } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } catch (WebServiceException var6) { throw ServiceHelper.handleWebServiceException(var6); } catch (MalformedURLException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 10
Source File: TherLinkServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public GetTherapeuticLinkResponse getTherapeuticLink(SAMLToken token, GetTherapeuticLinkRequest request) throws TechnicalConnectorException, TherLinkBusinessConnectorException { GetTherapeuticLinkResponse response = null; try { GenericRequest service = ServiceFactory.getTherLinkPort(token); service.setPayload((Object)request); service.setSoapAction("urn:be:fgov:ehealth:therlink:protocol:v1:GetTherapeuticLink"); GenericResponse xmlResponse = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(service); response = (GetTherapeuticLinkResponse)xmlResponse.asObject(GetTherapeuticLinkResponse.class); return response; } catch (MalformedURLException var6) { LOG.error(var6.getMessage()); throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.MALFORMED_URL, new Object[]{var6.getMessage(), var6}); } catch (SOAPException var7) { LOG.error(var7.getMessage()); throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 11
Source File: GenericWsSenderImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public Node sendSamlSecured(String url, Document payload, Element assertion, Credential credential, String soapAction) throws TechnicalConnectorException { GenericRequest request = new GenericRequest(); request.setPayload(payload); request.setEndpoint(url); if (soapAction != null && soapAction.isEmpty()) { request.setSoapAction(soapAction); } SAMLToken token = SAMLTokenFactory.getInstance().createSamlToken(assertion, credential); request.setHandlerChain((new HandlerChain()).register(HandlerPosition.SECURITY, new SAMLHolderOfKeyHandler(token)).register(HandlerPosition.SECURITY, new SoapActionHandler())); request.setDefaultHandlerChain(); try { return this.send(request).asNode(); } catch (SOAPException var9) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var9, new Object[]{var9.getMessage()}); } }
Example 12
Source File: GenericWsSenderImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public Node sendCertificateSecured(String url, Document payload, X509Certificate certificate, PrivateKey privateKey, String soapAction) throws TechnicalConnectorException { GenericRequest request = new GenericRequest(); request.setPayload(payload); request.setEndpoint(url); if (soapAction != null && soapAction.isEmpty()) { request.setSoapAction(soapAction); } request.setCertificateSecured(certificate, privateKey); request.setHandlerChain((new HandlerChain()).register(HandlerPosition.SECURITY, new CertificateCallback(certificate, privateKey)).register(HandlerPosition.SECURITY, new SoapActionHandler())); request.setDefaultHandlerChain(); try { return this.send(request).asNode(); } catch (SOAPException var8) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var8, new Object[]{var8.getMessage()}); } }
Example 13
Source File: AbstractConsultationServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
protected D obtainCompleteness(X509Certificate certificate, PrivateKey privateKey, C consultRequest) throws TechnicalConnectorException { if (certificate != null && privateKey != null) { GenericRequest request = ServiceFactory.getTSConsultService(certificate, privateKey); request.setPayload(consultRequest); try { return be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(request).asObject(this.clazzD); } catch (SOAPException var6) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, new Object[]{var6.getMessage(), var6}); } } else { TechnicalConnectorExceptionValues errorValue = TechnicalConnectorExceptionValues.SECURITY_NO_CERTIFICATE; LOG.debug("\t## " + errorValue.getMessage()); throw new TechnicalConnectorException(errorValue, (Throwable)null, new Object[0]); } }
Example 14
Source File: ChapterIVServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public final ConsultChap4MedicalAdvisorAgreementResponse consultChap4MedicalAdvisorAgreement(SAMLToken token, ConsultChap4MedicalAdvisorAgreementRequest request) throws ChapterIVBusinessConnectorException, TechnicalConnectorException, SessionManagementException { try { this.sessionValidator.validateSession(); GenericRequest service = ServiceFactory.getConsultationService(token); service.setPayload((Object)request); service.setSoapAction("urn:be:fgov:ehealth:chap4:protocol:v1:ConsultChap4MedicalAdvisorAgreement"); GenericResponse xmlResponse = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(service); ConsultChap4MedicalAdvisorAgreementResponse response = (ConsultChap4MedicalAdvisorAgreementResponse)xmlResponse.asObject(ConsultChap4MedicalAdvisorAgreementResponse.class); this.replyValidator.validateReplyStatus((ResponseType)response); return response; } catch (MalformedURLException var6) { String fileTypeDescription = "Chapter IV Consultation file"; throw new ChapterIVBusinessConnectorException(ChapterIVBusinessConnectorExceptionValues.MALFORMED_URL, var6, new Object[]{fileTypeDescription}); } catch (SOAPException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 15
Source File: IntraHubServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
public GetHCPartyConsentResponse getHCPartyConsent(SAMLToken token, GetHCPartyConsentRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException { request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build()); try { GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:GetHCPartyConsent"); genReq.setPayload((Object)request); GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq); return (GetHCPartyConsentResponse)genResp.asObject(GetHCPartyConsentResponse.class); } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } catch (WebServiceException var6) { throw ServiceHelper.handleWebServiceException(var6); } catch (MalformedURLException var7) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()}); } }
Example 16
Source File: TarificationSessionServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
public TarificationConsultationResponse consultTarification(TarificationConsultationRequest request) throws TechnicalConnectorException { try { this.sessionValidator.validateSession(); GenericRequest service = ServiceFactory.getTarificationService(Session.getInstance().getSession().getSAMLToken()); service.setPayload((Object)request); GenericResponse xmlResponse = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(service); TarificationConsultationResponse response = (TarificationConsultationResponse)xmlResponse.asObject(TarificationConsultationResponse.class); return response; } catch (SOAPException var5) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()}); } }
Example 17
Source File: STSServiceWsTrustImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
public Element renewToken(Credential headerCredentials, Credential bodyCredentials, Element samlToken, int validity) throws TechnicalConnectorException { try { Element renewPayload = ConnectorXmlUtils.toElement(ConnectorIOUtils.convertStreamToString(ConnectorIOUtils.getResourceAsStream("/wstrust/renew.samlv11.template.xml")).getBytes()); renewPayload.setAttributeNS("http://docs.oasis-open.org/ws-sx/ws-trust/200512", "Context", IdGeneratorFactory.getIdGenerator("uuid").generateId()); NodeList embeddedList = renewPayload.getElementsByTagNameNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Embedded"); Element embedded = (Element)embeddedList.item(0); embedded.setAttributeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "wsu:Id", "token-" + IdGeneratorFactory.getIdGenerator("uuid").generateId()); Node samlTokenNode = renewPayload.getOwnerDocument().importNode(samlToken, true); embedded.appendChild(samlTokenNode); return this.processRequest(headerCredentials, bodyCredentials, renewPayload); } catch (SOAPException var9) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var9, new Object[]{var9.getMessage()}); } }
Example 18
Source File: SsinHistoryTokenServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private <T extends StatusResponseType> T invoke(SAMLToken token, RequestType request, Class<T> clazz) throws TechnicalConnectorException { try { GenericRequest service = TokenServiceFactory.getService(token); service.setPayload(request); service.setSoapAction(soapActions.get(clazz)); T response = ServiceFactory.getGenericWsSender().send(service).asObject(clazz); this.ehealthReplyValidator.validateReplyStatus(response); return response; } catch (SOAPException ex) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, ex, ex.getMessage()); } }
Example 19
Source File: GenAsyncServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
protected <T> T invoke(SAMLToken token, Object request, WsAddressingHeader header, Class<T> clazz) throws GenAsyncBusinessConnectorException, TechnicalConnectorException { try { this.sessionValidator.validateSession(); GenericRequest genReq = build(token, this.serviceName); genReq.setPayload(request, new XOPFeature(this.threshold)); genReq.setWSAddressing(header); return ServiceFactory.getGenericWsSender().send(genReq).asObject(clazz); } catch (SOAPException var6) { throw new GenAsyncBusinessConnectorException(GenAsyncBusinessConnectorExceptionValues.TARGET_SERVICE_ERROR, var6, new Object[]{var6.getMessage()}); } }
Example 20
Source File: SingleSignOnServiceImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private Element invokeSecureTokenService(String template) throws TechnicalConnectorException { try { GenericRequest request = new GenericRequest(); request.setEndpoint(this.config.getProperty("endpoint.sts.sso")); request.setCredential(this.getSamlToken(), TokenType.SAML); request.setSoapAction("urn:be:fgov:ehealth:sts:protocol:v1:RequestSecurityToken"); request.setPayload(template); return (Element)ServiceFactory.getGenericWsSender().send(request).asNode(); } catch (SOAPException var3) { throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var3, new Object[]{var3.getMessage()}); } }