private boolean isWSAddressingReplyToSpecified(Exchange ex) { AddressingProperties map = ContextUtils.retrieveMAPs(ex.getInMessage(), false, false, false); return map != null && !ContextUtils.isGenericAddress(map.getReplyTo()); } };
/** * The target for the sequence is the first non-anonymous address that a * message is sent to as part of this sequence. It is subsequently used for * as the target of out-of-band protocol messages related to that sequence * that originate from the sequnce source (i.e. TerminateSequence and * LastMessage, but not AckRequested or SequenceAcknowledgement as these are * orignate from the sequence destination). * * @param to */ public synchronized void setTarget(EndpointReferenceType to) { if (target == null && !ContextUtils.isGenericAddress(to)) { target = to; } }
private void checkAddressingResponses(EndpointReferenceType replyTo, EndpointReferenceType faultTo) { if (this.addressingResponses == WSAddressingFeature.AddressingResponses.ALL) { return; } boolean passed = false; boolean anonReply = ContextUtils.isGenericAddress(replyTo); boolean anonFault = ContextUtils.isGenericAddress(faultTo); boolean isAnonymous = anonReply && anonFault; if (WSAddressingFeature.AddressingResponses.ANONYMOUS == addressingResponses && isAnonymous) { passed = true; } else if (WSAddressingFeature.AddressingResponses.NON_ANONYMOUS == addressingResponses && (!anonReply && (!anonFault && faultTo.getAddress() != null) || !anonReply && faultTo == null)) { passed = true; } if (!passed) { String reason = BUNDLE.getString("INVALID_ADDRESSING_PROPERTY_MESSAGE"); QName detail = WSAddressingFeature.AddressingResponses.ANONYMOUS == addressingResponses ? Names.ONLY_ANONYMOUS_ADDRESS_SUPPORTED_QNAME : Names.ONLY_NONANONYMOUS_ADDRESS_SUPPORTED_QNAME; throw new SoapFault(reason, detail); } } /**
private void checkAddressingResponses(EndpointReferenceType replyTo, EndpointReferenceType faultTo) { if (this.addressingResponses == WSAddressingFeature.AddressingResponses.ALL) { return; } boolean passed = false; boolean anonReply = ContextUtils.isGenericAddress(replyTo); boolean anonFault = ContextUtils.isGenericAddress(faultTo); boolean isAnonymous = anonReply && anonFault; if (WSAddressingFeature.AddressingResponses.ANONYMOUS == addressingResponses && isAnonymous) { passed = true; } else if (WSAddressingFeature.AddressingResponses.NON_ANONYMOUS == addressingResponses && (!anonReply && (!anonFault && faultTo.getAddress() != null) || !anonReply && faultTo == null)) { passed = true; } if (!passed) { String reason = BUNDLE.getString("INVALID_ADDRESSING_PROPERTY_MESSAGE"); QName detail = WSAddressingFeature.AddressingResponses.ANONYMOUS == addressingResponses ? Names.ONLY_ANONYMOUS_ADDRESS_SUPPORTED_QNAME : Names.ONLY_NONANONYMOUS_ADDRESS_SUPPORTED_QNAME; throw new SoapFault(reason, detail); } } /**
private boolean isNativeAsyn(Message message) { boolean ret = false; AddressingProperties addressingProperties = (AddressingProperties) message.get(WSAUtils.WSA_HEADERS_INBOUND); if (addressingProperties != null && !ContextUtils.isGenericAddress(addressingProperties.getReplyTo())) { //it's decoupled endpoint, so already switch thread and //use executors, which means underlying transport won't //be block, so we shouldn't rely on continuation in //this case, as the SuspendedInvocationException can't be //caught by underlying transport. We just need pause/resume InterceptorChain //before/after send/receive MessageExchange for async return true; } return ret; }
private boolean isWSAddressingReplyToSpecified(Exchange ex) { AddressingProperties map = ContextUtils.retrieveMAPs(ex.getInMessage(), false, false, false); return map != null && !ContextUtils.isGenericAddress(map.getReplyTo()); } };
private boolean isWSAddressingReplyToSpecified(Exchange ex) { AddressingProperties map = ContextUtils.retrieveMAPs(ex.getInMessage(), false, false, false); return map != null && !ContextUtils.isGenericAddress(map.getReplyTo()); } };
protected boolean isAsyncInvocationSupported(Exchange cxfExchange) { Message cxfMessage = cxfExchange.getInMessage(); Object addressingProperties = cxfMessage.get(CxfConstants.WSA_HEADERS_INBOUND); if (addressingProperties != null && !ContextUtils.isGenericAddress(getReplyTo(addressingProperties))) { //it's decoupled endpoint, so already switch thread and //use executors, which means underlying transport won't //be block, so we shouldn't rely on continuation in //this case, as the SuspendedInvocationException can't be //caught by underlying transport. So we should use the SyncInvocation this time return false; } // we assume it should support AsyncInvocation out of box return true; } private class CxfConsumerInvoker implements Invoker {
faultTo = replyTo; boolean anonReply = ContextUtils.isGenericAddress(replyTo); boolean anonFault = ContextUtils.isGenericAddress(faultTo); boolean onlyAnonymous = anonReply && anonFault; boolean hasAnonymous = anonReply || anonFault;
public void handleFault(SoapMessage message) { if (!ContextUtils.isRequestor(message)) { Exchange exchange = message.getExchange(); Message inMessage = exchange.getInMessage(); final AddressingProperties maps = ContextUtils.retrieveMAPs(inMessage, false, false, true); if (maps != null && !ContextUtils.isGenericAddress(maps.getFaultTo())) { //Just keep the wsa headers to remove the not understand headers if (exchange.getOutMessage() != null) { message = (SoapMessage)exchange.getOutMessage(); } Iterator<Header> iterator = message.getHeaders().iterator(); while (iterator.hasNext()) { Header header = iterator.next(); if (!isWSAHeader(header)) { iterator.remove(); } } exchange.setOneWay(false); exchange.setOutMessage(message); //manually set the action message.put(ContextUtils.ACTION, WSA_ACTION); Destination destination = createDecoupledDestination( exchange, maps.getFaultTo()); exchange.setDestination(destination); } } }
faultTo = replyTo; boolean anonReply = ContextUtils.isGenericAddress(replyTo); boolean anonFault = ContextUtils.isGenericAddress(faultTo); boolean onlyAnonymous = anonReply && anonFault; boolean hasAnonymous = anonReply || anonFault;
public void handleFault(SoapMessage message) { if (!ContextUtils.isRequestor(message)) { Exchange exchange = message.getExchange(); Message inMessage = exchange.getInMessage(); final AddressingProperties maps = ContextUtils.retrieveMAPs(inMessage, false, false, true); if (maps != null && !ContextUtils.isGenericAddress(maps.getFaultTo())) { //Just keep the wsa headers to remove the not understand headers if (exchange.getOutMessage() != null) { message = (SoapMessage)exchange.getOutMessage(); } Iterator<Header> iterator = message.getHeaders().iterator(); while (iterator.hasNext()) { Header header = iterator.next(); if (!isWSAHeader(header)) { iterator.remove(); } } exchange.setOneWay(false); exchange.setOutMessage(message); //manually set the action message.put(ContextUtils.ACTION, WSA_ACTION); Destination destination = createDecoupledDestination( exchange, maps.getFaultTo()); exchange.setDestination(destination); } } }
private void aggregateAddressing( SoapMessage message, String callbackEndpoint, String relatesTo) { final AddressingProperties maps = initAddressingProperties(message); if (callbackEndpoint != null) { EndpointReferenceType replyTo= maps.getReplyTo(); if (replyTo == null || ContextUtils.isGenericAddress(replyTo)) { EndpointReferenceType replyToRef = new EndpointReferenceType(); AttributedURIType address = new AttributedURIType(); address.setValue(callbackEndpoint); replyToRef.setAddress(address); maps.setReplyTo(replyToRef); } } /* Have to comment out "RelatesTo" setting after Upgrade CXF to 3.2.6 if (maps.getRelatesTo() == null) { RelatesToType relatesToAttr = new RelatesToType(); relatesToAttr.setRelationshipType("message"); relatesToAttr.setValue(relatesTo); maps.setRelatesTo(relatesToAttr); }*/ }
if (maps != null && !ContextUtils.isGenericAddress(maps.getFaultTo())) {
if (ContextUtils.isGenericAddress(to)) { org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message( "CREATE_SEQ_ANON_TARGET", LOG,
if (ContextUtils.isGenericAddress(replyTo)) { replyTo = getReplyTo(message, replyTo); if (replyTo == null || (isOneway && !ContextUtils.isGenericAddress(inMAPs.getFaultTo())) {
if (ContextUtils.isGenericAddress(replyTo)) { replyTo = getReplyTo(message, replyTo); if (replyTo == null || (isOneway && !ContextUtils.isGenericAddress(inMAPs.getFaultTo())) {
|| !ContextUtils.isGenericAddress(maps.getReplyTo())) { InternalContextUtils.rebaseResponse(maps.getReplyTo(), maps,
|| !ContextUtils.isGenericAddress(maps.getReplyTo())) { InternalContextUtils.rebaseResponse(maps.getReplyTo(), maps,