Package org.apache.cxf.headers

Examples of org.apache.cxf.headers.Header


     * @param maps the current MAPs
     */
    private void discardMAPs(List<Header> header, AddressingProperties maps) {
        Iterator<Header> iter = header.iterator();
        while (iter.hasNext()) {
            Header hdr = iter.next();
            if (Names.WSA_NAMESPACE_NAME.equals(hdr.getName().getNamespaceURI())
                || Names200408.WSA_NAMESPACE_NAME.equals(hdr.getName().getNamespaceURI())) {
                iter.remove();
            }
        }
    }
View Full Code Here


        }
    }


    private void processUsernameToken(SoapMessage message) {
        Header h = findSecurityHeader(message, false);
        if (h == null) {
            return;
        }
        Element el = (Element)h.getObject();
        Element child = DOMUtils.getFirstElement(el);
        while (child != null) {
            if (SPConstants.USERNAME_TOKEN.equals(child.getLocalName())) {
                try  {
                    final WSUsernameTokenPrincipal princ = getPrincipal(child, message);
View Full Code Here

    }

    private void addUsernameToken(SoapMessage message) {
        UsernameToken tok = assertUsernameTokens(message, null);

        Header h = findSecurityHeader(message, true);
        WSSecUsernameToken utBuilder =
            addUsernameToken(message, tok);
        if (utBuilder == null) {
            AssertionInfoMap aim = message.get(AssertionInfoMap.class);
            Collection<AssertionInfo> ais = aim.getAssertionInfo(SP12Constants.USERNAME_TOKEN);
            for (AssertionInfo ai : ais) {
                if (ai.isAsserted()) {
                    ai.setAsserted(false);
                }
            }
            return;
        }
        Element el = (Element)h.getObject();
        utBuilder.prepare(el.getOwnerDocument());
        el.appendChild(utBuilder.getUsernameTokenElement());
    }
View Full Code Here

            if (list != null && !list.isEmpty()) {
                SoapMessage sm = (SoapMessage) createResponseMessage(exchange);
                if (sm != null) {
                    Iterator iter = list.iterator();
                    while (iter.hasNext()) {
                        Header header = (Header) iter.next();
                        if (!header.getName().getNamespaceURI().
                            equals("http://docs.oasis-open.org/wss/2004/01/"
                                   + "oasis-200401-wss-wssecurity-secext-1.0.xsd")
                                && !header.getName().getNamespaceURI().
                                equals("http://docs.oasis-open.org/"
                                    + "wss/oasis-wss-wssecurity-secext-1.1.xsd")) {
                            //don't copy over security header, out interceptor chain will take care of it.
                            sm.getHeaders().add(header);
                        }
View Full Code Here

    protected WebServiceContext context;
   
    public BareDocumentResponse testDocLitFault(String in) throws BadRecordLitFault {
        System.out.println("Executing testDocLitFault sayHi\n");
        List<Header> headers = new ArrayList<Header>();
        Header header = null;
        try {
            header = new Header(new QName("http://test", "test"),
                                new String("test"), new JAXBDataBinding(String.class));
        } catch (JAXBException e) {
            e.printStackTrace();
        }                       
        headers.add(header);
View Full Code Here

       
        List<Header> headers = new ArrayList<Header>();
        org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeDocument doc
            = org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeDocument.Factory.newInstance();
        doc.addNewGreetMe().setRequestType("doc format header");
        Header head = new Header(new QName("", "doc"), doc,
                                 client.getEndpoint().getService().getDataBinding());
        headers.add(head);
        org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeDocument.GreetMe gm
            = org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types
                .GreetMeDocument.GreetMe.Factory.newInstance();
        gm.setRequestType("non-doc format header");
        head = new Header(new QName("http://somenamespace.com", "nondocheader"), gm,
                          client.getEndpoint().getService().getDataBinding());
        headers.add(head);
        ((BindingProvider)port).getRequestContext().put(Header.HEADER_LIST, headers);
       
        String resp;
View Full Code Here

                        Element lastAdded = (Element)header.getLastChild();
                        header.removeChild(lastAdded);
                        addIsReferenceParameterMarkerAttribute(lastAdded, maps.getNamespaceURI());
                       
                       
                        Header holder = new Header(new QName(lastAdded.getNamespaceURI(),
                                                             lastAdded.getLocalName()),
                                                             lastAdded);
                        msg.getHeaders().add(holder);
                    } else {
                        LOG.log(Level.WARNING, "IGNORE_NON_ELEMENT_REF_PARAM_MSG", o);
View Full Code Here

                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)) {
View Full Code Here

     * @param maps the current MAPs
     */
    private void discardMAPs(List<Header> header, AddressingProperties maps) {
        Iterator<Header> iter = header.iterator();
        while (iter.hasNext()) {
            Header hdr = iter.next();
            if (Names.WSA_NAMESPACE_NAME.equals(hdr.getName().getNamespaceURI())
                || Names200408.WSA_NAMESPACE_NAME.equals(hdr.getName().getNamespaceURI())) {
                iter.remove();
            }
        }
    }
View Full Code Here

    public BinarySecurityTokenInterceptor() {
        super();
    }
   
    protected void processToken(SoapMessage message) {
        Header h = findSecurityHeader(message, false);
        if (h == null) {
            return;
        }
        Element el = (Element)h.getObject();
        Element child = DOMUtils.getFirstElement(el);
        while (child != null) {
            if (WSConstants.BINARY_TOKEN_LN.equals(child.getLocalName())
                && WSConstants.WSSE_NS.equals(child.getNamespaceURI())) {
                try {
View Full Code Here

TOP

Related Classes of org.apache.cxf.headers.Header

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.