Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.MessageReceiver


public class TargetResolverServiceTest extends LocalTestCase {

    protected void setUp() throws Exception {
      super.setUp();
      serverConfig.addMessageReceiver(WSDL2Constants.MEP_URI_IN_OUT, new MessageReceiver(){
      public void receive(MessageContext msgContext) throws AxisFault {
        // Set the reply to on the server side to test server side
        // target resolvers
        msgContext.setTo(new EndpointReference(
              "http://ws.apache.org/new/anonymous/address"));
View Full Code Here


                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY);
                } else {
                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT);
                }

                MessageReceiver msgrec = null;
                if (wsBinding.getBindingInterfaceContract().getCallbackInterface() != null) {
                    msgrec = new Axis2ServiceInOutAsyncMessageReceiver(this, op);
                } else if (op.isNonBlocking()) {
                    msgrec = new Axis2ServiceInMessageReceiver(this, op);
                } else {
View Full Code Here

  private void setDefaultMessageReceivers() {
    Iterator operations = service.getPublishedOperations().iterator();
    while (operations.hasNext()) {
      AxisOperation operation = (AxisOperation) operations.next();
      if (operation.getMessageReceiver() == null) {
        MessageReceiver messageReceiver = loadDefaultMessageReceiver(
            operation.getMessageExchangePattern(), service);
        if (messageReceiver == null &&
        // we assume that if the MEP is ROBUST_IN_ONLY then the in-out
            // MR can handle that
            WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation
View Full Code Here

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

      if (receiverElement != null) {
        MessageReceiver messageReceiver = loadMessageReceiver(service
            .getClassLoader(), receiverElement);

        op_descrip.setMessageReceiver(messageReceiver);
      } else {
        // setting default message receiver
        MessageReceiver msgReceiver = loadDefaultMessageReceiver(
            op_descrip.getMessageExchangePattern(), service);
        op_descrip.setMessageReceiver(msgReceiver);
      }

      // Process Module Refs
View Full Code Here

        }
        return null;
    }

    protected 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

            // element name
            if (operation == null) {
                operation = axisService.getOperation(new QName(
                        jmethod.getName()));
            }
            MessageReceiver mr =
                    axisService.getMessageReceiver(operation.getMessageExchangePattern());
            if (mr == null) {
                mr = axisConfig.getMessageReceiver(operation.getMessageExchangePattern());
            }
            if (operation.getMessageReceiver() == null) {
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));
View Full Code Here

                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY);
                } else {
                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT);
                }

                MessageReceiver msgrec = null;
                if (op.isNonBlocking()) {
                    msgrec = new Axis2ServiceInMessageReceiver(this, op, policyHandlerList);
                } else {
                    msgrec = new Axis2ServiceInOutSyncMessageReceiver(this, op, policyHandlerList);
                }
View Full Code Here

  @Test
    public void testSimplePassing() throws Exception {
        server.deployService("TestSoapHeader", "dummy-service.wsdl",
                new QName("http://axis2.ode.apache.org", "DummyService"), "DummyServiceSOAP11port_http",
                new MessageReceiver() {
            public void receive(MessageContext messageCtx) throws AxisFault {
                System.out.println(messageCtx.getEnvelope());
                OMElement cidElmt = messageCtx.getEnvelope().getHeader().getFirstElement();
                // Also checking if the session is included in passing
                assertTrue(messageCtx.getEnvelope().toString().indexOf("session") > 0);
View Full Code Here

                // 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

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.