com.sun.xml.internal.ws.api.message.AddressingUtils Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.message.AddressingUtils. 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: WsaTube.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example #2
Source File: DispatchImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}
 
Example #3
Source File: WsaClientTube.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #4
Source File: W3CWsaClientTube.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }

}
 
Example #5
Source File: WsaTube.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example #6
Source File: DispatchImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}
 
Example #7
Source File: WsaClientTube.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #8
Source File: WsaTube.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example #9
Source File: MemberSubmissionWsaClientTube.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@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 no wsa:To header is found
    if (!foundTo) {
        throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);
    }

    if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {

        // 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);
            }
        }
    }
}
 
Example #10
Source File: W3CWsaClientTube.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }

}
 
Example #11
Source File: DispatchImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}
 
Example #12
Source File: W3CWsaClientTube.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }

}
 
Example #13
Source File: WsaClientTube.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #14
Source File: DispatchImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}
 
Example #15
Source File: WsaTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example #16
Source File: WsaTube.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example #17
Source File: DispatchImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}
 
Example #18
Source File: WsaClientTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #19
Source File: MemberSubmissionWsaClientTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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 no wsa:To header is found
    if (!foundTo) {
        throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);
    }

    if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {

        // 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);
            }
        }
    }
}
 
Example #20
Source File: W3CWsaClientTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }

}
 
Example #21
Source File: DispatchImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}
 
Example #22
Source File: W3CWsaClientTube.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }

}
 
Example #23
Source File: WsaTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example #24
Source File: MemberSubmissionWsaClientTube.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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 no wsa:To header is found
    if (!foundTo) {
        throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);
    }

    if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {

        // 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);
            }
        }
    }
}
 
Example #25
Source File: DispatchImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}
 
Example #26
Source File: WsaClientTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #27
Source File: MemberSubmissionWsaClientTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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 no wsa:To header is found
    if (!foundTo) {
        throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);
    }

    if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {

        // 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);
            }
        }
    }
}
 
Example #28
Source File: W3CWsaClientTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }

}
 
Example #29
Source File: WsaTube.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example #30
Source File: DispatchImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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);
      }
    }
  }
}