Examples of MessageSender


Examples of org.apache.axis2.clientapi.MessageSender

    public void testEchoXMLSync() throws Exception {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = TestingUtils.createDummyOMElement();

        MessageSender sender = new MessageSender("target/test-resources/intregrationRepo");

        sender.setTo(targetEPR);
        sender.setSenderTransport(Constants.TRANSPORT_HTTP);

        sender.send(operationName.getLocalPart(), payload);
        int index = 0;
        while (envelope == null) {
            Thread.sleep(4000);
            index++;
            if (index == 5) {
View Full Code Here

Examples of org.apache.axis2.clientapi.MessageSender

        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = createEnvelope();

        MessageSender sender = new MessageSender(serviceContext);

        sender.setTo(targetEPR);
        sender.setSenderTransport(Constants.TRANSPORT_MAIL);

        sender.send(operationName.getLocalPart(), payload);
        int index = 0;
        while (envelope == null) {
//          if(index < 10){
                Thread.sleep(4000);
//                index++;
View Full Code Here

Examples of org.apache.axis2.clientapi.MessageSender

    public void testEchoXMLSync() throws Exception {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = TestingUtils.createDummyOMElement();

        MessageSender sender = new MessageSender();

        sender.setTo(targetEPR);
        sender.setSenderTransport(Constants.TRANSPORT_HTTP);

        sender.send(operationName.getLocalPart(), payload);
        int index = 0;
        while(envelope == null){
            Thread.sleep(4000);
            index ++;
            if(index == 5){
View Full Code Here

Examples of org.apache.axis2.clientapi.MessageSender

    public void testEchoXMLSync() throws Exception {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = createEnvelope();

        MessageSender sender = new MessageSender();

        sender.setTo(targetEPR);
        sender.setSenderTransport(Constants.TRANSPORT_LOCAL);
        sender.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        sender.send(operationName.getLocalPart(), payload);
       
    }
View Full Code Here

Examples of org.apache.axis2.clientapi.MessageSender

    public void testEchoXMLSync() throws Exception {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = TestingUtils.createDummyOMElement();

        MessageSender sender = new MessageSender();

        sender.setTo(targetEPR);
        sender.setSenderTransport(Constants.TRANSPORT_HTTP);

        sender.send(operationName.getLocalPart(), payload);
        int index = 0;
        while (envelope == null) {
            Thread.sleep(4000);
            index++;
            if (index == 5) {
View Full Code Here

Examples of org.apache.axis2.clientapi.MessageSender

    public void testEchoXMLSync() throws Exception {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = createEnvelope();

        MessageSender sender = new MessageSender();

        sender.setTo(targetEPR);
        sender.setSenderTransport(Constants.TRANSPORT_LOCAL);
        sender.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        sender.send(operationName.getLocalPart(), payload);

    }
View Full Code Here

Examples of org.apache.axis2.clientapi.MessageSender

        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = createEnvelope();

        MessageSender sender = new MessageSender(serviceContext);

        sender.setTo(targetEPR);
        sender.setSenderTransport(Constants.TRANSPORT_MAIL);

        sender.send(operationName.getLocalPart(), payload);
        int index = 0;
        while (envelope == null) {
//          if(index < 10){
            Thread.sleep(4000);
//                index++;
View Full Code Here

Examples of org.apache.wicket.cluster.MessageSender

      pageStore.storeSerializedPages(sessionId, pages);
    }
  }

  private MessageSender getMessageSender() {
    MessageSender messageSender = PageStoreComponent.getMessageSender();
    if (messageSender != null) {
      return messageSender;
    } else {
      log.warn("Message sender is not available! Was "
          + "the server started up in clustered mode?");
      return new MessageSender() {

        public void sendMessage(Serializable message) {
        }

        public void sendMessage(Serializable message, Member member) {
View Full Code Here

Examples of org.intalio.tempo.workflow.fds.core.MessageSender

        // replies as well
        WorkflowProcessesMessageConvertor wf2up = new WorkflowProcessesMessageConvertor();
        UserProcessMessageConvertor up2wf = new UserProcessMessageConvertor();

        SAXReader reader = new SAXReader();
        MessageSender messageSender = getMessageSender();
        FormDispatcherConfiguration config = FormDispatcherConfiguration.getInstance();

        // the XML document to return as the HTTP response payload
        Document responseDocument = null;
        try {
            if (fdsUri.equals(_IB4P_URI)) {
                // it is a request from the Workflow Processes
                _log.info("Workflow Processes -> User Process");

                _log.debug("Parsing the request from the Workflow Processes.");
                Document workflowProcessesRequest = reader.read(request.getInputStream());
                if (_log.isDebugEnabled()) {
                    _log.debug("Workflow process request:\n" + workflowProcessesRequest.asXML() + "\n");
                    _log.debug("Converting the request to the user process format.");
                }

                // null means that the convertor will figure out the user
                // process namespace itself
                wf2up.convertMessage(workflowProcessesRequest, null);
                if (_log.isDebugEnabled()) {
                    _log.debug("Workflow process request (after conversion):\n" + workflowProcessesRequest.asXML() + "\n");
                }

                if (wf2up.getSoapAction() != null) {
                    soapAction = wf2up.getSoapAction();
                    _log.debug("Completion SOAP Action: '" + soapAction + "'");
                }

                // SOAP Action should always be quoted (WS-Interop)
                if (soapAction == null || soapAction.length() == 0) {
                    soapAction = "\"\"";
                } else if (soapAction.charAt(0) != '\"') {
                    soapAction = "\"" + soapAction + "\"";
                }

                String userProcessEndpoint = wf2up.getUserProcessEndpoint();
                _log.debug("Sending the request to the user process and getting the response");
                Document userProcessResponse = messageSender.requestAndGetReply(workflowProcessesRequest, userProcessEndpoint, soapAction);
                if (_log.isDebugEnabled()) {
                    _log.debug("User process response:\n" + userProcessResponse.asXML() + "\n");
                    _log.debug("Converting the response to the Workflow Processes format.");
                }
                up2wf.convertMessage(userProcessResponse);
                if (_log.isDebugEnabled()) {
                    _log.debug("Sending the converted response back to the Workflow Processes.");
                    _log.debug("User process response (after conversion)\n" + userProcessResponse.asXML() + "\n");
                }
                responseDocument = userProcessResponse;
            } else {
                // it is a request from a user process
                _log.debug("User Process -> Workflow Processes");

                // get the full URL of the workflow process endpoint
                String workflowProcessesEndpoint = config.getPxeBaseUrl() + config.getWorkflowProcessesRelativeUrl();

                _log.debug("Parsing the request from the user process.");
                Document userProcessRequest = reader.read(request.getInputStream());
                if (_log.isDebugEnabled()) {
                    _log.debug("User process request:\n" + userProcessRequest.asXML() + "\n");
                }

                Document pureRequest = SoapTools.unwrapMessage(userProcessRequest);
                Element rootElement = pureRequest.getRootElement();
                String rootElementName = rootElement.getName();

                IDispatcher dispatcher = null;
                try {
                    dispatcher = Dispatchers.createDispatcher(rootElementName);
                } catch (NoDispatcherException e) {
                    _log.debug("No custom dispatcher, using the default processing");
                }

                if (dispatcher != null) {
                    // TODO: convert the default processing to an IDispatcher
                    try {
                        Document processedRequest = dispatcher.dispatchRequest(pureRequest);
                        Document wrappedRequest = SoapTools.wrapMessage(processedRequest);
                        String endpoint = dispatcher.getTargetEndpoint();
                        String dispatcherSoapAction = dispatcher.getTargetSoapAction();
                        Document rawResponse = messageSender.requestAndGetReply(wrappedRequest, endpoint, dispatcherSoapAction);

                        Document unwrappedResponse = SoapTools.unwrapMessage(rawResponse);
                        Document processedResponse = dispatcher.dispatchResponse(unwrappedResponse);
                        responseDocument = SoapTools.wrapMessage(processedResponse);
                    } catch (InvalidInputFormatException e) {
                        _log.error("Error converting user process request", e);
                        // TODO: return a SOAP fault
                        throw new RuntimeException(e);
                    }
                } else {
                    _log.debug("Converting the request to the Workflow Processes format.");
                    up2wf.convertMessage(userProcessRequest);
                    if (_log.isDebugEnabled()) {
                        _log.debug("\n" + userProcessRequest.asXML() + "\n");
                    }
                    String userProcessNamespaceUri = up2wf.getUserProcessNamespaceUri();
                    _log.debug("Sending the converted request to the Workflow Processes and getting the response.");

                    if (up2wf.getSoapAction() != null){
                        soapAction = up2wf.getSoapAction();
                    }
                    _log.debug("SOAP Action:" + soapAction);

                    Document workflowProcessesResponse = messageSender.requestAndGetReply(userProcessRequest, workflowProcessesEndpoint, soapAction);
                    if (_log.isDebugEnabled()) {
                        _log.debug("\n" + workflowProcessesResponse.asXML() + "\n");
                    }
                    _log.debug("Converting the response to the user process format.");
                    wf2up.convertMessage(workflowProcessesResponse, userProcessNamespaceUri);
View Full Code Here

Examples of org.intalio.tempo.workflow.fds.core.MessageSender

            _log.warn("Invalid message format: " + e.getMessage(), e);
        }
    }

    protected MessageSender getMessageSender() {
        MessageSender messageSender = new MessageSender();
        return messageSender;
    }
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.