Java Code Examples for javax.xml.soap.SOAPException

The following examples show how to use javax.xml.soap.SOAPException. These examples are extracted from open source projects. 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
public String sendSamlSecured(String url, String 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);
   }

   request.setEndpoint(url);
   request.setDefaultHandlerChain();
   request.setHandlerChain((new HandlerChain()).register(HandlerPosition.SECURITY, new SoapActionHandler()));
   request.setSamlSecured(assertion, credential);

   try {
      return this.send(request).asString();
   } catch (SOAPException var8) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var8, new Object[]{var8.getMessage()});
   }
}
 
Example 2
public boolean handleOutbound(SOAPMessageContext context) {
   Boolean wsAddressingUse = context.get("be.ehealth.technicalconnector.handler.WsAddressingHandlerV200508.use") == null ? Boolean.FALSE : (Boolean)context.get("be.ehealth.technicalconnector.handler.WsAddressingHandlerV200508.use");
   if (wsAddressingUse.booleanValue()) {
      try {
         WsAddressingHeader header = (WsAddressingHeader)context.get("be.ehealth.technicalconnector.handler.WsAddressingHandlerV200508");
         if (header == null) {
            LOG.warn("No WsAddressingHeader in the requestMap. Skipping the WsAddressingHandler.");
            return true;
         }

         SOAPHeader soapHeader = getSOAPHeader(context);
         this.processRequiredElements(header, soapHeader);
         this.processOptionalElements(header, soapHeader);
         context.getMessage().saveChanges();
      } catch (SOAPException var5) {
         LOG.error("Error while generating WS-Addressing header", var5);
      }
   } else {
      LOG.warn("WsAddressingHandler is configured but be.ehealth.technicalconnector.handler.WsAddressingHandlerV200508.useproperty was not present or set to FALSE.");
   }

   return true;
}
 
Example 3
public Node sendUnsecured(String url, Document payload, String soapAction) throws TechnicalConnectorException {
   GenericRequest request = new GenericRequest();
   request.setPayload(payload);
   if (soapAction != null && soapAction.isEmpty()) {
      request.setSoapAction(soapAction);
   }

   request.setEndpoint(url);
   request.setDefaultHandlerChain();
   request.setHandlerChain((new HandlerChain()).register(HandlerPosition.SECURITY, new SoapActionHandler()));

   try {
      return this.send(request).asNode();
   } catch (SOAPException var6) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var6, new Object[]{var6.getMessage()});
   }
}
 
Example 4
public Element getToken(Credential headerCredentials, Credential bodyCredentials, List<SAMLAttribute> attributes, List<SAMLAttributeDesignator> designators, String authenticationMethod, String nameQualifier, String value, String subjectConfirmationMethod, int validity) throws TechnicalConnectorException {
   try {
      Element issuePayload = null;
      if ("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key".equals(subjectConfirmationMethod)) {
         issuePayload = this.issueHokToken(bodyCredentials, attributes, designators, validity);
      } else {
         if (!"urn:oasis:names:tc:SAML:1.0:cm:sender-vouches".equals(subjectConfirmationMethod)) {
            throw new UnsupportedOperationException("SubjectConfirmationMethod [" + subjectConfirmationMethod + "] not supported.");
         }

         SAMLNameIdentifier nameId = this.generateNameIdentifier(bodyCredentials, nameQualifier, value);
         issuePayload = this.issueSVToken(nameId, authenticationMethod, attributes, designators, validity);
      }

      return this.processRequest(headerCredentials, bodyCredentials, issuePayload);
   } catch (SOAPException var12) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var12, new Object[]{var12.getMessage()});
   } catch (DOMException var13) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var13, new Object[]{var13.getMessage()});
   }
}
 
Example 5
private void getMessageID(SOAPMessage msg) throws SOAPException {
   SOAPHeader header = msg.getSOAPHeader();
   if (header != null && header.getChildElements().hasNext()) {
      Node elementsResponseHeader = (Node)header.getChildElements().next();
      NodeList elementsheader = elementsResponseHeader.getChildNodes();

      for(int i = 0; i < elementsheader.getLength(); ++i) {
         org.w3c.dom.Node element = elementsheader.item(i);
         if (element.getLocalName() != null && element.getLocalName().equals("MessageID")) {
            LOG.info("The message id of the response: " + element.getNodeValue());
            break;
         }
      }
   }

}
 
