Examples of AddressingPropertiesImpl


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

        return maps;
    }

    private boolean verifyMAPs(Object obj) {
        if (obj instanceof AddressingPropertiesImpl) {
            AddressingPropertiesImpl other = (AddressingPropertiesImpl)obj;
            return compareExpected(other);
        }
        return false;
    }
View Full Code Here

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

     * @exception SOAPFaultException if decoded MAPs are invalid
     */
    public AddressingProperties unmarshalMAPs(SoapMessage message) {
        // REVISIT generate MessageAddressingHeaderRequired fault if an
        // expected header is missing
        AddressingPropertiesImpl maps = null;
        try {
            List<Header> header = message.getHeaders();
            if (header != null) {
                LOG.log(Level.FINE, "Inbound WS-Addressing headers");
                Unmarshaller unmarshaller = null;
                Set<Element> referenceParameterHeaders = null;
                QName invalidCardinalityQName = null;
                Iterator<Header> iter = header.iterator();
                while (iter.hasNext()) {
                    Header hdr = iter.next();
                    if (hdr.getObject() instanceof Element) {
                        Element headerElement = (Element)hdr.getObject();
                        String headerURI = headerElement.getNamespaceURI();
                        // Need to check the uri before getting unmarshaller else
                        // would get wrong unmarshaller and fail to process required
                        // headers.
                        if (VersionTransformer.isSupported(headerURI)) {
                            if (unmarshaller == null) {
                                JAXBContext jaxbContext =
                                    VersionTransformer.getExposedJAXBContext(headerURI);
                                unmarshaller =
                                    jaxbContext.createUnmarshaller();
                            }
                            if (maps == null) {
                                maps = new AddressingPropertiesImpl();
                                maps.exposeAs(headerURI);
                            }
                            String localName = headerElement.getLocalName();
                            if (Names.WSA_MESSAGEID_NAME.equals(localName)) {
                                invalidCardinalityQName = maps.getMessageID() != null
                                    ? Names.WSA_MESSAGEID_QNAME : null;
                                maps.setMessageID(decodeAsNative(
                                                       headerURI,
                                                       AttributedURIType.class,
                                                       headerElement,
                                                       unmarshaller));
                            } else if (Names.WSA_TO_NAME.equals(localName)) {
                                invalidCardinalityQName = maps.getTo() != null ? Names.WSA_TO_QNAME : null;
                                AttributedURIType addr = decodeAsNative(
                                                       headerURI,
                                                       AttributedURIType.class,
                                                       headerElement,
                                                       unmarshaller);
                                maps.setTo(EndpointReferenceUtils.getEndpointReference(addr));
                            } else if (Names.WSA_FROM_NAME.equals(localName)) {
                                invalidCardinalityQName = maps.getFrom() != null
                                    ? Names.WSA_FROM_QNAME : null;
                                maps.setFrom(decodeAsNative(
                                                       headerURI,
                                                       EndpointReferenceType.class,
                                                       headerElement,
                                                       unmarshaller));
                            } else if (Names.WSA_REPLYTO_NAME.equals(localName)) {
                                invalidCardinalityQName = maps.getReplyTo() != null
                                                                   ? Names.WSA_REPLYTO_QNAME : null;

                                maps.setReplyTo(decodeAsNative(
                                                       headerURI,
                                                       EndpointReferenceType.class,
                                                       headerElement,
                                                       unmarshaller));
                            } else if (Names.WSA_FAULTTO_NAME.equals(localName)) {
                                invalidCardinalityQName = maps.getFaultTo() != null
                                    ? Names.WSA_FAULTTO_QNAME : null;

                                maps.setFaultTo(decodeAsNative(
                                                       headerURI,
                                                       EndpointReferenceType.class,
                                                       headerElement,
                                                       unmarshaller));
                            } else if (Names.WSA_RELATESTO_NAME.equals(localName)) {
                                maps.setRelatesTo(decodeAsNative(
                                                       headerURI,
                                                       RelatesToType.class,
                                                       headerElement,
                                                       unmarshaller));
                            } else if (Names.WSA_ACTION_NAME.equals(localName)) {
                                invalidCardinalityQName = maps.getAction() != null
                                    ? Names.WSA_ACTION_QNAME : null;
                                maps.setAction(decodeAsNative(
                                                       headerURI,
                                                       AttributedURIType.class,
                                                       headerElement,
                                                       unmarshaller));
                            }
                        } else if (null != headerElement.getAttribute(IS_REFERENCE_PARAM_ATTR_NAME)) {
                            if (null == referenceParameterHeaders) {
                                referenceParameterHeaders = new HashSet<Element>();
                            }
                            referenceParameterHeaders.add(headerElement);
                        } else if (headerURI.contains(Names.WSA_NAMESPACE_PATTERN)) {
                            LOG.log(Level.WARNING,
                                    "UNSUPPORTED_VERSION_MSG",
                                    headerURI);
                        }
                    }
                }
               
                if (maps != null && !MessageUtils.isRequestor(message) && maps.getReplyTo() == null) {
                    //per spec, if unspecified, replyTo is anon
                    AttributedURIType address =
                        ContextUtils.getAttributedURI(Names.WSA_ANONYMOUS_ADDRESS);
                    EndpointReferenceType replyTo =
                        ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType();
                    replyTo.setAddress(address);
                    maps.setReplyTo(replyTo);
                }

                if (null != referenceParameterHeaders && null != maps) {
                    decodeReferenceParameters(referenceParameterHeaders, maps, unmarshaller);
                }
View Full Code Here

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

        EasyMock.expect(manager.createReliableEndpoint(e))
            .andReturn(rme).anyTimes();
        org.apache.cxf.transport.Destination destination = control
            .createMock(org.apache.cxf.transport.Destination.class);
        EasyMock.expect(exchange.getDestination()).andReturn(destination).anyTimes();
        AddressingPropertiesImpl maps = control.createMock(AddressingPropertiesImpl.class);
        EasyMock.expect(message.get(Message.REQUESTOR_ROLE)).andReturn(null);
        EasyMock.expect(message.get(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND))
            .andReturn(maps).anyTimes();
        EndpointReferenceType replyTo = RMUtils.createAnonymousReference();
        EasyMock.expect(maps.getReplyTo()).andReturn(replyTo).anyTimes();
        EasyMock.expect(exchange.getConduit(message)).andReturn(null).anyTimes();
        rme.initialise(null, replyTo, null);
        EasyMock.expectLastCall();

        control.replay();
View Full Code Here

Examples of org.jboss.ws.extensions.addressing.AddressingPropertiesImpl

   /**
    * Process operation meta data extensions.
    */
   private void processMetaExtensions(Method method, EndpointMetaData epMetaData, OperationMetaData opMetaData)
   {
      AddressingProperties ADDR = new AddressingPropertiesImpl();
      AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());

      Action anAction = method.getAnnotation(Action.class);
      if (anAction != null)
      {
         addrExt.setInboundAction(anAction.input());
View Full Code Here

Examples of org.objectweb.celtix.bus.ws.addressing.AddressingPropertiesImpl

        context.get(MESSAGE_OUTBOUND_PROPERTY);
        EasyMock.expectLastCall().andReturn(Boolean.valueOf(outbound));
        context.get(REQUESTOR_ROLE_PROPERTY);
        EasyMock.expectLastCall().andReturn(Boolean.valueOf(requestor));
        String mapProperty = getMAPProperty(requestor, outbound);
        AddressingPropertiesImpl maps = getMAPs(exposeAs, outbound);
        SOAPMessage message = control.createMock(SOAPMessage.class);
        context.getMessage();
        EasyMock.expectLastCall().andReturn(message);
        SOAPHeader header = setUpSOAPHeader(context, message, outbound);
        JAXBContext jaxbContext = control.createMock(JAXBContext.class);
View Full Code Here

Examples of org.objectweb.celtix.bus.ws.addressing.AddressingPropertiesImpl

                 ? SERVER_ADDRESSING_PROPERTIES_OUTBOUND
                 : SERVER_ADDRESSING_PROPERTIES_INBOUND;
    }

    private AddressingPropertiesImpl getMAPs(String uri, boolean outbound) {
        AddressingPropertiesImpl maps = new AddressingPropertiesImpl();
        boolean exposeAsNative = Names.WSA_NAMESPACE_NAME.equals(uri);
        boolean exposeAs200408 =
            VersionTransformer.Names200408.WSA_NAMESPACE_NAME.equals(uri);
        AttributedURIType id =
            ContextUtils.getAttributedURI("urn:uuid:12345");
        maps.setMessageID(id);
        AttributedURIType to =
            ContextUtils.getAttributedURI("foobar");
        maps.setTo(to);
        EndpointReferenceType replyTo = new EndpointReferenceType();
        String anonymous =
            exposeAsNative
            ? Names.WSA_ANONYMOUS_ADDRESS
            : VersionTransformer.Names200408.WSA_ANONYMOUS_ADDRESS;
        replyTo.setAddress(
            ContextUtils.getAttributedURI(anonymous));
        maps.setReplyTo(replyTo);
        EndpointReferenceType faultTo = new EndpointReferenceType();
        anonymous =
            exposeAsNative
            ? Names.WSA_ANONYMOUS_ADDRESS
            : VersionTransformer.Names200408.WSA_ANONYMOUS_ADDRESS;
        faultTo.setAddress(
            ContextUtils.getAttributedURI(anonymous));
        maps.setFaultTo(faultTo);
        RelatesToType relatesTo = new RelatesToType();
        relatesTo.setValue("urn:uuid:67890");
        maps.setRelatesTo(relatesTo);
        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_MESSAGEID_NAME),
                         new QName(uri, Names.WSA_TO_NAME),
View Full Code Here

Examples of org.objectweb.celtix.bus.ws.addressing.AddressingPropertiesImpl

    }

    private final class MAPMatcher implements IArgumentMatcher {
        public boolean matches(Object obj) {
            if (obj instanceof AddressingPropertiesImpl) {
                AddressingPropertiesImpl other = (AddressingPropertiesImpl)obj;
                return compareExpected(other);
            }
            return false;
        }   
View Full Code Here

Examples of org.objectweb.celtix.bus.ws.addressing.AddressingPropertiesImpl

        assertNull(s.getCurrent(sid));
    }
   
    public void testAddUnacknowledged() {
        ObjectMessageContext ctx = new ObjectMessageContextImpl();
        AddressingProperties maps = new AddressingPropertiesImpl();
        ctx.put(CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, maps);
        RMPropertiesImpl rmps = new RMPropertiesImpl();
        SequenceType seq = control.createMock(SequenceType.class);
        Identifier sid = control.createMock(Identifier.class);
        rmps.setSequence(seq);
View Full Code Here

Examples of org.objectweb.celtix.bus.ws.addressing.AddressingPropertiesImpl

       
        return context;
    }
   
    private void setupContextMAPs(ObjectMessageContext context) {
        AddressingPropertiesImpl maps = control.createMock(AddressingPropertiesImpl.class);
        context.get(CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
        EasyMock.expectLastCall().andReturn(maps);
    }
View Full Code Here

Examples of org.objectweb.celtix.bus.ws.addressing.AddressingPropertiesImpl

       
        contexts.get(i).get(RM_PROPERTIES_OUTBOUND);
        EasyMock.expectLastCall().andReturn(properties.get(i)).times(2);
        properties.get(i).getSequence();
        EasyMock.expectLastCall().andReturn(sequences.get(i)).times(2);
        AddressingPropertiesImpl maps =
            control.createMock(AddressingPropertiesImpl.class);
        contexts.get(i).get(REQUESTOR_ROLE_PROPERTY);
        EasyMock.expectLastCall().andReturn(Boolean.valueOf(isRequestor)).times(2);
        contexts.get(i).get(SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
        EasyMock.expectLastCall().andReturn(maps);
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.