Search in sources :

Example 1 with MessageCreationException

use of com.sun.xml.ws.protocol.soap.MessageCreationException in project metro-jax-ws by eclipse-ee4j.

the class SOAPBindingCodec method decode.

@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    if (contentType == null) {
        contentType = xmlMimeType;
    }
    packet.setContentType(new ContentTypeImpl(contentType));
    preDecode(packet);
    try {
        if (isMultipartRelated(contentType))
            // parse the multipart portion and then decide whether it's MTOM or SwA
            super.decode(in, contentType, packet);
        else if (isFastInfoset(contentType)) {
            if (!ignoreContentNegotiationProperty && packet.contentNegotiation == ContentNegotiation.none)
                throw noFastInfosetForDecoding();
            useFastInfosetForEncoding = true;
            fiSoapCodec.decode(in, contentType, packet);
        } else
            xmlSoapCodec.decode(in, contentType, packet);
    } catch (RuntimeException we) {
        if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) {
            throw we;
        } else {
            throw new MessageCreationException(version, we);
        }
    }
    postDecode(packet);
}
Also used : MessageCreationException(com.sun.xml.ws.protocol.soap.MessageCreationException) UnsupportedMediaException(com.sun.xml.ws.server.UnsupportedMediaException) ExceptionHasMessage(com.sun.xml.ws.api.message.ExceptionHasMessage)

Example 2 with MessageCreationException

use of com.sun.xml.ws.protocol.soap.MessageCreationException in project metro-jax-ws by eclipse-ee4j.

the class SOAPBindingCodec method decode.

@Override
public void decode(ReadableByteChannel in, String contentType, Packet packet) {
    if (contentType == null) {
        throw new UnsupportedMediaException();
    }
    preDecode(packet);
    try {
        if (isMultipartRelated(contentType))
            super.decode(in, contentType, packet);
        else if (isFastInfoset(contentType)) {
            if (packet.contentNegotiation == ContentNegotiation.none)
                throw noFastInfosetForDecoding();
            useFastInfosetForEncoding = true;
            fiSoapCodec.decode(in, contentType, packet);
        } else
            xmlSoapCodec.decode(in, contentType, packet);
    } catch (RuntimeException we) {
        if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) {
            throw we;
        } else {
            throw new MessageCreationException(version, we);
        }
    }
    postDecode(packet);
}
Also used : MessageCreationException(com.sun.xml.ws.protocol.soap.MessageCreationException) UnsupportedMediaException(com.sun.xml.ws.server.UnsupportedMediaException) ExceptionHasMessage(com.sun.xml.ws.api.message.ExceptionHasMessage)

Aggregations

ExceptionHasMessage (com.sun.xml.ws.api.message.ExceptionHasMessage)2 MessageCreationException (com.sun.xml.ws.protocol.soap.MessageCreationException)2 UnsupportedMediaException (com.sun.xml.ws.server.UnsupportedMediaException)2