public void deliver(ApplicationMessage message) {
   if (message instanceof JaxwsApplicationMessage) {
     deliver(JaxwsApplicationMessage.class.cast(message));
   } else {
     throw LOGGER.logSevereException(
         new RxRuntimeException(
             LocalizationMessages.WSRM_1141_UNEXPECTED_MESSAGE_CLASS(
                 message.getClass().getName(), JaxwsApplicationMessage.class.getName())));
   }
 }
Exemplo n.º 2
0
  private String getClientUID(Packet request) {
    Header replyToHeader =
        request
            .getMessage()
            .getHeaders()
            .get(configuration.getAddressingVersion().replyToTag, false);
    if (replyToHeader != null) {
      try {
        String replyToAddress =
            replyToHeader.readAsEPR(configuration.getAddressingVersion()).getAddress();
        return configuration.getMcVersion().getClientId(replyToAddress);
      } catch (XMLStreamException ex) {
        throw LOGGER.logSevereException(
            new RxRuntimeException(
                LocalizationMessages.WSMC_0103_ERROR_RETRIEVING_WSA_REPLYTO_CONTENT(), ex));
      }
    }

    return null;
  }
Exemplo n.º 3
0
  private NextAction handleMakeConnectionRequest(Packet request, String clientUID) {
    try {
      LOGGER.entering();

      String selectionUID;
      try {
        MakeConnectionElement mcElement =
            request
                .getMessage()
                .readPayloadAsJAXB(
                    configuration
                        .getMcVersion()
                        .getUnmarshaller(configuration.getAddressingVersion()));
        selectionUID = configuration.getMcVersion().getClientId(mcElement.getAddress().getValue());
      } catch (JAXBException ex) {
        throw LOGGER.logSevereException(
            new RxRuntimeException(
                LocalizationMessages.WSMC_0107_ERROR_UNMARSHALLING_PROTOCOL_MESSAGE(), ex));
      }

      if (selectionUID == null) {
        // TODO return a MissingSelection SOAP fault
        throw LOGGER.logSevereException(
            new RxRuntimeException(LocalizationMessages.WSMC_0108_NULL_SELECTION_ADDRESS()));
      }

      if (!selectionUID.equals(clientUID)) {
        // TODO return a SOAP fault?
        throw LOGGER.logSevereException(
            new RxRuntimeException(
                LocalizationMessages.WSMC_0109_SELECTION_ADDRESS_NOT_MATCHING_WSA_REPLYTO()));
      }

      Packet response = null;
      if (selectionUID != null && responseStorage.hasPendingResponse(selectionUID)) {
        LOGGER.finer(
            LocalizationMessages.WSMC_0110_PENDING_MESSAGE_FOUND_FOR_SELECTION_UUID(selectionUID));
        response = responseStorage.getPendingResponsePacket(selectionUID);
      }

      if (response == null) {
        LOGGER.finer(
            LocalizationMessages.WSMC_0111_NO_PENDING_MESSAGE_FOUND_FOR_SELECTION_UUID(
                selectionUID));
        response = createEmptyResponse(request);
      } else {
        Message message = response.getMessage();
        if (message != null) {
          HeaderList headers = message.getHeaders();
          headers.add(
              Headers.create(
                  configuration.getMcVersion().getJaxbContext(configuration.getAddressingVersion()),
                  new MessagePendingElement(
                      Boolean.valueOf(
                          selectionUID != null
                              && responseStorage.hasPendingResponse(selectionUID)))));
        }
      }

      return super.doReturnWith(response);
    } finally {
      LOGGER.exiting();
    }
  }