Example 6
private String getSoapFaultCode(SOAPMessage msg) throws SOAPException{
  	SOAPPart part = msg.getSOAPPart();
if(part !=null){
	SOAPEnvelope soapEnvelope = part.getEnvelope();
	if(soapEnvelope !=null){
	SOAPBody body = soapEnvelope.getBody();
		if(body !=null){
			SOAPFault fault=body.getFault();
			if(fault !=null && !StringUtils.isEmpty(fault.getFaultString()) && fault.getFaultString().contains("SOA-")){
				return fault.getFaultString();
			}
		}
	}
}
return null;
  }
 
Example 7
Source Project: hottub   Source File: SAAJMetaFactoryImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected  MessageFactory newMessageFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "MessageFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating MessageFactory");
    }
}
 
Example 8
Source Project: onvif-java-lib   Source File: InitialDevices.java    License: Apache License 2.0 6 votes vote down vote up
public Profile createProfile(String name) {
	CreateProfile request = new CreateProfile();
	CreateProfileResponse response = new CreateProfileResponse();

	request.setName(name);

	try {
		response = (CreateProfileResponse) soap.createSOAPMediaRequest(request, response, true);
	}
	catch (SOAPException | ConnectException e) {
		e.printStackTrace();
		return null;
	}

	if (response == null) {
		return null;
	}

	return response.getProfile();
}
 
Example 9
public GetInsurabilityResponse getInsurability(SAMLToken token, GetInsurabilityAsXmlOrFlatRequestType requestType) throws GenInsBusinessConnectorException, TechnicalConnectorException, SessionManagementException {
   GetInsurabilityResponse response = null;
   GetInsurabilityRequest request = new GetInsurabilityRequest();
   this.dozer(requestType, request);

   try {
      GenericRequest service = ServiceFactory.getGeninsPort(token);
      service.setPayload((Object)request);
      GenericResponse xmlResponse = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(service);
      response = (GetInsurabilityResponse)xmlResponse.asObject(GetInsurabilityResponse.class);
      return response;
   } catch (MalformedURLException var7) {
      LOG.error("GeninsServiceImpl : " + var7.getMessage());
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.MALFORMED_URL, var7, new Object[]{"genins " + var7.getMessage()});
   } catch (SOAPException var8) {
      LOG.error("GeninsServiceImpl : " + var8.getMessage());
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var8, new Object[]{var8.getMessage()});
   }
}
 
Example 10
Source Project: jdk8u60   Source File: SOAP11Fault.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Throwable getProtocolException() {
    try {
        SOAPFault fault = SOAPVersion.SOAP_11.getSOAPFactory().createFault(faultstring, faultcode);
        fault.setFaultActor(faultactor);
        if(detail != null){
            Detail d = fault.addDetail();
            for(Element det : detail.getDetails()){
                Node n = fault.getOwnerDocument().importNode(det, true);
                d.appendChild(n);
            }
        }
        return new ServerSOAPFaultException(fault);
    } catch (SOAPException e) {
        throw new WebServiceException(e);
    }
}
 
Example 11
protected B obtainTimestamp(X509Certificate certificate, PrivateKey privateKey, A 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.clazzB);
      } 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 12
protected  SOAPFactory newSOAPFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
        return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
        return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
        return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "SOAPFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating SOAPFactory");
    }
}
 
Example 13
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example 14
Source Project: openjdk-jdk8u   Source File: SOAP11Fault.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Throwable getProtocolException() {
    try {
        SOAPFault fault = SOAPVersion.SOAP_11.getSOAPFactory().createFault(faultstring, faultcode);
        fault.setFaultActor(faultactor);
        if(detail != null){
            Detail d = fault.addDetail();
            for(Element det : detail.getDetails()){
                Node n = fault.getOwnerDocument().importNode(det, true);
                d.appendChild(n);
            }
        }
        return new ServerSOAPFaultException(fault);
    } catch (SOAPException e) {
        throw new WebServiceException(e);
    }
}
 
Example 15
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    //TODO: SAAJ returns null instead of throwing SOAPException,
    // when there is no SOAPHeader in the message,
    // which leads to NPE.
    try {
        SOAPHeader header = saaj.getSOAPHeader();
        if (header == null) {
            header = saaj.getSOAPPart().getEnvelope().addHeader();
        }
        Element node = (Element)infoset.writeTo(header);
        node.setAttributeNS(AddressingVersion.W3C.nsUri,AddressingVersion.W3C.getPrefix()+":"+IS_REFERENCE_PARAMETER,TRUE_VALUE);
    } catch (XMLStreamBufferException e) {
        throw new SOAPException(e);
    }
}
 
