Package com.sun.xml.ws.api.message

Examples of com.sun.xml.ws.api.message.Header


        HeaderList headers = response.getMessage().getHeaders();

        for (int i = 0; i < headers.size(); i++) {
            if (!headers.isUnderstood(i)) {
                Header header = headers.get(i);
                if (!header.isIgnorable(soapVersion, soapVersion.implicitRoleSet)) {
                    QName qName = new QName(header.getNamespaceURI(), header.getLocalPart());
                    if (WSSE.equals(qName)) {
                        checkSecurityHeader(header);
                    } else {
                        throw new CmisConnectionException("MustUnderstand header is not understood: " + qName);
                    }
View Full Code Here


        try {
            // read the header
            Message msg = context.getMessage();
            HeaderList hl = msg.getHeaders();
            Header securityHeader = hl.get(WSSE_SECURITY, true);

            JAXBElement<SecurityHeaderType> sht = securityHeader.readAsJAXB(WSSE_CONTEXT.createUnmarshaller());

            for (Object uno : sht.getValue().getAny()) {
                if ((uno instanceof JAXBElement) && ((JAXBElement<?>) uno).getValue() instanceof UsernameTokenType) {
                    UsernameTokenType utt = ((JAXBElement<UsernameTokenType>) uno).getValue();
                    username = utt.getUsername().getValue();
View Full Code Here

        try {
            // read the header
            Message msg = context.getMessage();
            HeaderList hl = msg.getHeaders();
            Header securityHeader = hl.get(WSSE_SECURITY, true);

            JAXBElement<SecurityHeaderType> sht = securityHeader.readAsJAXB(WSSE_CONTEXT.createUnmarshaller());

            for (Object uno : sht.getValue().getAny()) {
                if ((uno instanceof JAXBElement) && ((JAXBElement<?>) uno).getValue() instanceof UsernameTokenType) {
                    UsernameTokenType utt = (UsernameTokenType) ((JAXBElement<UsernameTokenType>) uno).getValue();
                    username = utt.getUsername().getValue();
View Full Code Here

    private boolean areHeadersSecured(SignaturePolicy sp) {
        ArrayList list = ((SignaturePolicy.FeatureBinding) sp.getFeatureBinding()).getTargetBindings();
        Iterator<Header> hit = headers.getHeaders();
        while (hit.hasNext()) {
            Header hdr = hit.next();
            String localName = hdr.getLocalPart();
            String uri = hdr.getNamespaceURI();
            boolean found = false;
            if (MessageConstants.ADDRESSING_W3C_NAMESPACE.equals(uri) || MessageConstants.ADDRESSING_MEMBER_SUBMISSION_NAMESPACE.equals(uri)) {
                for (int i = 0; i < list.size(); i++) {
                    SignatureTarget st = (SignatureTarget) list.get(i);
                    QName value = st.getQName();
View Full Code Here

        try {
            // read the header
            Message msg = context.getMessage();
            HeaderList hl = msg.getHeaders();
            Header securityHeader = hl.get(WSSE_SECURITY, true);

            JAXBElement<SecurityHeaderType> sht = securityHeader.readAsJAXB(WSSE_CONTEXT.createUnmarshaller());

            for (Object uno : sht.getValue().getAny()) {
                if ((uno instanceof JAXBElement) && ((JAXBElement<?>) uno).getValue() instanceof UsernameTokenType) {
                    UsernameTokenType utt = (UsernameTokenType) ((JAXBElement<UsernameTokenType>) uno).getValue();
                    username = utt.getUsername().getValue();
View Full Code Here

        boolean foundMessageId = false;
        boolean foundRelatesTo = false;
        QName duplicateHeader = null;

        while (hIter.hasNext()) {
            Header h = hIter.next();

            // check if the Header is in current role
            if (!isInCurrentRole(h, binding)) {
                continue;
            }

            String local = h.getLocalPart();
            if (local.equals(addressingVersion.fromTag.getLocalPart())) {
                if (foundFrom) {
                    duplicateHeader = addressingVersion.fromTag;
                    break;
                }
                foundFrom = true;
            } else if (local.equals(addressingVersion.toTag.getLocalPart())) {
                if (foundTo) {
                    duplicateHeader = addressingVersion.toTag;
                    break;
                }
                foundTo = true;
            } else if (local.equals(addressingVersion.replyToTag.getLocalPart())) {
                if (foundReplyTo) {
                    duplicateHeader = addressingVersion.replyToTag;
                    break;
                }
                foundReplyTo = true;
                try { // verify that the header is in a good shape
                    h.readAsEPR(addressingVersion);
                } catch (XMLStreamException e) {
                    throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
                }
            } else if (local.equals(addressingVersion.faultToTag.getLocalPart())) {
                if (foundFaultTo) {
                    duplicateHeader = addressingVersion.faultToTag;
                    break;
                }
                foundFaultTo = true;
                try { // verify that the header is in a good shape
                    h.readAsEPR(addressingVersion);
                } catch (XMLStreamException e) {
                    throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
                }
            } else if (local.equals(addressingVersion.actionTag.getLocalPart())) {
                if (foundAction) {
View Full Code Here

        understandAddressingHeaders(knownHeaders);

        for (int i = 0; i < headers.size(); i++) {
            if (!headers.isUnderstood(i)) {
                Header header = headers.get(i);
                if (!header.isIgnorable(soapVersion, roles)) {
                    QName qName = new QName(header.getNamespaceURI(), header.getLocalPart());
                    if (! knownHeaders.contains(qName)) {
                        logger.info("Element not understood=" + qName);
                        if (notUnderstoodHeaders == null)
                            notUnderstoodHeaders = new HashSet<QName>();
                        notUnderstoodHeaders.add(qName);
View Full Code Here

    private static void addHeader(Message m, Set<QName> notUnderstoodHeaders) throws SOAPException {
        for (QName qname : notUnderstoodHeaders) {
            SOAPElement soapEl = SOAP_12.saajSoapFactory.createElement(MU_HEADER_DETAIL);
            soapEl.addNamespaceDeclaration("abc", qname.getNamespaceURI());
            soapEl.setAttribute("qname", "abc:" + qname.getLocalPart());
            Header header = new DOMHeader<Element>(soapEl);
            m.getHeaders().add(header);
        }
    }
View Full Code Here

    }

    @Override
    public @NotNull T resolve(Packet request) {
        HeaderList headers = request.getMessage().getHeaders();
        Header header = headers.get(COOKIE_TAG, true);
        String id=null;
        if(header!=null) {
            // find the instance
            id = header.getStringContent();
            Instance o = instances.get(id);
            if(o!=null) {
                o.restartTimer();
                return o.instance;
            }
View Full Code Here

                while(itr.hasNext()) {
                    beanList.add(itr.next().readAsJAXB(jaxbContext.createUnmarshaller()));
                }
            } else {
                while(itr.hasNext()) {
                    Header soapHeader = itr.next();
                    //Check if the role is one of the roles on this Binding
                    String role = soapHeader.getRole(soapVersion);
                    if(getRoles().contains(role)) {
                        beanList.add(soapHeader.readAsJAXB(jaxbContext.createUnmarshaller()));
                    }
                }
            }
            return beanList.toArray();
        } catch(Exception e) {
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.api.message.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.