/** * Returns the value of WS-Addressing {@code Action} header. The {@code version} * identifies the WS-Addressing version and the header returned is targeted at * the current implicit role. Caches the value for subsequent invocation. * Duplicate {@code Action} headers are detected earlier. * * @param av WS-Addressing version * @param sv SOAP version * @throws IllegalArgumentException if either {@code av} or {@code sv} is null. * @return Value of WS-Addressing Action header, null if no header is present */ public String getAction(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { return AddressingUtils.getAction(this, av, sv); }
/** * Returns the value of WS-Addressing {@code Action} header. The {@code version} * identifies the WS-Addressing version and the header returned is targeted at * the current implicit role. Caches the value for subsequent invocation. * Duplicate {@code Action} headers are detected earlier. * * @param av WS-Addressing version * @param sv SOAP version * @throws IllegalArgumentException if either {@code av} or {@code sv} is null. * @return Value of WS-Addressing Action header, null if no header is present */ public String getAction(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { return AddressingUtils.getAction(this, av, sv); }
/** * Returns the value of WS-Addressing {@code Action} header. The {@code version} * identifies the WS-Addressing version and the header returned is targeted at * the current implicit role. Caches the value for subsequent invocation. * Duplicate {@code Action} headers are detected earlier. * * @param av WS-Addressing version * @param sv SOAP version * @throws IllegalArgumentException if either {@code av} or {@code sv} is null. * @return Value of WS-Addressing Action header, null if no header is present */ public String getAction(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { return AddressingUtils.getAction(this, av, sv); }
protected void validateSOAPAction(Packet packet) { String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION()); if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) { throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag); } }
protected void validateSOAPAction(Packet packet) { String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION()); if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) { throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag); } }
protected void validateSOAPAction(Packet packet) { String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION()); if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) { throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag); } }
@Override protected void validateAction(Packet packet) { //There may not be a WSDL operation. There may not even be a WSDL. //For instance this may be a RM CreateSequence message. WSDLBoundOperation wbo = getWSDLBoundOperation(packet); if (wbo == null) return; String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION()); String expected = helper.getOutputAction(packet); if (expected != null && !gotA.equals(expected)) throw new ActionNotSupportedException(gotA); }
@Override protected void validateAction(Packet packet) { //There may not be a WSDL operation. There may not even be a WSDL. //For instance this may be a RM CreateSequence message. WSDLBoundOperation wbo = getWSDLBoundOperation(packet); if (wbo == null) return; String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION()); String expected = helper.getOutputAction(packet); if (expected != null && !gotA.equals(expected)) throw new ActionNotSupportedException(gotA); }
@Override protected void validateAction(Packet packet) { //There may not be a WSDL operation. There may not even be a WSDL. //For instance this may be a RM CreateSequence message. WSDLBoundOperation wbo = getWSDLBoundOperation(packet); if (wbo == null) return; String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION()); String expected = helper.getOutputAction(packet); if (expected != null && !gotA.equals(expected)) throw new ActionNotSupportedException(gotA); }
@Override protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo, boolean foundFaultTo, boolean foundMessageID, boolean foundRelatesTo) { super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo, foundFaultTo, foundMessageID, foundRelatesTo); // if it is not one-way, response must contain wsa:RelatesTo // RelatesTo required as per // Table 5-3 of http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#wsdl11requestresponse if (expectReply && (packet.getMessage() != null) && !foundRelatesTo) { String action = AddressingUtils.getAction(packet.getMessage().getHeaders(), addressingVersion, soapVersion); // Don't check for AddressingFaults as // Faults for requests with duplicate MessageId will have no wsa:RelatesTo if (!packet.getMessage().isFault() || !action.equals(addressingVersion.getDefaultFaultAction())) { throw new MissingAddressingHeaderException(addressingVersion.relatesToTag,packet); } } } }
@Override protected void validateAction(Packet packet) { //There may not be a WSDL operation. There may not even be a WSDL. //For instance this may be a RM CreateSequence message. WSDLBoundOperation wsdlBoundOperation = getWSDLBoundOperation(packet); if (wsdlBoundOperation == null) { return; } String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) { throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION()); } String expected = helper.getInputAction(packet); String soapAction = helper.getSOAPAction(packet); if (helper.isInputActionDefault(packet) && (soapAction != null && !soapAction.equals(""))) { expected = soapAction; } if (expected != null && !gotA.equals(expected)) { throw new ActionNotSupportedException(gotA); } }
@Override protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo, boolean foundFaultTo, boolean foundMessageID, boolean foundRelatesTo) { super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo, foundFaultTo, foundMessageID, foundRelatesTo); // if it is not one-way, response must contain wsa:RelatesTo // RelatesTo required as per // Table 5-3 of http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#wsdl11requestresponse if (expectReply && (packet.getMessage() != null) && !foundRelatesTo) { String action = AddressingUtils.getAction(packet.getMessage().getHeaders(), addressingVersion, soapVersion); // Don't check for AddressingFaults as // Faults for requests with duplicate MessageId will have no wsa:RelatesTo if (!packet.getMessage().isFault() || !action.equals(addressingVersion.getDefaultFaultAction())) { throw new MissingAddressingHeaderException(addressingVersion.relatesToTag,packet); } } } }
@Override protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo, boolean foundFaultTo, boolean foundMessageID, boolean foundRelatesTo) { super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo, foundFaultTo, foundMessageID, foundRelatesTo); // if it is not one-way, response must contain wsa:RelatesTo // RelatesTo required as per // Table 5-3 of http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#wsdl11requestresponse if (expectReply && (packet.getMessage() != null) && !foundRelatesTo) { String action = AddressingUtils.getAction(packet.getMessage().getHeaders(), addressingVersion, soapVersion); // Don't check for AddressingFaults as // Faults for requests with duplicate MessageId will have no wsa:RelatesTo if (!packet.getMessage().isFault() || !action.equals(addressingVersion.getDefaultFaultAction())) { throw new MissingAddressingHeaderException(addressingVersion.relatesToTag,packet); } } } }
final boolean isAddressingEngagedOrRequired(Packet packet, WSBinding binding) { if (AddressingVersion.isRequired(binding)) return true; if (packet == null) return false; if (packet.getMessage() == null) return false; if (packet.getMessage().getHeaders() != null) return false; String action = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (action == null) return true; return true; }
final boolean isAddressingEngagedOrRequired(Packet packet, WSBinding binding) { if (AddressingVersion.isRequired(binding)) return true; if (packet == null) return false; if (packet.getMessage() == null) return false; if (packet.getMessage().getHeaders() != null) return false; String action = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (action == null) return true; return true; }
@Override protected void validateAction(Packet packet) { //There may not be a WSDL operation. There may not even be a WSDL. //For instance this may be a RM CreateSequence message. WSDLBoundOperation wsdlBoundOperation = getWSDLBoundOperation(packet); if (wsdlBoundOperation == null) { return; } String gotA = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (gotA == null) { throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION()); } String expected = helper.getInputAction(packet); String soapAction = helper.getSOAPAction(packet); if (helper.isInputActionDefault(packet) && (soapAction != null && !soapAction.equals(""))) { expected = soapAction; } if (expected != null && !gotA.equals(expected)) { throw new ActionNotSupportedException(gotA); } }
final boolean isAddressingEngagedOrRequired(Packet packet, WSBinding binding) { if (AddressingVersion.isRequired(binding)) return true; if (packet == null) return false; if (packet.getMessage() == null) return false; if (packet.getMessage().getHeaders() != null) return false; String action = AddressingUtils.getAction( packet.getMessage().getHeaders(), addressingVersion, soapVersion); if (action == null) return true; return true; }
private void dumpParam(T param, String method) { if (param instanceof Packet) { Packet message = (Packet)param; String action; String msgId; if (LOGGER.isLoggable(Level.FINE)) { AddressingVersion av = DispatchImpl.this.getBinding().getAddressingVersion(); SOAPVersion sv = DispatchImpl.this.getBinding().getSOAPVersion(); action = av != null && message.getMessage() != null ? AddressingUtils.getAction(message.getMessage().getHeaders(), av, sv) : null; msgId = av != null && message.getMessage() != null ? AddressingUtils.getMessageID(message.getMessage().getHeaders(), av, sv) : null; LOGGER.fine("In DispatchImpl." + method + " for message with action: " + action + " and msg ID: " + msgId + " msg: " + message.getMessage()); if (message.getMessage() == null) { LOGGER.fine("Dispatching null message for action: " + action + " and msg ID: " + msgId); } } } } public final Future<?> invokeAsync(T param, AsyncHandler<T> asyncHandler) {
private void dumpParam(T param, String method) { if (param instanceof Packet) { Packet message = (Packet)param; String action; String msgId; if (LOGGER.isLoggable(Level.FINE)) { AddressingVersion av = DispatchImpl.this.getBinding().getAddressingVersion(); SOAPVersion sv = DispatchImpl.this.getBinding().getSOAPVersion(); action = av != null && message.getMessage() != null ? AddressingUtils.getAction(message.getMessage().getHeaders(), av, sv) : null; msgId = av != null && message.getMessage() != null ? AddressingUtils.getMessageID(message.getMessage().getHeaders(), av, sv) : null; LOGGER.fine("In DispatchImpl." + method + " for message with action: " + action + " and msg ID: " + msgId + " msg: " + message.getMessage()); if (message.getMessage() == null) { LOGGER.fine("Dispatching null message for action: " + action + " and msg ID: " + msgId); } } } } public final Future<?> invokeAsync(T param, AsyncHandler<T> asyncHandler) {
public Packet relateServerResponse(@Nullable Packet r, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding) { relatePackets(r, false); r.setState(State.ServerResponse); AddressingVersion av = binding.getAddressingVersion(); // populate WS-A headers only if WS-A is enabled if (av == null) { return r; } if (getMessage() == null) { return r; } //populate WS-A headers only if the request has addressing headers String inputAction = AddressingUtils.getAction(getMessage().getHeaders(), av, binding.getSOAPVersion()); if (inputAction == null) { return r; } // if one-way, then dont populate any WS-A headers if (r.getMessage() == null || (wsdlPort != null && getMessage().isOneWay(wsdlPort))) { return r; } // otherwise populate WS-Addressing headers populateAddressingHeaders(binding, r, wsdlPort, seiModel); return r; }