public String getMessageID() { AttributedURIType messageId = implementation.getMessageID(); return (messageId != null ? messageId.getValue() : null); }
/** * Get MessageId from WS Addressing properties * * @param message * @return message id */ private String getMessageId(Message message) { AddressingProperties addrProp = ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message), false); return addrProp != null && addrProp.getMessageID() != null ? addrProp.getMessageID().getValue() : UUID.randomUUID().toString(); }
/** * Get MessageId from WS Addressing properties * * @param message * @return message id */ private String getMessageId(Message message) { AddressingProperties addrProp = ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message), false); return addrProp != null && addrProp.getMessageID() != null ? addrProp.getMessageID().getValue() : UUID.randomUUID().toString(); }
/** * Get MessageId string. * if enforceMessageIDTransfer=true or WS-Addressing enabled explicitly (i.e with <wsa:addressing/> feature), * then MessageId is not null and conform with the definition in the WS-Addressing Spec; * if enforceMessageIDTransfer=false and WS-Addressing doesn't enable, * then MessageId is null. * @param message the message * @return the message id */ private String getMessageId(Message message) { String messageId = null; AddressingProperties addrProp = ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message)); if (addrProp != null && addrProp.getMessageID() != null) { messageId = addrProp.getMessageID().getValue(); } return messageId; }
/** * Get MessageId string. * if enforceMessageIDTransfer=true or WS-Addressing enabled explicitly (i.e with <wsa:addressing/> feature), * then MessageId is not null and conform with the definition in the WS-Addressing Spec; * if enforceMessageIDTransfer=false and WS-Addressing doesn't enable, * then MessageId is null. * @param message the message * @return the message id */ private String getMessageId(Message message) { String messageId = null; AddressingProperties addrProp = ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message)); if (addrProp != null && addrProp.getMessageID() != null) { messageId = addrProp.getMessageID().getValue(); } return messageId; }
/** * Cache exchange for correlated response * * @param message the current message * @param maps the addressing properties */ private void cacheExchange(SoapMessage message, AddressingProperties maps) { if (ContextUtils.isRequestor(message) && !message.getExchange().isOneWay()) { uncorrelatedExchanges.put(maps.getMessageID().getValue(), message.getExchange()); } }
/** * Cache exchange for correlated response * * @param message the current message * @param maps the addressing properties */ private void cacheExchange(SoapMessage message, AddressingProperties maps) { if (ContextUtils.isRequestor(message) && !message.getExchange().isOneWay()) { uncorrelatedExchanges.put(maps.getMessageID().getValue(), message.getExchange()); } }
private String getMessageID() { String id = null; if (context.getMessageContext() != null) { String property = JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND; AddressingProperties maps = (AddressingProperties) context.getMessageContext().get(property); id = maps != null && maps.getMessageID() != null ? maps.getMessageID().getValue() : null; } return id; } }
String id = maps.getMessageID().getValue(); if (id == null) { return "expected MessageID MAP";
if (maps.getMessageID() != null) { returnMap.put(Names.WSA_MESSAGEID_NAME, maps.getMessageID() .getValue());
? ContextUtils.retrieveMAPs(outmsg, false, true, false) : null; if (outp == null || !outp.getMessageID().getValue().equals(maps.getRelatesTo().getValue())) { LOG.log(Level.WARNING, "CORRELATION_FAILURE_MSG"); message.getInterceptorChain().abort(); maps = ContextUtils.retrieveMAPs(m, false, true, false); if (maps != null) { Exchange ex = uncorrelatedExchanges.get(maps.getMessageID().getValue()); if (ex == message.getExchange()) { uncorrelatedExchanges.remove(maps.getMessageID().getValue()); LOG.log(Level.WARNING, "RESPONSE_NOT_USING_WSADDRESSING"); maps = ContextUtils.retrieveMAPs(m, false, true, false); if (maps != null) { uncorrelatedExchanges.remove(maps.getMessageID().getValue());
&& maps != null) { uncorrelatedExchanges.remove(maps.getMessageID().getValue()); } else if (!ContextUtils.isRequestor(message) && maps == null
&& maps != null) { uncorrelatedExchanges.remove(maps.getMessageID().getValue()); } else if (!ContextUtils.isRequestor(message) && maps == null
/** * check if MessageID exists in the message, if not, only generate new MessageID for outbound message. * @param message */ private void checkMessageID(Message message) { if (!MessageUtils.isOutbound(message)) return; AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message)); if (maps == null) { maps = new AddressingProperties(); } if (maps.getMessageID() == null) { String messageID = ContextUtils.generateUUID(); boolean isRequestor = ContextUtils.isRequestor(message); maps.setMessageID(ContextUtils.getAttributedURI(messageID)); ContextUtils.storeMAPs(maps, message, ContextUtils.isOutbound(message), isRequestor); } }
/** * check if MessageID exists in the message, if not, only generate new MessageID for outbound message. * @param message */ private void checkMessageID(Message message) { if (!MessageUtils.isOutbound(message)) return; AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message)); if (maps == null) { maps = new AddressingProperties(); } if (maps.getMessageID() == null) { String messageID = ContextUtils.generateUUID(); boolean isRequestor = ContextUtils.isRequestor(message); maps.setMessageID(ContextUtils.getAttributedURI(messageID)); ContextUtils.storeMAPs(maps, message, ContextUtils.isOutbound(message), isRequestor); } }
/** * Assemble the generic MAPs (for both requests and responses). * * @param message the current message * @return AddressingProperties containing the generic MAPs */ private AddressingProperties assembleGeneric(Message message) { AddressingProperties maps = getMAPs(message, true, true); // MessageID if (maps.getMessageID() == null) { String messageID = ContextUtils.generateUUID(); maps.setMessageID(ContextUtils.getAttributedURI(messageID)); } // Action if (ContextUtils.hasEmptyAction(maps)) { maps.setAction(InternalContextUtils.getAction(message)); if (ContextUtils.hasEmptyAction(maps) && ContextUtils.isOutbound(message)) { maps.setAction(ContextUtils.getAttributedURI(getActionUri(message, true))); } } return maps; }
/** * Assemble the generic MAPs (for both requests and responses). * * @param message the current message * @return AddressingProperties containing the generic MAPs */ private AddressingProperties assembleGeneric(Message message) { AddressingProperties maps = getMAPs(message, true, true); // MessageID if (maps.getMessageID() == null) { String messageID = ContextUtils.generateUUID(); maps.setMessageID(ContextUtils.getAttributedURI(messageID)); } // Action if (ContextUtils.hasEmptyAction(maps)) { maps.setAction(InternalContextUtils.getAction(message)); if (ContextUtils.hasEmptyAction(maps) && ContextUtils.isOutbound(message)) { maps.setAction(ContextUtils.getAttributedURI(getActionUri(message, true))); } } return maps; }
private CallContext setupCallContext( SoapMessage message, Header callHeader, Header callbackHeader) throws Fault { final AddressingProperties maps = getAddressingProperties(message); if (maps == null) { throw new IllegalStateException( "Request-Callback enabled but no WS-Addressing headers set. "); } CallContext ctx = new CallContext(); message.put(RequestCallbackFeature.CALLCONTEXT_PROPERTY_NAME, ctx); final QName operationName = QName.valueOf(maps.getAction().getValue()); if (!isGenericOperation(operationName)) { ctx.setOperationName(operationName); } ctx.setCallId(valueOf(callHeader)); if (callbackHeader != null) { ctx.setCallbackId(valueOf(callbackHeader)); } ctx.setRequestId(maps.getMessageID().getValue()); ctx.setReplyToAddress(maps.getReplyTo().getAddress().getValue()); ctx.setCorrelationId(getCorrelationId(message)); // Try to get SAM flowId in request message // to store it in CallContext for subsequent use // in callback message if (callbackHeader == null) { setupFlowId(message); } fillCallContext(ctx, message); return ctx; }
@Override protected void process(SoapMessage message) { if (isGET(message)) { return; } T auditDataset = getAuditDataset(message); auditDataset.setRemoteAddress((String) message.get(Message.ENDPOINT_ADDRESS)); auditDataset.setDestinationUserId((String) message.get(Message.ENDPOINT_ADDRESS)); enrichAuditDatasetFromXuaToken(message, Header.Direction.DIRECTION_OUT, auditDataset); Object request = extractPojo(message); // Get request payload, handle different variants thereby: // a) for HL7v3-based transactions, payload corresponds to the "main" message; // b) for ebXML-based transactions, rely on the {@link OutPayloadExtractorInterceptor}. if (wsTransactionConfiguration.isAuditRequestPayload()) { if (request instanceof String) { auditDataset.setRequestPayload((String) request); } else { auditDataset.setRequestPayload(message.getContent(StringPayloadHolder.class)); } } getAuditStrategy().enrichAuditDatasetFromRequest(auditDataset, request, message); // when the invocation is asynchronous: store audit dataset into the correlator AddressingProperties props = (AddressingProperties) message.get(JAXWSAConstants.ADDRESSING_PROPERTIES_OUTBOUND); if (props != null && (Boolean.TRUE.equals(message.getContextualProperty(AsynchronyCorrelator.FORCE_CORRELATION)) || ! Names.WSA_ANONYMOUS_ADDRESS.equals(props.getReplyTo().getAddress().getValue()))) { correlator.storeAuditDataset(props.getMessageID().getValue(), auditDataset); } }
seq.setCorrelationID(maps.getMessageID().getValue()); destination.addSequence(seq); LOG.fine("returning " + createResponse);