Package org.apache.cxf.ws.addressing

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


        Exchange exchange = new ExchangeImpl();
        exchange.setInMessage(message);

        message.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
       
        AddressingProperties maps = new AddressingProperties();
        String msgId = "urn:uuid:12345-" + Math.random();
        AttributedURIType id = ContextUtils.getAttributedURI(msgId);
        maps.setMessageID(id);

        maps.setAction(ContextUtils.getAttributedURI(RM10Constants.INSTANCE.getTerminateSequenceAction()));
        maps.setTo(ContextUtils.getAttributedURI(SERVICE_URL));

        maps.setReplyTo(RMUtils.createReference(DECOUPLED_URL));
       
        message.put(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND, maps);

        TerminateSequenceType ts = new TerminateSequenceType();
        Identifier sid = new Identifier();
View Full Code Here


        Message message = new MessageImpl();
        SoapMessage soapMessage = new SoapMessage(message);
        RMProperties rmps = new RMProperties();
        rmps.exposeAs(RM10Constants.NAMESPACE_URI);
        RMContextUtils.storeRMProperties(soapMessage, rmps, false);
        AddressingProperties maps = new AddressingProperties();
        RMContextUtils.storeMAPs(maps, soapMessage, false, false);
        message.put(Message.SCHEMA_VALIDATION_ENABLED, false);
        InputStream is = RMSoapInInterceptorTest.class.getResourceAsStream(resource);
        assertNotNull(is);
        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(is);
View Full Code Here

        Message message = new MessageImpl();
        SoapMessage soapMessage = new SoapMessage(message);
        RMProperties rmps = new RMProperties();
        rmps.exposeAs(RM10Constants.NAMESPACE_URI);
        RMContextUtils.storeRMProperties(soapMessage, rmps, true);
        AddressingProperties maps = new AddressingProperties();
        RMContextUtils.storeMAPs(maps, soapMessage, true, false);
        ex.setOutMessage(soapMessage);
        soapMessage.setExchange(ex);       
        MessageFactory factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage soap = factory.createMessage();
View Full Code Here

        Exchange ex = new ExchangeImpl();
        Message message = new MessageImpl();
        RMProperties rmps = new RMProperties();
        rmps.exposeAs(RM10Constants.NAMESPACE_URI);
        RMContextUtils.storeRMProperties(message, rmps, false);
        AddressingProperties maps = new AddressingProperties();
        RMContextUtils.storeMAPs(maps, message, false, false);
        ex.setInMessage(message);
        message = new MessageImpl();
        SoapMessage soapMessage = new SoapMessage(message);        
        ex.setOutFaultMessage(soapMessage);
