Package org.apache.cxf.binding.soap

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


                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

            } else {
                obj = p.getDataBinding().createReader(Node.class).read(elem);
            }
            //TODO - add the interceptors
               
            SoapHeader shead = new SoapHeader(new QName(elem.getNamespaceURI(),
                                                        elem.getLocalName()),
                                               obj,
                                               dataBinding);
            shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
               
            String mu = elem.getAttributeNS(message.getVersion().getNamespace(),
                    message.getVersion().getAttrNameMustUnderstand());
            String act = elem.getAttributeNS(message.getVersion().getNamespace(),
                    message.getVersion().getAttrNameRole());
               
            shead.setActor(act);
            shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
            Header oldHdr = message.getHeader(
                    new QName(elem.getNamespaceURI(), elem.getLocalName()));
            if (oldHdr != null) {
                message.getHeaders().remove(oldHdr);
            }
View Full Code Here

            } else {
                obj = p.getDataBinding().createReader(Node.class).read(elem);
            }
            //TODO - add the interceptors
               
            SoapHeader shead = new SoapHeader(new QName(elem.getNamespaceURI(),
                                                        elem.getLocalName()),
                                               obj,
                                               dataBinding);
            shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
               
            String mu = elem.getAttributeNS(message.getVersion().getNamespace(),
                    message.getVersion().getAttrNameMustUnderstand());
            String act = elem.getAttributeNS(message.getVersion().getNamespace(),
                    message.getVersion().getAttrNameRole());
               
            shead.setActor(act);
            shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
            Header oldHdr = message.getHeader(
                    new QName(elem.getNamespaceURI(), elem.getLocalName()));
            if (oldHdr != null) {
                message.getHeaders().remove(oldHdr);
            }
View Full Code Here

                            dataBinding = p.getDataBinding();
                            obj = dataBinding.createReader(Node.class).read(hel);
                        }
                        //TODO - add the interceptors
                       
                        SoapHeader shead = new SoapHeader(new QName(hel.getNamespaceURI(),
                                                                    hel.getLocalName()),
                                                           obj,
                                                           dataBinding);
                        String mu = hel.getAttributeNS(soapVersion.getNamespace(),
                                                      soapVersion.getAttrNameMustUnderstand());
                        String act = hel.getAttributeNS(soapVersion.getNamespace(),
                                                        soapVersion.getAttrNameRole());

                        if (!StringUtils.isEmpty(act)) {
                            shead.setActor(act);
                        }
                        shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
                        //mark header as inbound header.(for distinguishing between the  direction to
                        //avoid piggybacking of headers from request->server->response.
                        shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
                        message.getHeaders().add(shead);
                       
                        hel = DOMUtils.getNextElement(hel);
                    }
                }
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

        m.getSOAPPart().setContent(new StreamSource(ins));
       
        Element el = DOMUtils.getFirstElement(m.getSOAPPart().getEnvelope().getHeader());
        List<Header> h = soapMessage.getHeaders();
        while (el != null) {
            h.add(new SoapHeader(DOMUtils.getElementQName(el), el));
            el = DOMUtils.getNextElement(el);
        }
        soapMessage.setContent(SOAPMessage.class, m);
        W3CDOMStreamWriter writer = new SAAJStreamWriter(m.getSOAPPart());
        soapMessage.setContent(XMLStreamWriter.class, writer);
View Full Code Here

                } else {
                    obj = p.getDataBinding().createReader(Node.class).read(nd);
                }
                //TODO - add the interceptors
               
                SoapHeader shead = new SoapHeader(new QName(nd.getNamespaceURI(),
                        nd.getLocalName()),
                                                   obj,
                                                   dataBinding);
                shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
               
                String mu = hel.getAttributeNS(message.getVersion().getNamespace(),
                        message.getVersion().getAttrNameMustUnderstand());
                String act = hel.getAttributeNS(message.getVersion().getNamespace(),
                        message.getVersion().getAttrNameRole());
               
                shead.setActor(act);
                shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
                Header oldHdr = message.getHeader(
                        new QName(nd.getNamespaceURI(), nd.getLocalName()));
                if (oldHdr != null) {
                    message.getHeaders().remove(oldHdr);
                }
View Full Code Here

                            } else {
                                obj = p.getDataBinding().createReader(Node.class).read(node);
                            }
                            //TODO - add the interceptors
                           
                            SoapHeader shead = new SoapHeader(new QName(node.getNamespaceURI(),
                                                                        node.getLocalName()),
                                                               obj,
                                                               dataBinding);
                            String mu = hel.getAttributeNS(soapVersion.getNamespace(),
                                                          soapVersion.getAttrNameMustUnderstand());
                            String act = hel.getAttributeNS(soapVersion.getNamespace(),
                                                            soapVersion.getAttrNameRole());
                           
                            shead.setActor(act);
                            shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
                            //mark header as inbound header.(for distinguishing between the  direction to
                            //avoid piggybacking of headers from request->server->response.
                            shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
                            message.getHeaders().add(shead);
                        }                       
                    }
                }
                //advance to just outside the <soap:body> opening tag, but not
View Full Code Here

                            dataBinding = p.getDataBinding();
                            obj = dataBinding.createReader(Node.class).read(hel);
                        }
                        //TODO - add the interceptors
                       
                        SoapHeader shead = new SoapHeader(new QName(hel.getNamespaceURI(),
                                                                    hel.getLocalName()),
                                                           obj,
                                                           dataBinding);
                        String mu = hel.getAttributeNS(soapVersion.getNamespace(),
                                                      soapVersion.getAttrNameMustUnderstand());
                        String act = hel.getAttributeNS(soapVersion.getNamespace(),
                                                        soapVersion.getAttrNameRole());

                        if (!StringUtils.isEmpty(act)) {
                            shead.setActor(act);
                        }
                        shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
                        //mark header as inbound header.(for distinguishing between the  direction to
                        //avoid piggybacking of headers from request->server->response.
                        shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
                        message.getHeaders().add(shead);
                       
                        hel = DOMUtils.getNextElement(hel);
                    }
                }
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.