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;
                    //System.out.println("Node conains : " + hdr1.getObject().toString());
                    try {
                        JAXBElement job = (JAXBElement) JAXBContext.newInstance(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) {
                            //System.out.println("Node conains : " + hdr1.getObject().toString());
                            try {
                                JAXBElement job = (JAXBElement) JAXBContext.newInstance(ObjectFactory.class)
                                    .createUnmarshaller()
                                    .unmarshal((Node) hdr1.getObject());
                                hdrToTest = (OutofBandHeader) job.getValue();
//                                 System.out.println("oob-hdr contains : \nname = "
//                                       + hdrToTest.getName()
//                                       + "  \nvalue = " + hdrToTest.getValue()
//                                       + " \natribute = " + hdrToTest.getHdrAttribute());
View Full Code Here

            }   
        };
       
        SoapMessage message = new SoapMessage(new MessageImpl());
        QName qname = new QName("http://cxf.apache.org/mustunderstand", "TestMU");
        message.getHeaders().add(new Header(qname, new Object()));
        AddressingProperties maps = new AddressingPropertiesImpl();
       
        EndpointReferenceType faultTo = new EndpointReferenceType();
        faultTo.setAddress(new AttributedURIType());
        faultTo.getAddress().setValue("http://bar");
View Full Code Here

    }

    private <T> void setUpHeaderDecode(List<Header> headers, String uri, String name, Class<T> clz,
                                       int index, Unmarshaller unmarshaller) throws Exception {
        Element headerElement = control.createMock(Element.class);
        headers.add(new Header(new QName(uri, name), headerElement));
        headerElement.getNamespaceURI();
        EasyMock.expectLastCall().andReturn(uri);
        headerElement.getLocalName();
        EasyMock.expectLastCall().andReturn(name);
        Object v = expectedValues[index];
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);
                header.add(holder);
                node = node.getNextSibling();
            }

        } catch (SOAPException se) {
View Full Code Here

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

     */
    private static void discardRMHeaders(List<Header> header) throws SOAPException {
       
        Iterator<Header> iter = header.iterator();
        while (iter.hasNext()) {
            Header hdr = iter.next();
            if (RMConstants.getNamespace().equals(hdr.getName().getNamespaceURI())) {
                iter.remove();
            }
        }
    }
View Full Code Here

           
            if (maps != null && !ContextUtils.isGenericAddress(maps.getFaultTo())) {
                //Just keep the wsa headers to remove the not understand headers
                Iterator<Header> iterator = message.getHeaders().iterator();
                while (iterator.hasNext()) {
                    Header header = iterator.next();
                    if (!isWSAHeader(header)) {
                        iterator.remove();
                    }
                }
                exchange.setOneWay(false);
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;
                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 (transformer.isSupported(headerURI)) {
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.