Example 16
public String sendXML(String payload, String endpoint, String soapAction) throws TechnicalConnectorException, SessionManagementException {
   GenericWsSender sender = ServiceFactory.getGenericWsSender();
   if (this.sessionValidator.validateSession()) {
      GenericRequest request = new GenericRequest();
      request.setEndpoint(endpoint);
      request.setSoapAction(soapAction);
      request.setCredentialFromSession(TokenType.SAML);
      request.setPayload(payload);

      try {
         return sender.send(request).asString();
      } catch (SOAPException var7) {
         throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var7, new Object[]{var7.getMessage()});
      }
   } else {
      return null;
   }
}
 
Example 17
Source Project: jolie   Source File: SoapProtocol.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
private void groupProcessing(
	Value value,
	XSElementDecl xsDecl,
	SOAPElement element,
	SOAPEnvelope envelope,
	boolean first,
	XSModelGroup modelGroup,
	XSSchemaSet sSet,
	String messageNamespace )
	throws SOAPException {

	XSParticle[] children = modelGroup.getChildren();
	XSTerm currTerm;
	for( XSParticle child : children ) {
		currTerm = child.getTerm();
		if( currTerm.isModelGroup() ) {
			groupProcessing( value, xsDecl, element, envelope, first, currTerm.asModelGroup(), sSet,
				messageNamespace );
		} else {
			termProcessing( value, element, envelope, first, currTerm, child.getMaxOccurs(), sSet,
				messageNamespace );
		}
	}
}
 
Example 18
public PutPatientResponse putPatient(SAMLToken token, PutPatientRequest request) throws IntraHubBusinessConnectorException, TechnicalConnectorException {
   request.setRequest(RequestTypeBuilder.init().addGenericAuthor().build());

   try {
      GenericRequest genReq = ServiceFactory.getIntraHubPort(token, "urn:be:fgov:ehealth:interhub:protocol:v1:PutPatient");
      genReq.setPayload((Object)request);
      GenericResponse genResp = be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(genReq);
      return (PutPatientResponse)genResp.asObject(PutPatientResponse.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 19
public boolean handleOutbound(SOAPMessageContext context) {
   try {
      boolean hasSoapAction = false;
      if (context.containsKey("javax.xml.ws.soap.http.soapaction.use")) {
         hasSoapAction = (Boolean)context.get("javax.xml.ws.soap.http.soapaction.use");
      }

      if (hasSoapAction) {
         String soapAction = (String)context.get("javax.xml.ws.soap.http.soapaction.uri");
         LOG.debug("Adding SOAPAction to mimeheader");
         SOAPMessage msg = context.getMessage();
         String[] headers = msg.getMimeHeaders().getHeader("SOAPAction");
         if (headers != null) {
            LOG.warn("Removing SOAPAction with values: " + ArrayUtils.toString(headers));
            msg.getMimeHeaders().removeHeader("SOAPAction");
         }

         msg.getMimeHeaders().addHeader("SOAPAction", soapAction);
         msg.saveChanges();
      }

      return true;
   } catch (SOAPException var6) {
      throw SOAPFaultFactory.newSOAPFaultException("WSSecurity problem: [SOAPACTION]" + var6.getMessage(), var6);
   }
}
 
Example 20
public StaxLazySourceBridge(LazyEnvelopeSource src, SOAPPartImpl soapPart) throws SOAPException {
    super(soapPart);
    lazySource = src;
    final String soapEnvNS = soapPart.getSOAPNamespace();
    try {
        breakpoint = new XMLStreamReaderToXMLStreamWriter.Breakpoint(src.readToBodyStarTag(), saajWriter) {
            @Override
            public boolean proceedAfterStartElement()  {
                if ("Body".equals(reader.getLocalName()) && soapEnvNS.equals(reader.getNamespaceURI()) ){
                    return false;
                } else
                    return true;
            }
        };
    } catch (XMLStreamException e) {
        throw new SOAPException(e);
    }
}
 
Example 21
private void handleDecryption(SOAPMessageContext cxt) {
   try {
      SOAPMessage soapMessage = cxt.getMessage();
      SOAPBody soapBody = soapMessage.getSOAPBody();
      if (soapBody == null) {
         SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
         soapBody = soapEnvelope.getBody();
      }

      FolderDecryptor.decryptFolder(soapBody, this.crypto);
      soapMessage.saveChanges();
   } catch (SOAPException var5) {
      LOG.error("SOAPException when handling the SOAP Body", var5);
      throw new RuntimeException(var5);
   } catch (UnsealConnectorException var6) {
      LOG.error("UnsealConnectorException when handling the SOAP Message: " + var6.getMessage());
      throw new FolderDecryptionRuntimeException(var6.getMessage(), var6);
   } catch (TechnicalConnectorException var7) {
      LOG.error("TechnicalConnectorException when handling the SOAP Message: " + var7.getMessage());
      throw new RuntimeException(var7);
   }
}
 
Example 22
Source Project: openjdk-jdk8u   Source File: StreamHeader.java    License: GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    try {
        // TODO what about in-scope namespaces
        // Not very efficient consider implementing a stream buffer
        // processor that produces a DOM node from the buffer.
        TransformerFactory tf = XmlUtil.newTransformerFactory();
        Transformer t = tf.newTransformer();
        XMLStreamBufferSource source = new XMLStreamBufferSource(_mark);
        DOMResult result = new DOMResult();
        t.transform(source, result);
        Node d = result.getNode();
        if(d.getNodeType() == Node.DOCUMENT_NODE)
            d = d.getFirstChild();
        SOAPHeader header = saaj.getSOAPHeader();
        if(header == null)
            header = saaj.getSOAPPart().getEnvelope().addHeader();
        Node node = header.getOwnerDocument().importNode(d, true);
        header.appendChild(node);
    } catch (Exception e) {
        throw new SOAPException(e);
    }
}
 
Example 23
private <T extends StatusResponseType> T invoke(SAMLToken token, RequestType request, Class<T> clazz) throws TechnicalConnectorException {
   try {
      this.sessionValidator.validateToken(token);
      GenericRequest service = TokenServiceFactory.getService(token);
      service.setPayload((Object)request);
      service.setSoapAction((String)soapActions.get(clazz));
      T response = (StatusResponseType)ServiceFactory.getGenericWsSender().send(service).asObject(clazz);
      this.ehealthReplyValidator.validateReplyStatus(response);
      return response;
   } catch (SOAPException var6) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var6, new Object[]{var6.getMessage()});
   }
}
 
