Package org.apache.cxf.headers

Examples of org.apache.cxf.headers.Header


            List oobHdr = (List) ctx.get(Header.HEADER_LIST);
            Iterator iter = oobHdr.iterator();
            while (iter.hasNext()) {
                Object hdr = iter.next();
                if (hdr instanceof Header && ((Header) hdr).getObject() instanceof Node) {
                    Header hdr1 = (Header) hdr;
                    try {
                        JAXBElement job =
                            (JAXBElement)JAXBContext.newInstance(org.apache.cxf.outofband.header.ObjectFactory.class)
                                .createUnmarshaller()
                                .unmarshal((Node) hdr1.getObject());
                        OutofBandHeader ob = (OutofBandHeader) job.getValue();
                        if ("testOobHeader".equals(ob.getName())
                            && "testOobHeaderValue".equals(ob.getValue())) {
                            if ("testHdrAttribute".equals(ob.getHdrAttribute())) {
                                success = true;
View Full Code Here


        if (oobHdr != null & oobHdr instanceof List) {
            Iterator iter = oobHdr.iterator();
            while (iter.hasNext()) {
                Object hdr = iter.next();
                if (hdr instanceof Header) {
                    Header hdr1 = (Header)hdr;
                    if (hdr1.getObject() instanceof Node) {
                        try {
                            JAXBElement job = (JAXBElement)JAXBContext
                                .newInstance(org.apache.cxf.outofband.header.ObjectFactory.class)
                                .createUnmarshaller().unmarshal((Node)hdr1.getObject());
                            hdrToTest = (OutofBandHeader)job.getValue();
                        } catch (JAXBException ex) {
                            ex.printStackTrace();
                        }
                    }
View Full Code Here

            if (node != null && MessageUtils.isPartialResponse(message)) {
                // make sure the response is returned as HTTP 200 and not 202
                message.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK);
            }
            while (node != null) {
                Header holder = new Header(new QName(node.getNamespaceURI(), node.getLocalName()), node);
                headers.add(holder);
                node = node.getNextSibling();
            }

        } catch (JAXBException je) {
View Full Code Here

                    "xmlns:" + RMConstants.NAMESPACE_PREFIX);
                attr.setValue(rmps.getNamespaceURI());
                ((Element)node).setAttributeNodeNS(attr);
            }
           
            headers.add(new Header(new QName(node.getNamespaceURI(), node.getLocalName()), node));
        } catch (JAXBException je) {
            LOG.log(Level.WARNING, "SOAP_HEADER_ENCODE_FAILURE_MSG", je);
        }       
    }
View Full Code Here

     * @param header the SOAP header element
     */
    private static void discardRMHeaders(List<Header> header) {
        Iterator<Header> iter = header.iterator();
        while (iter.hasNext()) {
            Header hdr = iter.next();
            String uri = hdr.getName().getNamespaceURI();
            if (RM10Constants.NAMESPACE_URI.equals(uri)
                || RM11Constants.NAMESPACE_URI.equals(uri)) {
                iter.remove();
            }
        }
View Full Code Here

                encodeReferenceParameters(maps, hdr, marshaller);
               
                Node childNode = hdr.getFirstChild();
               
                while (childNode != null) {
                    Header holder = new Header(
                                               new QName(childNode.getNamespaceURI(),
                                                         childNode.getLocalName()),
                                                         childNode);
                    header.add(holder);
                    childNode = childNode.getNextSibling();
View Full Code Here

                Unmarshaller unmarshaller = null;
                Set<Element> referenceParameterHeaders = 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 (transformer.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())) {
                iter.remove();
            }
        }
    }
View Full Code Here

    private GenericGenericClass<Double> lastGenericGeneric;
    private InheritanceTestDerived lastInheritanceTestDerived;
   
    public String echoWithHeader(String what) {
        List<Header> headers = new ArrayList<Header>();
        Header dummyHeader;
        try {
            dummyHeader = new Header(new QName("uri:org.apache.cxf", "dummy"), "decapitated",
                                            new JAXBDataBinding(String.class));
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
        headers.add(dummyHeader);
View Full Code Here

                    // Add Out-of-band header object to HeaderHolder.

                    JAXBElement<OutofBandHeader> job = new JAXBElement<OutofBandHeader>(
                            new QName(OOBHeaderTest.TEST_HDR_NS, OOBHeaderTest.TEST_HDR_RESPONSE_ELEM),
                            OutofBandHeader.class, null, ob);
                    Header hdr = new Header(
                            new QName(OOBHeaderTest.TEST_HDR_NS, OOBHeaderTest.TEST_HDR_RESPONSE_ELEM),
                            job,
                            new JAXBDataBinding(ob.getClass()));
                    List<Header> hdrList = CastUtils.cast((List<?>) ctx.get(Header.HEADER_LIST));
                    hdrList.add(hdr);
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.