You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by andyamsterdam2003 <an...@gmail.com> on 2008/06/09 17:04:41 UTC

How do I pass a JBIContainer to DefaultServiceMixClient?

Hi,

I have deployed a SU which I have confirmed is running in the ServiceMix
container and now want to make a simple call to it.  I have the following
code so far - it is missing the part where I should be passing a JBI
container to the DefaultServiceMixClient - how do I get a reference to the
running ServiceMix container?

public class PojoSender {
    private DefaultServiceMixClient client;
    
    public void sendMessage() throws MessagingException, Exception{
    
        client = new DefaultServiceMixClient(???JBIContainerRef?????????);
    	client.start();
    	
        InOnly exchange = client.createInOnlyExchange();

        NormalizedMessage message = exchange.getInMessage();
        message.setProperty("name", "Andrew");
        message.setContent(new StreamSource(new
StringReader("<hello>world</hello>")));

        // lets use a specific service to dispatch to
        QName service = new QName("urn:test","service");
        exchange.setService(service);
        client.send(exchange);
    }

I would appreciate any advice on this as it's now become urgent.

Thank you,

Andrew.
-- 
View this message in context: http://www.nabble.com/How-do-I-pass-a-JBIContainer-to-DefaultServiceMixClient--tp17734791p17734791.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.