Package org.apache.cxf.binding.soap

Examples of org.apache.cxf.binding.soap.SoapHeader


            // Insert a new header
            String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><outofbandHeader "
                + "xmlns=\"http://cxf.apache.org/outofband/Header\" hdrAttribute=\"testHdrAttribute\" "
                + "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" soap:mustUnderstand=\"1\">"
                + "<name>New_testOobHeader</name><value>New_testOobHeaderValue</value></outofbandHeader>";
            SoapHeader newHeader = new SoapHeader(soapHeaders.get(0).getName(),
                           DOMUtils.readXml(new StringReader(xml)).getDocumentElement());
            // make sure direction is OUT since it is a response message.
            newHeader.setDirection(Direction.DIRECTION_OUT);
            //newHeader.setMustUnderstand(false);
            soapHeaders.add(newHeader);
           
        }
View Full Code Here


        OutofBandHeader ob = new OutofBandHeader();
        ob.setName("testOobHeader");
        ob.setValue("testOobHeaderValue");
        ob.setHdrAttribute(invalid ? "dontProcess" : "testHdrAttribute");

        SoapHeader hdr = new SoapHeader(
                new QName(Constants.TEST_HDR_NS, Constants.TEST_HDR_REQUEST_ELEM),
                ob,
                new JAXBDataBinding(ob.getClass()));
        hdr.setMustUnderstand(true);

        List<Header> headers = new ArrayList<Header>();
        headers.add(hdr);
        return headers;
    }
View Full Code Here

                                      soapVersion.getNamespace());  
                List<Header> hdrList = message.getHeaders();
                for (Header header : hdrList) {
                    XMLStreamWriter writer = xtw;
                    if (header instanceof SoapHeader) {
                        SoapHeader soapHeader = (SoapHeader)header;
                        writer = new SOAPHeaderWriter(xtw, soapHeader, soapVersion, soapPrefix);
                    }
                    DataBinding b = header.getDataBinding();
                    if (b == null) {
                        HeaderProcessor hp = bus.getExtension(HeaderManager.class)
View Full Code Here

                OutofBandHeader ob = new OutofBandHeader();
                ob.setName("testOobHeader");
                ob.setValue("testOobHeaderValue");
                ob.setHdrAttribute(invalid ? "dontProcess" : "testHdrAttribute");

                SoapHeader hdr = new SoapHeader(
                        new QName(TEST_HDR_NS, TEST_HDR_REQUEST_ELEM),
                        ob,
                        new JAXBDataBinding(ob.getClass()));
                hdr.setMustUnderstand(mu);

                List<Header> holder = new ArrayList<Header>();
                holder.add(hdr);
               
                //Add List of headerHolders to requestContext.
View Full Code Here

            return null;
        }
        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(WSConstants.WSSE_NS, "wsse:Security");
        el.setAttributeNS(WSConstants.XMLNS_NS, "xmlns:wsse", WSConstants.WSSE_NS);
        SoapHeader sh = new SoapHeader(new QName(WSConstants.WSSE_NS, "Security"), el);
        sh.setMustUnderstand(true);
        message.getHeaders().add(sh);
        return sh;
    }
View Full Code Here

        List<?> headers = (List<?>) serviceProxy.getResponseContext().get(Header.HEADER_LIST);
        QName testQName = new QName("http://test", "test");
        if (headers != null) {
            for (Object o : headers) {
                if (o instanceof SoapHeader) {
                    SoapHeader soapHeader = (SoapHeader) o;
                    QName qName = soapHeader.getName();
                    if (testQName.getNamespaceURI().equals(qName.getNamespaceURI())
                            && testQName.getLocalPart().equals(qName.getLocalPart())) {
                        Node returnedContent = (Node) soapHeader.getObject();
                        assertEquals("test", returnedContent.getTextContent());
                        return;
                    }
                }
            }
View Full Code Here

                            && nd.isSameNode(((Element)header.getObject()).getParentNode())) {
                            continue;
                        }
                    }
                    if (header instanceof SoapHeader) {
                        SoapHeader soapHeader = (SoapHeader)header;
                        writer = new SOAPHeaderWriter(xtw, soapHeader, soapVersion, soapPrefix);
                    }
                    DataBinding b = header.getDataBinding();
                    if (b == null) {
                        HeaderProcessor hp = bus.getExtension(HeaderManager.class)
View Full Code Here

                                 T value,
                                 QName qname,
                                 Class<T> clz,
                                 JAXBContext ctx,
                                 boolean mustUnderstand) throws JAXBException {
        SoapHeader h = new SoapHeader(qname, new JAXBElement<T>(qname, clz, value),
                                      new JAXBDataBinding(ctx));
        h.setMustUnderstand(mustUnderstand);
        message.getHeaders().add(h);
    }
View Full Code Here

                                      soapVersion.getNamespace());  
                List<Header> hdrList = message.getHeaders();
                for (Header header : hdrList) {
                    XMLStreamWriter writer = xtw;
                    if (header instanceof SoapHeader) {
                        SoapHeader soapHeader = (SoapHeader)header;
                        writer = new SOAPHeaderWriter(xtw, soapHeader, soapVersion, soapPrefix);
                    }
                    DataBinding b = header.getDataBinding();
                    if (b == null) {
                        HeaderProcessor hp = bus.getExtension(HeaderManager.class)
View Full Code Here

            return null;
        }
        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(WSConstants.WSSE_NS, "wsse:Security");
        el.setAttributeNS(WSConstants.XMLNS_NS, "xmlns:wsse", WSConstants.WSSE_NS);
        SoapHeader sh = new SoapHeader(new QName(WSConstants.WSSE_NS, "Security"), el);
        sh.setMustUnderstand(true);
        message.getHeaders().add(sh);
        return sh;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.soap.SoapHeader

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.