Examples of AddressingPropertiesImpl


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

        boolean isOutbound = ContextUtils.isOutbound(message);
        String mapProperty =
            (String)mapProperties.get(isOutbound
                                      ? WSAddressingTest.OUTBOUND_KEY
                                      : WSAddressingTest.INBOUND_KEY);
        AddressingPropertiesImpl maps =
            (AddressingPropertiesImpl)message.get(mapProperty);
        if (ContextUtils.isRequestor(message)) {
            if (isOutbound) {
                String exposeAs = getExpectedExposeAs(false);
                if (exposeAs != null) {
                    maps.exposeAs(exposeAs);
                }
            } else {
                String exposeAs = getExpectedExposeAs(true);
                String expected = exposeAs != null
                                  ? exposeAs
                                  : Names.WSA_NAMESPACE_NAME;
                if (maps.getNamespaceURI() != expected) {
                    verificationCache.put("Incoming version mismatch"
                                          + " expected: " + expected
                                          + " got: " + maps.getNamespaceURI());
                }
                exposeAs = null;
            }
        }
        verificationCache.put(WSAddressingTest.verifyMAPs(maps, this));
View Full Code Here

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

        boolean isOutbound = ContextUtils.isOutbound(message);
        String mapProperty =
            (String)mapProperties.get(isOutbound
                                      ? CxfBcAddressingTest.OUTBOUND_KEY
                                      : CxfBcAddressingTest.INBOUND_KEY);
        AddressingPropertiesImpl maps =
            (AddressingPropertiesImpl)message.get(mapProperty);
        if (ContextUtils.isRequestor(message)) {
            if (isOutbound) {
                String exposeAs = getExpectedExposeAs(false);
                if (exposeAs != null) {
                    maps.exposeAs(exposeAs);
                }
            } else {
                String exposeAs = getExpectedExposeAs(true);
                String expected = exposeAs != null
                                  ? exposeAs
                                  : Names.WSA_NAMESPACE_NAME;
                if (maps.getNamespaceURI() != expected) {
                    verificationCache.put("Incoming version mismatch"
                                          + " expected: " + expected
                                          + " got: " + maps.getNamespaceURI());
                }
                exposeAs = null;
            }
        }
        verificationCache.put(CxfBcAddressingTest.verifyMAPs(maps, this));
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

        }
        addAddressing(dispatch, false, action);
        return dispatch;
    }
    private void addAddressing(BindingProvider p, boolean addSeq, String action) {
        AddressingProperties addrProperties = new AddressingPropertiesImpl();
        if (action != null) {
            AttributedURIType act = new AttributedURIType();
            act.setValue(action);
            addrProperties.setAction(act);
        }
        if (adHoc) {
            EndpointReferenceType to = new EndpointReferenceType();
            addrProperties.exposeAs(version.getAddressingNamespace());
            AttributedURIType epr = new AttributedURIType();
            epr.setValue(version.getToAddress());
            to.setAddress(epr);
            addrProperties.setTo(to);
       
            if (addSeq) {
                AppSequenceType s = new AppSequenceType();
                s.setInstanceId(instanceId);
                s.setMessageNumber(msgId.getAndIncrement());
                JAXBElement<AppSequenceType> seq = new ObjectFactory().createAppSequence(s);
                Header h = new Header(seq.getName(),
                                      seq,
                                      new JAXBDataBinding(getJAXBContext()));
                List<Header> headers = new ArrayList<Header>();
                headers.add(h);
                p.getRequestContext()
                    .put(Header.HEADER_LIST, headers);
            }
        } else {
            addrProperties.exposeAs(version.getAddressingNamespace());
        }
        p.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProperties);
    }
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

            return new DOMSource(doc);           
        }
        private void updateOutputAction(String append) {
            AddressingProperties p = ContextUtils.retrieveMAPs(PhaseInterceptorChain.getCurrentMessage(),
                                                               false, false);
            AddressingProperties pout = new AddressingPropertiesImpl();
            AttributedURIType action = new AttributedURIType();
            action.setValue(p.getAction().getValue() + append);
            pout.exposeAs(p.getNamespaceURI());
            pout.setAction(action);
            ContextUtils.storeMAPs(pout, PhaseInterceptorChain.getCurrentMessage(), true);

        }
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

            .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND);
        AddressingProperties outProps = (AddressingProperties)message
            .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_OUTBOUND);
        if (inProps != null) {
            if (outProps == null) {
                outProps = new AddressingPropertiesImpl(inProps.getNamespaceURI());
            }
            AttributedURIType action = new AttributedURIType();
            action.setValue(inProps.getAction().getValue().replace("/RST/", "/RSTR/"));
            outProps.setAction(action);
            message.put(JAXWSAConstants.ADDRESSING_PROPERTIES_OUTBOUND, outProps);
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

        boolean isOutbound = ContextUtils.isOutbound(message);
        String mapProperty =
            (String)mapProperties.get(isOutbound
                                      ? MAPTest.OUTBOUND_KEY
                                      : MAPTest.INBOUND_KEY);
        AddressingPropertiesImpl maps =
            (AddressingPropertiesImpl)message.get(mapProperty);
        if (maps == null) {
            return;
        }
        if (ContextUtils.isRequestor(message)) {
            if (isOutbound) {
                String exposeAs = getExpectedExposeAs(false);
                if (exposeAs != null) {
                    maps.exposeAs(exposeAs);
                }
            } else {
                String exposeAs = getExpectedExposeAs(true);
                String expected = exposeAs != null
                                  ? exposeAs
                                  : Names.WSA_NAMESPACE_NAME;
                if (maps.getNamespaceURI() != expected) {
                    verificationCache.put("Incoming version mismatch"
                                          + " expected: " + expected
                                          + " got: " + maps.getNamespaceURI());
                }
                exposeAs = null;
            }
        }
        verificationCache.put(MAPTest.verifyMAPs(maps, this));
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
        QName serviceName = new QName("http://apache.org/hello_world_soap_http", "SOAPServiceAddressing");

        Greeter greeter = new SOAPService(wsdl, serviceName).getPort(Greeter.class, new AddressingFeature());
        EndpointReferenceType faultTo = new EndpointReferenceType();
        AddressingProperties addrProperties = new AddressingPropertiesImpl();
        AttributedURIType epr = new AttributedURIType();
        String faultToAddress = "http://localhost:" + FaultToEndpointServer.FAULT_PORT  + "/faultTo";
        epr.setValue(faultToAddress);
        faultTo.setAddress(epr);
        addrProperties.setFaultTo(faultTo);
       
        BindingProvider provider = (BindingProvider) greeter;
        Map<String, Object> requestContext = provider.getRequestContext();
        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                           "http://localhost:" + FaultToEndpointServer.PORT + "/jaxws/greeter");
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

        //setup a real decoupled endpoint that will process the fault correctly
        HTTPConduit c = (HTTPConduit)ClientProxy.getClient(port).getConduit();
        c.getClient().setDecoupledEndpoint("http://localhost:" + FaultToEndpointServer.FAULT_PORT2 + "/sendFaultHere");
       
        EndpointReferenceType faultTo = new EndpointReferenceType();
        AddressingProperties addrProperties = new AddressingPropertiesImpl();
        AttributedURIType epr = new AttributedURIType();
        epr.setValue("http://localhost:" + FaultToEndpointServer.FAULT_PORT2 + "/sendFaultHere");
        faultTo.setAddress(epr);
        addrProperties.setFaultTo(faultTo);
       
        BindingProvider provider = (BindingProvider) port;
        Map<String, Object> requestContext = provider.getRequestContext();
        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                           "http://localhost:" + FaultToEndpointServer.PORT + "/jaxws/add");
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

        setUpOutbound(message, outbound);
        expectRelatesTo = generateRelatesTo != null ? generateRelatesTo
            : (requestor && !outbound) || (!requestor && outbound);
        message.put(REQUESTOR_ROLE, Boolean.valueOf(requestor));
        String mapProperty = getMAPProperty(requestor, outbound);
        AddressingPropertiesImpl maps = getMAPs(requestor, outbound, exposeAs);
        final Element header = control.createMock(Element.class);
        codec.setHeaderFactory(new MAPCodec.HeaderFactory() {
            public Element getHeader(SoapVersion version) {
                return header;
            }
View Full Code Here

Examples of org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl

    private String getMAPProperty(boolean requestor, boolean outbound) {
        return outbound ? ADDRESSING_PROPERTIES_OUTBOUND : ADDRESSING_PROPERTIES_INBOUND;
    }

    private AddressingPropertiesImpl getMAPs(boolean requestor, boolean outbound, String uri) {
        AddressingPropertiesImpl maps = new AddressingPropertiesImpl();
        boolean exposeAsNative = Names.WSA_NAMESPACE_NAME.equals(uri);
        boolean exposeAs200408 = VersionTransformer.Names200408.WSA_NAMESPACE_NAME.equals(uri);
        boolean exposeAs200403 = VersionTransformer.Names200403.WSA_NAMESPACE_NAME.equals(uri);

        AttributedURIType id = ContextUtils.getAttributedURI("urn:uuid:12345");
        maps.setMessageID(id);
        AttributedURIType to = ContextUtils.getAttributedURI("foobar");
        EndpointReferenceType toEpr = EndpointReferenceUtils.getEndpointReference(to);
        maps.setTo(toEpr);
        EndpointReferenceType replyTo = new EndpointReferenceType();
        String anonymous = exposeAsNative ? Names.WSA_ANONYMOUS_ADDRESS : exposeAs200408
            ? VersionTransformer.Names200408.WSA_ANONYMOUS_ADDRESS
            : VersionTransformer.Names200403.WSA_ANONYMOUS_ADDRESS;
        replyTo.setAddress(ContextUtils.getAttributedURI(anonymous));
        maps.setReplyTo(replyTo);
        EndpointReferenceType from = EndpointReferenceUtils.getEndpointReference("snafu");
        maps.setFrom(from);
        EndpointReferenceType faultTo = new EndpointReferenceType();
        anonymous = exposeAsNative ? Names.WSA_ANONYMOUS_ADDRESS : exposeAs200408
            ? VersionTransformer.Names200408.WSA_ANONYMOUS_ADDRESS
            : VersionTransformer.Names200403.WSA_ANONYMOUS_ADDRESS;
        faultTo.setAddress(ContextUtils.getAttributedURI(anonymous));
        maps.setFaultTo(faultTo);
        RelatesToType relatesTo = null;
        if (expectRelatesTo) {
            String correlationID = "urn:uuid:67890";
            relatesTo = new RelatesToType();
            relatesTo.setValue(correlationID);
            maps.setRelatesTo(relatesTo);
            if (nonReplyRelationship == null) {
                correlatedExchange = new ExchangeImpl();
                codec.uncorrelatedExchanges.put(correlationID, correlatedExchange);
            } else {
                relatesTo.setRelationshipType(nonReplyRelationship);
            }
        }
        AttributedURIType action = ContextUtils.getAttributedURI("http://foo/bar/SEI/opRequest");
        maps.setAction(action);
        maps.exposeAs(uri);
        expectedNamespaceURI = uri;

        expectedNames = new QName[] {
            new QName(uri, Names.WSA_ACTION_NAME),
            new QName(uri, Names.WSA_MESSAGEID_NAME),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.