Package org.mule.api.client

Examples of org.mule.api.client.MuleClient.send()


    {
        MuleClient client = muleContext.getClient();

        //TODO MULE-4951 Dispatch no longer works (fails with class cast exception, probably need to configure AXIS.OneWay)
        //switching to send() does work
        client.send(getDispatchAsyncComplexEndpoint1(), new Person("Betty", "Rubble"), null);

        // lets get our newly added person
        MuleMessage result = client.request(getDispatchAsyncComplexEndpoint2(), RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertTrue("Did not receive a Person but: " + result.getPayload().getClass(),
View Full Code Here


    {
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(HttpConnector.HTTP_METHOD_PROPERTY, "GET");

        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send(getWsdlEndpoint(), null, props);
        assertNotNull(result);
        if (logger.isDebugEnabled())
        {
            logger.debug(result.getPayloadAsString());
        }
View Full Code Here

    @Test
    public void testHttpsConnection() throws Exception
    {
        MuleClient client = muleContext.getClient();
        InboundEndpoint inboundEndpoint = (InboundEndpoint) muleContext.getRegistry().lookupObject("inTestUMO");
        MuleMessage m = client.send(
            inboundEndpoint.getAddress() + "?method=echo", new DefaultMuleMessage("hello", muleContext));
        assertNotNull(m);

        // check that our https connector is being used
        assertNotNull(endpoint);
View Full Code Here

    @Test
    public void testSendSync() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage reply = client.send("vm://in", testMessage, null);
        assertNotNull(reply);

        assertEquals(NullPayload.getInstance(), reply.getPayload());

        Packet packet = jabberClient.receive(RECEIVE_TIMEOUT);
View Full Code Here

    {
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(HttpConnector.HTTP_METHOD_PROPERTY, "GET");

        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send("http://ross:ross@localhost:" + HTTP_PORT
                                        + "/services/mycomponent?method=echo", "test", props);

        String status = result.getProperty(HttpConnector.HTTP_STATUS_PROPERTY, PropertyScope.INBOUND);
        assertEquals(401, new Integer(status).intValue());
View Full Code Here

    public void testEncryptDecrypt() throws Exception
    {
        String payload = "this is a super simple test. Hope it works!!!";
        MuleClient client = muleContext.getClient();

        client.send("vm://in", new DefaultMuleMessage(payload, muleContext));
        MuleMessage message = client.request("vm://out", 5000);
        assertEquals(payload, message.getPayloadAsString());
    }
}
View Full Code Here

    @Test
    public void testWsCall() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send("vm://testin", new DefaultMuleMessage(testString, muleContext));
        assertNotNull(result.getPayload());
        assertEquals("Payload", testString, result.getPayloadAsString());
    }

    @Test
View Full Code Here

    {
        MuleClient client = muleContext.getClient();
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("ws.service.url", "http://localhost:" + dynamicPort.getNumber()
                                            + "/services/TestUMO?method=onReceive");
        MuleMessage result = client.send("vm://testin2", testString, props);
        assertNotNull(result.getPayload());
        assertEquals("Payload", testString, result.getPayloadAsString());
    }
}
View Full Code Here

                         + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" + "<soap:Body>"
                         + "<ns1:echo xmlns:ns1=\"http://testmodels.cxf.module.mule.org/\">"
                         + "<text>Test String</text>" + "</ns1:echo>" + "</soap:Body>" + "</soap:Envelope>";

        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send("http://localhost:" + HTTP_PORT + getContextPath()
                                         + "/services/mycomponent", request, null);
        String res = result.getPayloadAsString();

        assertTrue(res.indexOf("Test String") != -1);
    }
View Full Code Here

    public void testHttpGet() throws Exception
    {
        MuleClient client = muleContext.getClient();
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(HttpConnector.HTTP_METHOD_PROPERTY, "GET");
        MuleMessage result = client.send("http://localhost:" + HTTP_PORT + getContextPath()
                                         + "/services/mycomponent/echo/text/Test String", "", props);
        String res = result.getPayloadAsString();
        assertTrue(res.indexOf("Test String") != -1);
    }
}
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.