Package com.sun.xml.ws.rx

Examples of com.sun.xml.ws.rx.RxRuntimeException


            mcSenderTask.start(); // starting the McSenderTask
        }

        final Message message = request.getMessage();
        if (!message.hasHeaders()) {
            throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0102_NO_SOAP_HEADERS()));
        }


        if (needToSetWsmcAnnonymousHeaders(request)) { // annonymous request
            setMcAnnonymousHeaders(
View Full Code Here


        Header replyToHeader = request.getMessage().getHeaders().get(configuration.getAddressingVersion().replyToTag, false);
        if (replyToHeader != null) {
            try {
                return replyToHeader.readAsEPR(configuration.getAddressingVersion()).isAnonymous();
            } catch (XMLStreamException ex) {
                throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0103_ERROR_RETRIEVING_WSA_REPLYTO_CONTENT(), ex));
            }
        }

        // this request seems to be one-way, need to check if there are is an RM AckRequest set on it.
        // FIXME: this should be made in a RM-agnostic way
View Full Code Here

                if (configuration.getRuntimeVersion().protocolVersion.isFault(faultAction)) {
                    SOAPFault fault = null;
                    try {
                        fault = responseMessage.readAsSOAPMessage().getSOAPBody().getFault();
                    } catch (SOAPException ex) {
                        throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0114_ERROR_UNMARSHALLING_SOAP_FAULT(), ex));
                    }

                    throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0115_UNEXPECTED_PROTOCOL_ERROR(fault.getFaultString())));
                }
            }

            Header wsaRelatesToHeader = responseMessage.getHeaders().get(configuration.getAddressingVersion().relatesToTag, false);
            if (wsaRelatesToHeader != null) {
View Full Code Here

            MakeConnectionElement mcElement;
            try {
                mcElement = request.getMessage().readPayloadAsJAXB(configuration.getRuntimeVersion().getUnmarshaller(configuration.getAddressingVersion()));
            } catch (JAXBException ex) {
                throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0107_ERROR_UNMARSHALLING_PROTOCOL_MESSAGE(), ex));
            }

            if (mcElement.getAddress() == null) {
                // WS-I RSP v1.0: R2102   If a wsmc:MakeConnection request does not contain a wsmc:Address child element
                // (in violation of R2100), the MC-RECEIVER MUST generate a wsmc:MissingSelection fault.
                return super.doReturnWith(createSoapFaultResponse(
                        request,
                        configuration.getSoapVersion(),
                        configuration.getAddressingVersion(),
                        configuration.getRuntimeVersion().protocolVersion.wsmcFaultAction,
                        configuration.getSoapVersion().faultCodeServer,
                        configuration.getRuntimeVersion().protocolVersion.missingSelectionFaultCode,
                        "The MakeConnection element did not contain any selection criteria.",
                        null));
            }

            if (!mcElement.getAny().isEmpty()) {
                // WS-I RSP v1.0: R2103 If a wsmc:MakeConnection request contains a wsrm:Identifier element
                // (in violation of R2101) the MC-RECEIVER MUST generate a wsmc:UnsupportedSelection fault.
                List<SoapFaultDetailEntry> unsupportedSelections = new ArrayList<SoapFaultDetailEntry>(mcElement.getAny().size());
                for (Object element : mcElement.getAny()) {
                    if (element instanceof Node) {
                        Node selectionNode = ((Node) element);
                        unsupportedSelections.add(new SoapFaultDetailEntry(
                                configuration.getRuntimeVersion().protocolVersion.unsupportedSelectionFaultCode,
                                new QName(selectionNode.getNamespaceURI(), selectionNode.getLocalName()).toString()));
                    }
                }

                return super.doReturnWith(createSoapFaultResponse(
                        request,
                        configuration.getSoapVersion(),
                        configuration.getAddressingVersion(),
                        configuration.getRuntimeVersion().protocolVersion.wsmcFaultAction,
                        configuration.getSoapVersion().faultCodeServer,
                        configuration.getRuntimeVersion().protocolVersion.unsupportedSelectionFaultCode,
                        "The extension element used in the message selection is not supported by the MakeConnection receiver.",
                        unsupportedSelections));
            }

            String selectionUID = configuration.getRuntimeVersion().getClientId(mcElement.getAddress().getValue());

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

            if (clientUID != null && !selectionUID.equals(clientUID)) {
                // Fixed WSIT issue #1334:
                // This cannot be an excpetion, because according to the WS=MakeConnection specification,
View Full Code Here

        if (replyToHeader != null) {
            try {
                String replyToAddress = replyToHeader.readAsEPR(configuration.getAddressingVersion()).getAddress();
                return configuration.getRuntimeVersion().getClientId(replyToAddress);
            } catch (XMLStreamException ex) {
                throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0103_ERROR_RETRIEVING_WSA_REPLYTO_CONTENT(), ex));
            }
        }

        return null;
    }
