Package org.apache.cxf.ws.addressing

Examples of org.apache.cxf.ws.addressing.AddressingProperties


    private void mediate(SoapMessage message) {
        if (!MessageUtils.getContextualBoolean(message, MAPAggregator.ADDRESSING_DISABLED, false)) {
            if (ContextUtils.isOutbound(message)) {
                encode(message, ContextUtils.retrieveMAPs(message, false, true));
            } else if (null == ContextUtils.retrieveMAPs(message, false, false, false)) {           
                AddressingProperties maps = decode(message);
                ContextUtils.storeMAPs(maps, message, false);
                markPartialResponse(message, maps);
                restoreExchange(message, maps);    
            }
        }
View Full Code Here


                        rmps.exposeAs(rmUri);
                    }
                    if (rmUri != null && rmUri.equals(ns)) {
                        if (codec == null) {
                            String wsauri = null;
                            AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, false, false);
                            if (maps == null) {
                                RMConfiguration config = getManager(message).getEffectiveConfiguration(message);
                                wsauri = config.getAddressingNamespace();
                            } else {
                                wsauri = maps.getNamespaceURI();
                            }
                            ProtocolVariation protocol = ProtocolVariation.findVariant(rmUri, wsauri);
                            if (protocol == null) {
                                LOG.log(Level.WARNING, "NAMESPACE_ERROR_MSG", wsauri);
                                break;
View Full Code Here

     *
     * @param message the message
     */
    private void updateServiceModelInfo(SoapMessage message) throws Fault {

        AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, false, false);
        AttributedURIType actionURI = null == maps ? null : maps.getAction();
        String action = null == actionURI ? null : actionURI.getValue().trim();
       
        LOG.fine("action: " + action);
        RMConstants consts;
        if (RM10Constants.ACTIONS.contains(action)) {
            consts = RM10Constants.INSTANCE;
        } else if (RM11Constants.ACTIONS.contains(action)) {
            consts = RM11Constants.INSTANCE;
        } else {
            return;
        }
        RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
        rmps.exposeAs(consts.getWSRMNamespace());
        ProtocolVariation protocol =
            ProtocolVariation.findVariant(consts.getWSRMNamespace(), maps.getNamespaceURI());
       
        LOG.info("Updating service model info in exchange");
       
        RMManager manager = getManager(message);
        assert manager != null;
View Full Code Here

                    throw new IllegalStateException("No body content present");
                }
            }
           
            // set message addressing properties
            AddressingProperties maps = new MAPCodec().unmarshalMAPs(message);
            RMContextUtils.storeMAPs(maps, message, true, MessageUtils.isRequestor(message));
            AttributedURIType to = null;
            if (null != maps) {
                to = maps.getTo();
            }
            if (null == to) {
                LOG.log(Level.SEVERE, "NO_ADDRESS_FOR_RESEND_MSG");
                return;
            }
View Full Code Here

            nextInterval = baseRetransmissionInterval * backoff;
            RetryPolicyType rmrp = null != manager.getSourcePolicy()
                ? manager.getSourcePolicy().getRetryPolicy() : null;
            maxRetries = null != rmrp ? rmrp.getMaxRetries() : -1;
           
            AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, true);
            AttributedURIType to = null;
            if (null != maps) {
                to = maps.getTo();
            }
            if (to != null  && RMUtils.getAddressingConstants().getAnonymousURI().equals(to.getValue())) {
                LOG.log(Level.INFO, "Cannot resend to anonymous target.  Not scheduling a resend.");
                return;
            }
View Full Code Here

            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());
            Element header = protocol.getCodec().buildHeaders(rmps, message.getVersion().getHeader());
            if (header != null) {
                Node node = header.getFirstChild();
                if (node != null && MessageUtils.isPartialResponse(message)) {
                    // make sure the response is returned as HTTP 200 and not 202
View Full Code Here

    public static void encodeFault(SoapMessage message, SequenceFault sf) {
        LOG.log(Level.FINE, "Encoding SequenceFault in SOAP header");
        try {
            Message inmsg = message.getExchange().getInMessage();
            RMProperties rmps = RMContextUtils.retrieveRMProperties(inmsg, false);
            AddressingProperties maps = RMContextUtils.retrieveMAPs(inmsg, false, false);
            ProtocolVariation protocol = ProtocolVariation.findVariant(rmps.getNamespaceURI(),
                maps.getNamespaceURI());
            Element header = protocol.getCodec().buildHeaderFault(sf, message.getVersion().getHeader());
            Node node = header.getFirstChild();
            if (node instanceof Element) {
                Attr attr = header.getOwnerDocument().createAttributeNS("http://www.w3.org/2000/xmlns/",
                    "xmlns:" + RMConstants.NAMESPACE_PREFIX);
View Full Code Here

        LOG.fine("isServerSide: " + isServer);

        RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
        // message addressing properties may be null, e.g. in case of a runtime fault
        // on the server side
        final AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, false, false);
        if (null == maps) {
            //if wsrmp:RMAssertion and addressing is optional
            if (isServer && !isRMPolicyEnabled(message)) {
                org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
                    "WSA_REQUIRED_EXC", LOG);
                LOG.log(Level.INFO, msg.toString());
                throw new RMException(msg);               
            } else {
                return;
            }
        }

        String action = null;
        if (null != maps.getAction()) {
            action = maps.getAction().getValue();
        }

        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Action: " + action);
        }
       
        // RM does not apply to WS-Trust messages, as used by WS-SecureConversation
        if (action != null && action.contains("/RST/SCT")
            && (action.startsWith(STSUtils.WST_NS_05_02) || action.startsWith(STSUtils.WST_NS_05_12))) {
            return;
        }
       
        Object originalRequestor = message.get(RMMessageConstants.ORIGINAL_REQUESTOR_ROLE);
        if (null != originalRequestor) {
            LOG.fine("Restoring original requestor role to: " + originalRequestor);
            message.put(Message.REQUESTOR_ROLE, originalRequestor);
        }

        // get the wsa and wsrm namespaces from the message
        String rmUri = rmps.getNamespaceURI();
        String addrUri = maps.getNamespaceURI();

        ProtocolVariation protocol = ProtocolVariation.findVariant(rmUri, addrUri);
        if (null == protocol && !MessageUtils.isFault(message)) {
            org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
                "WSRM_REQUIRED_EXC", LOG, rmUri, addrUri);
View Full Code Here

        EndpointReferenceType refWithId = destination.getAddressWithId(id);
       
        Map<String, Object> context = new HashMap<String, Object>();
        assertNull("fails with no context", destination.getId(context));
       
        AddressingProperties maps = EasyMock.createMock(AddressingProperties.class);
        maps.getToEndpointReference();
        EasyMock.expectLastCall().andReturn(refWithId);
        EasyMock.replay(maps);     
        context.put(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND, maps);
        String result = destination.getId(context);
        assertNotNull(result);
View Full Code Here

            String s = (String)message.get(SoapBindingConstants.SOAP_ACTION);
            if (s == null) {
                s = SoapActionInInterceptor.getSoapAction(message);
            }
            String addNs = null;
            AddressingProperties inProps = (AddressingProperties)message
                .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND);
            if (inProps != null) {
                addNs = inProps.getNamespaceURI();
                if (s == null) {
                    //MS/WCF doesn't put a soap action out for this, must check the headers
                    s = inProps.getAction().getValue();
                }
            }

            if (s != null
                && s.contains("/RST/SCT")
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.addressing.AddressingProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.