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

The following examples show how to use javax.xml.soap.SOAPConstants#URI_NS_SOAP_1_1_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: Soap11Decoder.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
@Override
protected SoapRequest createFault(DecodingException de) {
    SoapFault fault = new SoapFault();
    fault.setFaultCode(QN_CLIENT);
    fault.setLocale(Locale.ENGLISH);
    fault.setFaultReason(getFaultReasons(de));
    SoapRequest r = new SoapRequest(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, SOAPConstants.SOAP_1_1_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: Fault1_1Impl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}
 
Example 4
Source File: Fault1_1Impl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}
 
Example 5
Source File: Fault1_1Impl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}
 
Example 6
Source File: Soap11Decoder.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
public Soap11Decoder() {
    super(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE);
    LOGGER.debug("Decoder for the following keys initialized successfully: {}!", Joiner.on(", ").join(getKeys()));
}
 
Example 7
Source File: Soap11Decoder.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
/**
 * Parses SOAP 1.1 Envelope to a SOS internal SOAP request.
 *
 * @param doc Request as xml representation
 *
 * @return SOS internal SOAP request
 *
 * @throws DecodingException if an error occurs.
 */
@Override
protected SoapRequest createEnvelope(XmlObject doc) throws DecodingException {
    SoapRequest soapRequest = new SoapRequest(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE,
                                              SOAPConstants.SOAP_1_1_PROTOCOL);
    String soapAction = "";

    try {
        SOAPMessage soapMessageRequest;
        try {
            soapMessageRequest = SoapHelper.getSoapMessageForProtocol(SOAPConstants.SOAP_1_1_PROTOCOL,
                                                                      doc.newInputStream());
        } catch (IOException | SOAPException ioe) {
            throw new NoApplicableCodeException().causedBy(ioe)
                    .withMessage("Error while parsing SOAPMessage from request string!");
        }
        // FIXME well... soapAction is always "" at this point
        // if SOAPAction is not spec conform, create SOAPFault
        if (soapAction.isEmpty() || !soapAction.startsWith(SOAP_ACTION)) {
            SoapFault fault = new SoapFault();
            fault.setFaultCode(QN_CLIENT);
            fault.setFaultReason("The SOAPAction parameter in the HTTP-Header is missing or not valid!");
            fault.setLocale(Locale.ENGLISH);
            soapRequest.setSoapFault(fault);
            soapRequest.setSoapFault(fault);
        } else {
            // trim SOAPAction value
            soapAction = soapAction.replace("\"", "").replace(" ", "").replace(SOAP_ACTION, "").trim();
        }
        try {
            if (soapMessageRequest.getSOAPHeader() != null) {
                soapRequest.setSoapHeader(getSoapHeader(soapMessageRequest.getSOAPHeader()));
            }
            soapRequest.setAction(checkSoapAction(soapAction, soapRequest.getSoapHeader()));
            soapRequest.setSoapBodyContent(getSOAPBodyContent(soapMessageRequest));
        } catch (SOAPException | DecodingException soape) {
            throw new NoApplicableCodeException().causedBy(soape).withMessage("Error while parsing SOAPMessage!");
        }
    } catch (OwsExceptionReport owse) {
        throw new DecodingException(owse);
    }
    return soapRequest;
}
 
Example 8
Source File: Soap11StringDecoder.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
public Soap11StringDecoder() {
    super(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE);
    LOGGER.debug("Decoder for the following keys initialized successfully: {}!", Joiner.on(", ").join(getKeys()));
}
 
Example 9
Source File: Soap11Encoder.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
public Soap11Encoder() {
    super(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE);
    LOGGER.debug("Encoder for the following keys initialized successfully: {}!", Joiner.on(", ").join(getKeys()));
}
 
Example 10
Source File: Fault1_1Impl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}
 
Example 11
Source File: Fault1_1Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}
 
Example 12
Source File: SOAPPart1_1Impl.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_1_ENVELOPE;
}
 
Example 13
Source File: Fault1_1Impl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}
 
Example 14
Source File: Fault1_1Impl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}
 
Example 15
Source File: Fault1_1Impl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected QName getDefaultFaultCode() {
    return new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Server");
}