View Full Code Here

                            detail.addDetailEntry(entry.name).setValue(entry.value);
                        }
                    }
                    break;
                default:
                    throw new RxRuntimeException("Unsupported SOAP version: '" + soapVersion.toString() + "'");
            }

            Message soapFaultMessage = Messages.create(soapFault);

            return request.createServerResponse(soapFaultMessage, av, soapVersion, action);

        } catch (SOAPException ex) {
            throw new RxRuntimeException("Error creating a SOAP fault", ex);
        }
    }
View Full Code Here

    public Sequence createInboundSequence(final String sequenceId, final String strId, final long expirationTime) throws DuplicateSequenceException {
        final long actualSessions = actualConcurrentInboundSequences.incrementAndGet();
        if (maxConcurrentInboundSequences >= 0) {
            if (maxConcurrentInboundSequences < actualSessions) {
                actualConcurrentInboundSequences.decrementAndGet();
                throw new RxRuntimeException(LocalizationMessages.WSRM_1156_MAX_CONCURRENT_SESSIONS_REACHED(maxConcurrentInboundSequences));
            }
        }

        PersistentSequenceData data = PersistentSequenceData.newInstance(this, cm, uniqueEndpointId, sequenceId, PersistentSequenceData.SequenceType.Inbound, strId, expirationTime, Sequence.State.CREATED, false, InboundSequence.INITIAL_LAST_MESSAGE_ID, currentTimeInMillis(), 0L);
        return registerSequence(new InboundSequence(data, inboundQueueBuilder, this), data.getBoundSequenceId());
View Full Code Here

                    } else if (rmVersion.closeSequenceAction.equals(wsaAction)) {
                        handleCloseSequenceAction(protocolMessagePacket);
                    } else if (rmVersion.terminateSequenceAction.equals(wsaAction)) {
                        handleTerminateSequenceAction(protocolMessagePacket);
                    } else {
                        throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSRM_1134_UNSUPPORTED_PROTOCOL_MESSAGE(wsaAction)));
                    }
                } else {
                    LOGGER.severe(LocalizationMessages.WSRM_1120_RESPONSE_NOT_IDENTIFIED_AS_PROTOCOL_MESSAGE());
                }
            }
View Full Code Here

        }

        if (responseData.getAcceptedSequenceAcksTo() != null) {
            if (!rc.communicator.getDestinationAddress().getURI().toString()
                    .equals(new WSEndpointReference(responseData.getAcceptedSequenceAcksTo()).getAddress())) {
                throw new RxRuntimeException(LocalizationMessages.WSRM_1116_ACKS_TO_NOT_EQUAL_TO_ENDPOINT_DESTINATION(responseData.getAcceptedSequenceAcksTo().toString(), rc.communicator.getDestinationAddress()));
            }
        }

        String outboundSeqId = responseData.getSequenceId();
        String outboundSeqSTRId = (requestData.getStrType() != null) ? requestData.getStrType().getId() : null;
View Full Code Here

    private Packet sendSessionControlMessage(final String messageName, final Packet request) throws RxRuntimeException {
        int attempt = 0;
        Packet response = null;
        while (true) {
            if (attempt > rc.configuration.getRmFeature().getMaxRmSessionControlMessageResendAttempts()) {
                throw new RxRuntimeException(LocalizationMessages.WSRM_1128_MAX_RM_SESSION_CONTROL_MESSAGE_RESEND_ATTEMPTS_REACHED(messageName));
            }
            try {
                Packet requestCopy = request.copy(true);
                requestCopy.setIsProtocolMessage();
                response = rc.communicator.send(requestCopy);
                break;
            } catch (RuntimeException ex) {
                if (!Utilities.isResendPossible(ex)) {
                    throw new RxRuntimeException(LocalizationMessages.WSRM_1106_SENDING_RM_SESSION_CONTROL_MESSAGE_FAILED(messageName), ex);
                } else {
                    LOGGER.warning(LocalizationMessages.WSRM_1106_SENDING_RM_SESSION_CONTROL_MESSAGE_FAILED(messageName), ex);
                }
            }
            attempt++;
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.rx.RxRuntimeException

Copyright © 2018 www.massapicom. 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.