Examples of StringHeader


Examples of com.sun.xml.ws.message.StringHeader

        // wsa:Action, add if the message doesn't already contain it,
        // generally true for SEI case where there is SEIModel or WSDLModel
        //           false for Provider with no wsdl, Expects User to set the coresponding header on the Message.
        if (AddressingUtils.getAction(responsePacket.getMessage().getHeaders(), av, sv) == null) {
            //wsa:Action header is not set in the message, so use the wsa:Action  passed as the parameter.
            hl.add(new StringHeader(av.actionTag, action, sv, mustUnderstand));
        }

        // wsa:MessageID
        if (responsePacket.getMessage().getHeaders().get(av.messageIDTag, false) == null) {
            // if header doesn't exist, method getID creates a new random id
            String newID = Message.generateMessageID();
            hl.add(new StringHeader(av.messageIDTag, newID));
        }

        // wsa:RelatesTo
        String mid = null;
        if (wpb != null) {
            mid = wpb.getMessageID();
        }
        if (mid == null) {
            mid = AddressingUtils.getMessageID(msg.getHeaders(), av, sv);
        }
        if (mid != null) {
            hl.addOrReplace(new RelatesToHeader(av.relatesToTag, mid));
        }
   

        // populate reference parameters
        WSEndpointReference refpEPR = null;
        if (responsePacket.getMessage().isFault()) {
            // choose FaultTo
            if (wpb != null) {
                refpEPR = wpb.getFaultToFromRequest();
            }
            if (refpEPR == null) {
                refpEPR = AddressingUtils.getFaultTo(msg.getHeaders(), av, sv);
            }
            // if FaultTo is null, then use ReplyTo
            if (refpEPR == null) {
                refpEPR = replyTo;
            }
        } else {
            // choose ReplyTo
            refpEPR = replyTo;
        }
        if (replaceToTag && refpEPR != null) {
            hl.addOrReplace(new StringHeader(av.toTag, refpEPR.getAddress()));
            refpEPR.addReferenceParametersToList(hl);
        }
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

        if (av != null) {
            uuid = AddressingUtils.getMessageID(getHeaders(), av, sv);
        }
        if (uuid == null) {
            uuid = generateMessageID();
            getHeaders().add(new StringHeader(av.messageIDTag, uuid));
        }
        return uuid;
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

        // wsa:Action, add if the message doesn't already contain it,
        // generally true for SEI case where there is SEIModel or WSDLModel
        //           false for Provider with no wsdl, Expects User to set the coresponding header on the Message.
        if (AddressingUtils.getAction(responsePacket.getMessage().getHeaders(), av, sv) == null) {
            //wsa:Action header is not set in the message, so use the wsa:Action  passed as the parameter.
            hl.add(new StringHeader(av.actionTag, action, sv, mustUnderstand));
        }

        // wsa:MessageID
        if (responsePacket.getMessage().getHeaders().get(av.messageIDTag, false) == null) {
            // if header doesn't exist, method getID creates a new random id
            String newID = Message.generateMessageID();
            hl.add(new StringHeader(av.messageIDTag, newID));
        }

        // wsa:RelatesTo
        String mid = null;
        if (wpb != null) {
            mid = wpb.getMessageID();
        }
        if (mid == null) {
            mid = AddressingUtils.getMessageID(msg.getHeaders(), av, sv);
        }
        if (mid != null) {
            hl.addOrReplace(new RelatesToHeader(av.relatesToTag, mid));
        }
   

        // populate reference parameters
        WSEndpointReference refpEPR = null;
        if (responsePacket.getMessage().isFault()) {
            // choose FaultTo
            if (wpb != null) {
                refpEPR = wpb.getFaultToFromRequest();
            }
            if (refpEPR == null) {
                refpEPR = AddressingUtils.getFaultTo(msg.getHeaders(), av, sv);
            }
            // if FaultTo is null, then use ReplyTo
            if (refpEPR == null) {
                refpEPR = replyTo;
            }
        } else {
            // choose ReplyTo
            refpEPR = replyTo;
        }
        if (replaceToTag && refpEPR != null) {
            hl.addOrReplace(new StringHeader(av.toTag, refpEPR.getAddress()));
            refpEPR.addReferenceParametersToList(hl);
        }
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

        // wsa:Action, add if the message doesn't already contain it,
        // generally true for SEI case where there is SEIModel or WSDLModel
        //           false for Provider with no wsdl, Expects User to set the coresponding header on the Message.
        if (AddressingUtils.getAction(responsePacket.getMessage().getHeaders(), av, sv) == null) {
            //wsa:Action header is not set in the message, so use the wsa:Action  passed as the parameter.
            hl.add(new StringHeader(av.actionTag, action, sv, mustUnderstand));
        }

        // wsa:MessageID
        if (responsePacket.getMessage().getHeaders().get(av.messageIDTag, false) == null) {
            // if header doesn't exist, method getID creates a new random id
            String newID = Message.generateMessageID();
            hl.add(new StringHeader(av.messageIDTag, newID));
        }

        // wsa:RelatesTo
        String mid = null;
        if (wpb != null) {
            mid = wpb.getMessageID();
        }
        if (mid == null) {
            mid = AddressingUtils.getMessageID(msg.getHeaders(), av, sv);
        }
        if (mid != null) {
            hl.addOrReplace(new RelatesToHeader(av.relatesToTag, mid));
        }
   

        // populate reference parameters
        WSEndpointReference refpEPR = null;
        if (responsePacket.getMessage().isFault()) {
            // choose FaultTo
            if (wpb != null) {
                refpEPR = wpb.getFaultToFromRequest();
            }
            if (refpEPR == null) {
                refpEPR = AddressingUtils.getFaultTo(msg.getHeaders(), av, sv);
            }
            // if FaultTo is null, then use ReplyTo
            if (refpEPR == null) {
                refpEPR = replyTo;
            }
        } else {
            // choose ReplyTo
            refpEPR = replyTo;
        }
        if (replaceToTag && refpEPR != null) {
            hl.addOrReplace(new StringHeader(av.toTag, refpEPR.getAddress()));
            refpEPR.addReferenceParametersToList(hl);
        }
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

        if (av != null) {
            uuid = AddressingUtils.getMessageID(getHeaders(), av, sv);
        }
        if (uuid == null) {
            uuid = generateMessageID();
            getHeaders().add(new StringHeader(av.messageIDTag, uuid));
        }
        return uuid;
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

            }

            // wsa:MessageID
            if (packet.getMessage().getHeaders().get(av.messageIDTag, false) == null) {
                if (headers.get(av.messageIDTag, false) == null) {
                    Header h = new StringHeader(av.messageIDTag, Message.generateMessageID());
                    headers.add(h);
                }
            }
        }
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

                    headers.add(replyToEpr.createHeader(av.replyToTag));
                    // add wsa:MessageID only for non-null ReplyTo
                    if (packet.getMessage().getHeaders().get(av.messageIDTag, false) == null) {
                        // if header doesn't exist, method getID creates a new random id
                        String newID = oneWayFeature.getMessageId() == null ? Message.generateMessageID() : oneWayFeature.getMessageId();
                        headers.add(new StringHeader(av.messageIDTag, newID));
                        isMessageIdAdded = true;
                    }
                }
            }

            // If the user sets a messageId, use it.
            final String messageId = oneWayFeature.getMessageId();
            if (!isMessageIdAdded && messageId != null) {
                headers.add(new StringHeader(av.messageIDTag, messageId));
            }

            // wsa:FaultTo
            // add if it doesn't already exist and OneWayFeature requests a specific FaultTo
            if (headers.get(av.faultToTag, false) == null) {
                WSEndpointReference faultToEpr = oneWayFeature.getFaultTo();
                if (faultToEpr != null) {
                    headers.add(faultToEpr.createHeader(av.faultToTag));
                    // add wsa:MessageID only for non-null FaultTo
                    if (headers.get(av.messageIDTag, false) == null) {
                        headers.add(new StringHeader(av.messageIDTag, Message.generateMessageID()));
                  }
                }
            }

            // wsa:From
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

            throw new IllegalArgumentException(AddressingMessages.NULL_ACTION());
        }

        // wsa:To
        if (headers.get(av.toTag, false) == null) {
          StringHeader h = new StringHeader(av.toTag, packet.endpointAddress.toString());
          headers.add(h);
        }

        // wsa:Action
        if (action != null) {
            packet.soapAction = action;
            if (headers.get(av.actionTag, false) == null) {
                //As per WS-I BP 1.2/2.0, if one of the WSA headers is MU, then all WSA headers should be treated as MU.,
                // so just set MU on action header
              StringHeader h = new StringHeader(av.actionTag, action, sv, mustUnderstand);
              headers.add(h);
            }
        }
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

     *
     * @param name QName of the header element
     * @param value text value of the header
     */
    public static Header create(QName name, String value) {
        return new StringHeader(name, value);
    }
View Full Code Here

Examples of com.sun.xml.ws.message.StringHeader

     *
     * @param name QName of the header element
     * @param value text value of the header
     */
    public static Header createMustUnderstand(@NotNull SOAPVersion soapVersion, @NotNull QName name,@NotNull String value) {
        return new StringHeader(name, value,soapVersion,true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.