Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.MessageReceiver


                // client. Should / would be ignored by any transport other than
                // nhttp. For example, JMS would not send a reply message for one-way
                // operations.
                MessageContext outMsgCtx =
                    (MessageContext) context.getAttribute(OUTGOING_MESSAGE_CONTEXT);
                MessageReceiver mr = outMsgCtx.getAxisOperation().getMessageReceiver();

                try {
                    MessageContext responseMsgCtx = outMsgCtx.getOperationContext().
                        getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN);
                    if (responseMsgCtx == null) {
                        // to support Sandesha.. however, this means that we received a 202 accepted
                        // for an out-only , for which we do not need a dummy message anyway
                        return;
                    }
                    responseMsgCtx.setServerSide(true);
                    responseMsgCtx.setDoingREST(outMsgCtx.isDoingREST());
                    responseMsgCtx.setProperty(MessageContext.TRANSPORT_IN,
                        outMsgCtx.getProperty(MessageContext.TRANSPORT_IN));
                    responseMsgCtx.setTransportIn(outMsgCtx.getTransportIn());
                    responseMsgCtx.setTransportOut(outMsgCtx.getTransportOut());

                    responseMsgCtx.setAxisMessage(outMsgCtx.getAxisOperation().
                        getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
                    responseMsgCtx.setOperationContext(outMsgCtx.getOperationContext());
                    responseMsgCtx.setConfigurationContext(outMsgCtx.getConfigurationContext());
                    responseMsgCtx.setTo(null);

                    responseMsgCtx.setEnvelope(
                        ((SOAPFactory)outMsgCtx.getEnvelope().getOMFactory()).getDefaultEnvelope());
                    responseMsgCtx.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
                    responseMsgCtx.setProperty(NhttpConstants.SC_ACCEPTED, Boolean.TRUE);
                    mr.receive(responseMsgCtx);

                } catch (org.apache.axis2.AxisFault af) {
                    log.error("Unable to report back 202 Accepted state to the message receiver", af);
                }
View Full Code Here


                if (request.getAttachment() != null &&
                    request.getAttachment() instanceof Axis2HttpRequest) {

                    Axis2HttpRequest axis2Request = (Axis2HttpRequest) request.getAttachment();
                    MessageContext mc = axis2Request.getMsgContext();
                    MessageReceiver mr = mc.getAxisOperation().getMessageReceiver();

                    try {
                        // this fault is NOT caused by the endpoint while processing. so we have to
                        // inform that this is a sending error (e.g. endpoint failure) and handle it
                        // differently at the message receiver.
                      AxisFault axisFault;
                      if (isTimeout) {
                        // In case of a timeout there is no exception
                        axisFault = new AxisFault("The connection timed out");
                      } else {
                        Exception exception = request.getException();
                        axisFault = new AxisFault(exception.toString(), exception);
                      }
                     
                      if (mr == null) {
                        // FIXME: the message receiver is null if the MEP is out-only
                        log.error(axisFault.getMessage());
                      } else {
                        MessageContext nioFaultMessageContext =
                          MessageContextBuilder.createFaultMessageContext(mc, axisFault);
                          nioFaultMessageContext.setProperty(NhttpConstants.SENDING_FAULT, Boolean.TRUE);
                          mr.receive(nioFaultMessageContext);
                      }
                    } catch (AxisFault af) {
                        log.error("Unable to report back failure to the message receiver", af);
                    }
                }
