Java Code Examples for javax.xml.soap.SOAPConstants#URI_NS_SOAP_1_2_ENVELOPE

The following examples show how to use javax.xml.soap.SOAPConstants#URI_NS_SOAP_1_2_ENVELOPE . 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: Soap12Decoder.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractSoap<?> createFault(DecodingException de) {
    SoapFault fault = new SoapFault();
    fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
    fault.setLocale(Locale.ENGLISH);
    fault.setFaultReason(getFaultReasons(de));
    SoapRequest r = new SoapRequest(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE, SOAPConstants.SOAP_1_2_PROTOCOL);
    r.setSoapFault(fault);
    return r;
}
 
Example 2
Source File: WebServiceListener.java    From iaf with Apache License 2.0 5 votes vote down vote up
@Override
public String processRequest(String correlationId, String message, Map<String, Object> requestContext) throws ListenerException {
	if (attachmentSessionKeysList.size() > 0) {
		XmlBuilder xmlMultipart = new XmlBuilder("parts");
		for(String attachmentSessionKey: attachmentSessionKeysList) {
			//<parts><part type=\"file\" name=\"document.pdf\" sessionKey=\"part_file\" size=\"12345\" mimeType=\"application/octet-stream\"/></parts>
			XmlBuilder part = new XmlBuilder("part");
			part.addAttribute("name", attachmentSessionKey);
			part.addAttribute("sessionKey", attachmentSessionKey);
			part.addAttribute("mimeType", "application/octet-stream");
			xmlMultipart.addSubElement(part);
		}
		requestContext.put(getMultipartXmlSessionKey(), xmlMultipart.toXML());
	}

	if (isSoap()) {
		try {
			log.debug(getLogPrefix()+"received SOAPMSG [" + message + "]");
			String request = soapWrapper.getBody(message);
			String result = super.processRequest(correlationId, request, requestContext);

			String soapNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
			String soapProtocol = (String) requestContext.get("soapProtocol");
			if(SOAPConstants.SOAP_1_2_PROTOCOL.equals(soapProtocol))
				soapNamespace = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;

			String reply = soapWrapper.putInEnvelope(result, null, null, null, null, soapNamespace, null, false);
			log.debug(getLogPrefix()+"replied SOAPMSG [" + reply + "]");
			return reply;
		} catch (Exception e) {
			throw new ListenerException(e);
		}
	}
	else
		return super.processRequest(correlationId, message, requestContext);
}
 
Example 3
Source File: Soap12StringDecoder.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
public Soap12StringDecoder() {
    super(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE);
    LOGGER.debug("Decoder for the following keys initialized successfully: {}!", Joiner.on(", ").join(getKeys()));
}
 
Example 4
Source File: Soap12Decoder.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
public Soap12Decoder() {
    super(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE);
    LOGGER.debug("Decoder for the following keys initialized successfully: {}!", Joiner.on(", ").join(getKeys()));
}
 
Example 5
Source File: SOAPPart1_2Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public String getSOAPNamespace() {
    return SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
}