com.sun.xml.internal.ws.api.message.Messages Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.message.Messages. 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: SOAPHandlerProcessor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #2
Source File: SOAPHandlerProcessor.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #3
Source File: SOAPHandlerProcessor.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #4
Source File: SOAPHandlerProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #5
Source File: SOAPHandlerProcessor.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #6
Source File: SOAPHandlerProcessor.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #7
Source File: SOAPHandlerProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #8
Source File: SOAPHandlerProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
Example #9
Source File: FastInfosetCodec.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #10
Source File: FastInfosetCodec.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #11
Source File: XMLHandlerProcessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #12
Source File: FastInfosetCodec.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #13
Source File: XMLHandlerProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #14
Source File: FastInfosetCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #15
Source File: XMLHandlerProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #16
Source File: FastInfosetCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #17
Source File: XMLHandlerProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #18
Source File: FastInfosetCodec.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #19
Source File: XMLHandlerProcessor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #20
Source File: FastInfosetCodec.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #21
Source File: XMLHandlerProcessor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #22
Source File: FastInfosetCodec.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
Example #23
Source File: XMLHandlerProcessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #24
Source File: XMLHandlerProcessor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
Example #25
Source File: XMLProviderArgumentBuilder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Message getResponseMessage(Source source) {
    return Messages.createUsingPayload(source, SOAPVersion.SOAP_11);
}
 
Example #26
Source File: SOAPProviderArgumentBuilder.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected Message getResponseMessage(SOAPMessage soapMsg) {
    return Messages.create(soapMsg);
}
 
Example #27
Source File: SOAPProviderArgumentBuilder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected Message getResponseMessage(Source source) {
    return Messages.createUsingPayload(source, soapVersion);
}
 
Example #28
Source File: SOAPProviderArgumentBuilder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected Message getResponseMessage(Source source) {
    return Messages.create(source, soapVersion);
}
 
Example #29
Source File: SOAPProviderArgumentBuilder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected Message getResponseMessage(SOAPMessage soapMsg) {
    return Messages.create(soapMsg);
}
 
Example #30
Source File: SOAPProviderArgumentBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected Message getResponseMessage(SOAPMessage soapMsg) {
    return Messages.create(soapMsg);
}