/** * Determines if the current message has no response content. * The message has no response content if either: * - the request is oneway and the current message is no partial * response or an empty partial response. * - the request is not oneway but the current message is an empty partial * response. * @param message * @return */ private boolean hasNoResponseContent(Message message) { final boolean ow = isOneWay(message); final boolean pr = MessageUtils.isPartialResponse(message); final boolean epr = MessageUtils.isEmptyPartialResponse(message); //REVISIT may need to provide an option to choose other behavior? // old behavior not suppressing any responses => ow && !pr // suppress empty responses for oneway calls => ow && (!pr || epr) // suppress additionally empty responses for decoupled twoway calls => return (ow && !pr) || epr; }
/** * Determines if the current message has no response content. * The message has no response content if either: * - the request is oneway and the current message is no partial * response or an empty partial response. * - the request is not oneway but the current message is an empty partial * response. * @param message * @return */ private boolean hasNoResponseContent(Message message) { final boolean ow = isOneWay(message); final boolean pr = MessageUtils.isPartialResponse(message); final boolean epr = MessageUtils.isEmptyPartialResponse(message); //REVISIT may need to provide an option to choose other behavior? // old behavior not suppressing any responses => ow && !pr // suppress empty responses for oneway calls => ow && (!pr || epr) // suppress additionally empty responses for decoupled twoway calls => return (ow && !pr) || epr; }
/** * Determines if the current message has no response content. * The message has no response content if either: * - the request is oneway and the current message is no partial * response or an empty partial response. * - the request is not oneway but the current message is an empty partial * response. * @param message * @return */ private boolean hasNoResponseContent(Message message) { final boolean ow = isOneWay(message); final boolean pr = MessageUtils.isPartialResponse(message); final boolean epr = MessageUtils.isEmptyPartialResponse(message); //REVISIT may need to provide an option to choose other behavior? // old behavior not suppressing any responses => ow && !pr // suppress empty responses for oneway calls => ow && (!pr || epr) // suppress additionally empty responses for decoupled twoway calls => return (ow && !pr) || epr; }
/** * Check for NONE ReplyTo value in request-response MEP * @param message the current message * @param maps the incoming MAPs */ private void checkReplyTo(Message message, AddressingProperties maps) { // if ReplyTo address is none then 202 response status is expected // However returning a fault is more appropriate for request-response MEP if (!message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message) && ContextUtils.isNoneAddress(maps.getReplyTo())) { String reason = MessageFormat.format(BUNDLE.getString("REPLYTO_NOT_SUPPORTED_MSG"), maps.getReplyTo().getAddress().getValue()); throw new SoapFault(reason, new QName(Names.WSA_NAMESPACE_NAME, Names.WSA_NONE_ADDRESS)); } }
/** * Check for NONE ReplyTo value in request-response MEP * @param message the current message * @param maps the incoming MAPs */ private void checkReplyTo(Message message, AddressingProperties maps) { // if ReplyTo address is none then 202 response status is expected // However returning a fault is more appropriate for request-response MEP if (!message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message) && ContextUtils.isNoneAddress(maps.getReplyTo())) { String reason = MessageFormat.format(BUNDLE.getString("REPLYTO_NOT_SUPPORTED_MSG"), maps.getReplyTo().getAddress().getValue()); throw new SoapFault(reason, new QName(Names.WSA_NAMESPACE_NAME, Names.WSA_NONE_ADDRESS)); } }
/** * Encode the current RM properties in protocol-specific headers. * * @param message the SOAP message. * @param rmps the current RM properties. */ public static void encode(SoapMessage message, RMProperties rmps) { if (null == rmps) { return; } LOG.log(Level.FINE, "encoding RMPs in SOAP headers"); try { AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, true); ProtocolVariation protocol = ProtocolVariation.findVariant(rmps.getNamespaceURI(), maps.getNamespaceURI()); List<Header> headers = message.getHeaders(); int startSize = headers.size(); protocol.getCodec().buildHeaders(rmps, headers); if (startSize != headers.size() && MessageUtils.isPartialResponse(message)) { // make sure the response is returned as HTTP 200 and not 202 message.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK); } } catch (JAXBException je) { LOG.log(Level.WARNING, "SOAP_HEADER_ENCODE_FAILURE_MSG", je); } }
if (MessageUtils.isPartialResponse(message)) { LOG.fine("Not verifying policies on outbound partial response."); return;
if (MessageUtils.isPartialResponse(message)) { LOG.fine("Not verifying policies on outbound partial response."); return;
if (MessageUtils.isPartialResponse(message)) { LOG.fine("Not verifying policies on inbound partial response."); return;
if (MessageUtils.isPartialResponse(message)) { LOG.fine("Not verifying policies on inbound partial response."); return;
if (MessageUtils.isPartialResponse(message)) { return;
boolean isPartialResponse = MessageUtils.isPartialResponse(msg); RMConstants constants = protocol.getConstants(); RMProperties rmpsOut = RMContextUtils.retrieveRMProperties(msg, true);
@Override public void close(Message message) throws IOException { // set the pseudo status code if not set (REVISIT add this method in MessageUtils to be reused elsewhere?) Integer i = (Integer)message.get(Message.RESPONSE_CODE); if (i == null) { int code = ((message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message)) || MessageUtils.isEmptyPartialResponse(message)) ? 202 : 200; message.put(Message.RESPONSE_CODE, code); } if (Boolean.TRUE.equals(message.getExchange().get(LocalConduit.DIRECT_DISPATCH))) { final Exchange exchange = (Exchange)message.getExchange().get(LocalConduit.IN_EXCHANGE); MessageImpl copy = new MessageImpl(); copy.putAll(message); message.getContent(OutputStream.class).close(); CachedOutputStream stream = message.getContent(CachedOutputStream.class); message.setContent(OutputStream.class, stream); MessageImpl.copyContent(message, copy); copy.setContent(InputStream.class, stream.getInputStream()); stream.releaseTempFileHold(); if (exchange != null && exchange.getInMessage() == null) { exchange.setInMessage(copy); } conduit.getMessageObserver().onMessage(copy); return; } super.close(message); }
@Override public void close(Message message) throws IOException { // set the pseudo status code if not set (REVISIT add this method in MessageUtils to be reused elsewhere?) Integer i = (Integer)message.get(Message.RESPONSE_CODE); if (i == null) { int code = ((message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message)) || MessageUtils.isEmptyPartialResponse(message)) ? 202 : 200; message.put(Message.RESPONSE_CODE, code); } if (Boolean.TRUE.equals(message.getExchange().get(LocalConduit.DIRECT_DISPATCH))) { final Exchange exchange = (Exchange)message.getExchange().get(LocalConduit.IN_EXCHANGE); MessageImpl copy = new MessageImpl(); copy.putAll(message); message.getContent(OutputStream.class).close(); CachedOutputStream stream = message.getContent(CachedOutputStream.class); message.setContent(OutputStream.class, stream); MessageImpl.copyContent(message, copy); copy.setContent(InputStream.class, stream.getInputStream()); stream.releaseTempFileHold(); if (exchange != null && exchange.getInMessage() == null) { exchange.setInMessage(copy); } conduit.getMessageObserver().onMessage(copy); return; } super.close(message); }
boolean isPartialResponse = MessageUtils.isPartialResponse(msg); RMConstants constants = protocol.getConstants(); boolean isLastMessage = RM10Constants.CLOSE_SEQUENCE_ACTION.equals(action);
if (MessageUtils.isPartialResponse(soapMessage)) {
if (MessageUtils.isPartialResponse(message) && message.getExchange().getOutMessage() != null) {
if (MessageUtils.isPartialResponse(message) && message.getExchange().getOutMessage() != null) {