View Full Code Here

                    tok = NegotiationUtils.getTokenStore(m2).getToken(tokId);
                }
            }

            STSClient client = STSUtils.getClient(m2, "sct");
            AddressingProperties maps =
                (AddressingProperties)message
                    .get("javax.xml.ws.addressing.context.inbound");
            if (maps == null) {
                maps = (AddressingProperties)m2
                    .get("javax.xml.ws.addressing.context");
            }
           
            synchronized (client) {
                try {
                    SecureConversationTokenInterceptorProvider
                        .setupClient(client, message, aim, itok, true);

                    if (maps != null) {
                        client.setAddressingNamespace(maps.getNamespaceURI());
                    }
                   
                    client.cancelSecurityToken(tok);
                    NegotiationUtils.getTokenStore(m2).remove(tok.getId());
                    m2.setContextualProperty(SecurityConstants.TOKEN, null);
View Full Code Here

    Object createSequence(Message message) {
        LOG.fine("Creating sequence");
        final ProtocolVariation protocol = RMContextUtils.getProtocolVariation(message);
       
        AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);       
        Message outMessage = message.getExchange().getOutMessage()
        if (null != outMessage) {
            RMContextUtils.storeMAPs(maps, outMessage, false, false);
        }
       
        EncoderDecoder codec = protocol.getCodec();
        CreateSequenceType create = codec.convertReceivedCreateSequence(getParameter(message));
        Destination destination = reliableEndpoint.getDestination();
       
        CreateSequenceResponseType createResponse = new CreateSequenceResponseType();       
        createResponse.setIdentifier(destination.generateSequenceIdentifier());
       
        DestinationPolicyType dp = reliableEndpoint.getManager().getDestinationPolicy();
        if (dp.getMaxSequences() > 0
            && destination.getProcessingSequenceCount() >= dp.getMaxSequences()) {
            throw new RuntimeException("Sequence creation refused");
        }
        Duration supportedDuration = dp.getSequenceExpiration();
        if (null == supportedDuration) {
            supportedDuration = DatatypeFactory.PT0S;
        }
        Expires ex = create.getExpires();
       
        if (null != ex) {
            Duration effectiveDuration = ex.getValue();
            // PT0S represents 0 second and the shortest duration but in ws-rm, considered the longest
            if (DatatypeFactory.PT0S.equals(effectiveDuration)
                || (!DatatypeFactory.PT0S.equals(supportedDuration)
                    &&  supportedDuration.isShorterThan(effectiveDuration)))  {
                effectiveDuration = supportedDuration;
            }
            ex = new Expires();
            ex.setValue(effectiveDuration);
            createResponse.setExpires(ex);
        }
       
        OfferType offer = create.getOffer();
        if (null != offer) {
            AcceptType accept = new AcceptType();
            if (dp.isAcceptOffers()) {
                Source source = reliableEndpoint.getSource();
                LOG.fine("Accepting inbound sequence offer");
                // AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
                accept.setAcksTo(RMUtils.createReference(maps.getTo().getValue()));
                SourceSequence seq = new SourceSequence(offer.getIdentifier(), null,
                    createResponse.getIdentifier(), protocol);
                seq.setExpires(offer.getExpires());
                seq.setTarget(create.getAcksTo());
                source.addSequence(seq);
                source.setCurrent(createResponse.getIdentifier(), seq)
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Making offered sequence the current sequence for responses to "
                             + createResponse.getIdentifier().getValue());
                }
            } else {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Refusing inbound sequence offer");
                }
                accept.setAcksTo(RMUtils.createNoneReference());
            }
            createResponse.setAccept(accept);
        }
       
        DestinationSequence seq = new DestinationSequence(createResponse.getIdentifier(),
            create.getAcksTo(), destination, protocol);
        seq.setCorrelationID(maps.getMessageID().getValue());
        destination.addSequence(seq);
        LOG.fine("returning " + createResponse);
        return codec.convertToSend(createResponse);
    }
View Full Code Here

                break;
            }
        }
        TerminateSequenceResponseType terminateResponse = null;
        if (RM11Constants.NAMESPACE_URI.equals(protocol.getWSRMNamespace())) {
            AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);       
            Message outMessage = message.getExchange().getOutMessage();

            if (null == outMessage) {
                // outMessage may be null e.g. if ReplyTo is not set for TS
                outMessage = ContextUtils.createMessage(message.getExchange());
View Full Code Here

        }
        closedSeq.scheduleImmediateAcknowledgement();
        closedSeq.setLastMessageNumber(close.getLastMsgNumber());
        CloseSequenceResponseType closeResponse = new CloseSequenceResponseType();
        closeResponse.setIdentifier(close.getIdentifier());
        AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);       
        Message outMessage = message.getExchange().getOutMessage();

        if (null == outMessage) {
            // outMessage may be null e.g. if ReplyTo is not set for TS
            outMessage = ContextUtils.createMessage(message.getExchange());
View Full Code Here

            STSClient client = STSUtils.getClient(message, "sts", itok);
            if (!client.isAllowRenewing()) {
                return issueToken(message, aim, itok);
            }
           
            AddressingProperties maps =
                (AddressingProperties)message
                    .get("javax.xml.ws.addressing.context.outbound");
            if (maps == null) {
                maps = (AddressingProperties)message
                    .get("javax.xml.ws.addressing.context");
            }
            synchronized (client) {
                try {
                    Map<String, Object> ctx = client.getRequestContext();
                    mapSecurityProps(message, ctx);
               
                    client.setMessage(message);

                    if (maps != null) {
                        client.setAddressingNamespace(maps.getNamespaceURI());
                    }
                   
                    client.setTrust(getTrust10(aim));
                    client.setTrust(getTrust13(aim));
                   
View Full Code Here

             Message message,
             AssertionInfoMap aim,
             IssuedToken itok
        ) {
            STSClient client = STSUtils.getClient(message, "sts", itok);
            AddressingProperties maps =
                (AddressingProperties)message
                    .get("javax.xml.ws.addressing.context.outbound");
            if (maps == null) {
                maps = (AddressingProperties)message
                    .get("javax.xml.ws.addressing.context");
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.