View Full Code Here

    }
  }

  private MessageReceiver loadDefaultMessageReceiver(String mepURL,
      AxisService service) {
    MessageReceiver messageReceiver;
    if (mepURL == null) {
      mepURL = WSDL2Constants.MEP_URI_IN_OUT;
    }
    if (service != null) {
      messageReceiver = service.getMessageReceiver(mepURL);
View Full Code Here

    try {
      HashMap messageReciverMap = new HashMap();
      Class inOnlyMessageReceiver = Loader
          .loadClass("org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
      MessageReceiver messageReceiver = (MessageReceiver) inOnlyMessageReceiver
          .newInstance();
      messageReciverMap.put(WSDL2Constants.MEP_URI_IN_ONLY,
          messageReceiver);
      Class inoutMessageReceiver = Loader
          .loadClass("org.apache.axis2.rpc.receivers.RPCMessageReceiver");
      MessageReceiver inOutmessageReceiver = (MessageReceiver) inoutMessageReceiver
          .newInstance();
      messageReciverMap.put(WSDL2Constants.MEP_URI_IN_OUT,
          inOutmessageReceiver);
      messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,
          inOutmessageReceiver);
View Full Code Here

    for (int i = 0; i < method.length; i++) {
      JMethod jmethod = method[i];
      AxisOperation operation = axisService.getOperation(new QName(
          jmethod.getSimpleName()));
      String mep = operation.getMessageExchangePattern();
      MessageReceiver mr;
      if (messageReceiverClassMap != null) {

        if (messageReceiverClassMap.get(mep) != null) {
          Object obj = messageReceiverClassMap.get(mep);
          if (obj instanceof MessageReceiver) {
View Full Code Here

    }

    HashMap messageReciverMap = new HashMap();
    Class inOnlyMessageReceiver = Loader
        .loadClass("org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
    MessageReceiver messageReceiver = (MessageReceiver) inOnlyMessageReceiver
        .newInstance();
    messageReciverMap.put(WSDL2Constants.MEP_URI_IN_ONLY, messageReceiver);
    Class inoutMessageReceiver = Loader
        .loadClass("org.apache.axis2.rpc.receivers.RPCMessageReceiver");
    MessageReceiver inOutmessageReceiver = (MessageReceiver) inoutMessageReceiver
        .newInstance();
    messageReciverMap.put(WSDL2Constants.MEP_URI_IN_OUT,
        inOutmessageReceiver);
    AxisService service = new AxisService();
    schemaGenerator.setAxisService(service);
View Full Code Here

            // loading the message receivers
            OMElement receiverElement =
                    operation.getFirstChildWithName(new QName(TAG_MESSAGE_RECEIVER));

            if (receiverElement != null) {
                MessageReceiver messageReceiver =
                        loadMessageReceiver(module.getModuleClassLoader(), receiverElement);
                op_descrip.setMessageReceiver(messageReceiver);
            } else {
                // setting default message receiver
                MessageReceiver msgReceiver = loadDefaultMessageReceiver(mepURL, null);
                op_descrip.setMessageReceiver(msgReceiver);
            }
            // Process Module Refs
            Iterator modules = operation.getChildrenWithName(new QName(TAG_MODULE));
            processOperationModuleRefs(modules, op_descrip);
View Full Code Here

                    AxisOperation axisOperation = (AxisOperation) operations.next();
                    if (axisOperation.getMessageReceiver() == null) {
                        try {
                            Class jaxwsMR = Loader.loadClass(
                                    "org.apache.axis2.jaxws.server.JAXWSMessageReceiver");
                            MessageReceiver jaxwsMRInstance =
                                    (MessageReceiver) jaxwsMR.newInstance();
                            axisOperation.setMessageReceiver(jaxwsMRInstance);
                        } catch (Exception e) {
                            log.debug("Error occurde while loading JAXWSMessageReceiver for "
                                    + className );
View Full Code Here

                   IllegalAccessException,
                   AxisFault {
        HashMap messageReciverMap = new HashMap();
        Class inOnlyMessageReceiver = Loader.loadClass(
                "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
        MessageReceiver messageReceiver =
                (MessageReceiver) inOnlyMessageReceiver.newInstance();
        messageReciverMap.put(WSDL2Constants.MEP_URI_IN_ONLY,
                              messageReceiver);
        Class inoutMessageReceiver = Loader.loadClass(
                "org.apache.axis2.rpc.receivers.RPCMessageReceiver");
        MessageReceiver inOutmessageReceiver =
                (MessageReceiver) inoutMessageReceiver.newInstance();
        messageReciverMap.put(WSDL2Constants.MEP_URI_IN_OUT,
                              inOutmessageReceiver);
        messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,
                              inOutmessageReceiver);
View Full Code Here

                    if (WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_ONLY.equals(MEP)
                        || WSDLConstants.WSDL20_2004_Constants.MEP_URI_IN_ONLY.equals(MEP)
                        || WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)) {
                        Class inOnlyMessageReceiver = Loader.loadClass(
                                "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
                        MessageReceiver messageReceiver =
                                (MessageReceiver) inOnlyMessageReceiver.newInstance();
                        operation.setMessageReceiver(messageReceiver);
                    } else {
                        Class inoutMessageReceiver = Loader.loadClass(
                                "org.apache.axis2.rpc.receivers.RPCMessageReceiver");
                        MessageReceiver inOutmessageReceiver =
                                (MessageReceiver) inoutMessageReceiver.newInstance();
                        operation.setMessageReceiver(inOutmessageReceiver);
                    }
                } catch (ClassNotFoundException e) {
                    log.error(e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.MessageReceiver

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.