Search in sources :

Example 61 with Message

use of org.apache.axis2.transport.msmq.util.Message in project wso2-axis2-transports by wso2.

the class AxisAsyncEndpoint method receive.

void receive(MessageContext messageCtx) throws AxisFault {
    log.debug("MessageReceiver has been invoked");
    final AxisMessage messageData;
    try {
        Assert.assertTrue(messageCtx.isServerSide());
        TransportInDescription transportIn = messageCtx.getTransportIn();
        Assert.assertNotNull("transportIn not set on message context", transportIn);
        Assert.assertEquals(context.getTransportName(), transportIn.getName());
        Assert.assertEquals(context.getTransportName(), messageCtx.getIncomingTransportName());
        for (MessageContextValidator validator : validators) {
            validator.validate(messageCtx, false);
        }
        messageData = new AxisMessage(messageCtx);
    } catch (Throwable ex) {
        support.putException(ex);
        return;
    }
    support.putMessage(null, messageData);
}
Also used : TransportInDescription(org.apache.axis2.description.TransportInDescription) AxisMessage(org.apache.axis2.transport.testkit.message.AxisMessage) MessageContextValidator(org.apache.axis2.transport.testkit.axis2.MessageContextValidator)

Example 62 with Message

use of org.apache.axis2.transport.msmq.util.Message in project wso2-axis2-transports by wso2.

the class MessageTestCase method runTest.

@Override
protected void runTest() throws Throwable {
    for (MessageExchangeValidator validator : validators) {
        validator.beforeSend();
    }
    doRunTest();
    for (MessageExchangeValidator validator : validators) {
        log.debug("Invoking message exchange validator " + validator.getClass().getName());
        validator.afterReceive();
    }
}
Also used : MessageExchangeValidator(org.apache.axis2.transport.testkit.MessageExchangeValidator)

Aggregations

AxisFault (org.apache.axis2.AxisFault)25 MessageContext (org.apache.axis2.context.MessageContext)20 IOException (java.io.IOException)9 OMOutputFormat (org.apache.axiom.om.OMOutputFormat)8 MessageFormatter (org.apache.axis2.transport.MessageFormatter)8 ContentType (javax.mail.internet.ContentType)7 OMElement (org.apache.axiom.om.OMElement)7 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)6 IncomingMessage (org.apache.axis2.transport.testkit.message.IncomingMessage)6 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 UnsupportedCharsetException (java.nio.charset.UnsupportedCharsetException)5 AxisOperation (org.apache.axis2.description.AxisOperation)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 OutputStream (java.io.OutputStream)4 XMLStreamException (javax.xml.stream.XMLStreamException)4 XMPPConnection (org.jivesoftware.smack.XMPPConnection)4 XMPPException (org.jivesoftware.smack.XMPPException)4 Message (org.jivesoftware.smack.packet.Message)4 AMQP (com.rabbitmq.client.AMQP)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3