Example 24
public LazyEnvelopeStaxReader(EnvelopeImpl env) throws SOAPException, XMLStreamException {
        super(env);
//        this.env = env;
        bodyQName = new QName(env.getNamespaceURI(), "Body");
        payloadReader = env.getStaxBridge().getPayloadReader();
        int eventType = getEventType();
        while (eventType != START_ELEMENT) {
            eventType = nextTag();
        }
    }
 
Example 25
private <T extends StatusResponseType> T executeOperation(Object request, String operation, Class<T> clazz) throws TechnicalConnectorException {
   try {
      this.sessionValidator.validateSession();
      GenericRequest service = ServiceFactory.getMediprimaConsultationService(Session.getInstance().getSession().getSAMLToken(), operation);
      service.setPayload(request);
      T response = (StatusResponseType)be.ehealth.technicalconnector.ws.ServiceFactory.getGenericWsSender().send(service).asObject(clazz);
      this.replyValidator.validateReplyStatus(response);
      return response;
   } catch (SOAPException var6) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var6, new Object[]{var6.getMessage()});
   }
}
 
Example 26
private static SOAPMessage createSoapMessage() throws SOAPException, UnsupportedEncodingException {
    String xml = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                +"<SOAP-ENV:Body/></SOAP-ENV:Envelope>";
    MessageFactory mFactory = MessageFactory.newInstance();
    SOAPMessage msg = mFactory.createMessage();
    msg.getSOAPPart().setContent(new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8"))));
    return msg;
}
 
Example 27
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 28
public void writeTo(SOAPMessage saaj) throws SOAPException {
    try {
        SOAPHeader header = saaj.getSOAPHeader();
        if (header == null)
            header = saaj.getSOAPPart().getEnvelope().addHeader();
        bridge.marshal(jaxbObject,header);
    } catch (JAXBException e) {
        throw new SOAPException(e);
    }
}
 
Example 29
public CancelAttestationResponse cancelAttestion(SAMLToken token, SendRequestType request) throws TechnicalConnectorException {
   try {
      this.sessionValidator.validateToken(token);
      GenericRequest service = ServiceFactory.getAttestPort(token);
      service.setPayload((Object)request);
      GenericResponse xmlResponse = org.taktik.connector.technical.ws.ServiceFactory.getGenericWsSender().send(service);
      return (CancelAttestationResponse)xmlResponse.asObject(CancelAttestationResponse.class);
   } catch (SOAPException var5) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.ERROR_WS, var5, new Object[]{var5.getMessage()});
   }
}
 
Example 30
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(new QName(getNamespaceURI(), getLocalPart()));
    she.addChildElement(actionLocalName);
    she.addTextNode(action);
    if (soapAction != null) {
        she.addChildElement(soapActionLocalName);
        she.addTextNode(soapAction);
    }
}