com.sun.xml.internal.ws.transport.Headers Java Examples

The following examples show how to use com.sun.xml.internal.ws.transport.Headers. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RequestContext.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #2
Source File: RequestContext.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #3
Source File: RequestContext.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #4
Source File: RequestContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #5
Source File: RequestContext.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #6
Source File: RequestContext.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #7
Source File: RequestContext.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #8
Source File: RequestContext.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
    //for bug 12883765
    //retrieve headers which is set in soap message
    Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
    //retrieve headers from request context
    Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
    if ((packetHeaders != null) && (myHeaders != null)) {
        //update the headers set in soap message with those in request context
        for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
            String key = entry.getKey();
            if (key != null && key.trim().length() != 0) {
                List<String> listFromPacket = packetHeaders.get(key);
                //if the two headers contain the same key, combine the value
                if (listFromPacket != null) {
                    listFromPacket.addAll(entry.getValue());
                } else {
                    //add the headers  in request context to those set in soap message
                    packetHeaders.put(key, myHeaders.get(key));
                }
            }
        }
        // update headers in request context with those set in soap message since it may contain other properties..
        asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
    }
}
 
Example #9
Source File: SOAPMessageDispatch.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}
 
Example #10
Source File: SOAPMessageDispatch.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}
 
Example #11
Source File: SOAPMessageDispatch.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}
 
Example #12
Source File: SOAPMessageDispatch.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}
 
Example #13
Source File: SOAPMessageDispatch.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}
 
Example #14
Source File: SOAPMessageDispatch.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}
 
Example #15
Source File: SOAPMessageDispatch.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}
 
Example #16
Source File: SOAPMessageDispatch.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
Packet createPacket(SOAPMessage arg) {
    Iterator iter = arg.getMimeHeaders().getAllHeaders();
    Headers ch = new Headers();
    while(iter.hasNext()) {
        MimeHeader mh = (MimeHeader) iter.next();
        ch.add(mh.getName(), mh.getValue());
    }
    Packet packet = new Packet(SAAJFactory.create(arg));
    packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
    return packet;
}