Freeman, thank you.
This really have helped me.
Freeman Fang wrote:
Hi,
I guess you mean you don't know how to get client instance here, right?
If so, this code piece should be helpful
ServiceMixClient client = new ServiceMixClientFacade(context); //
context is instance of ComponentContext, you can get it from your
endpoint
Freeman
aigor wrote:
Hello.
I have a problem.
I have one SE for the ServiceMix 3.2.2 and I wont to call another
service from the same SM.
I found next code:
/InOnly exchange = client.createInOnlyExchange();
NormalizedMessage message = exchange.getInMessage();
message.setProperty("name", "James");
message.setContent(new StreamSource(new
StringReader("<hello>world</hello>")));
// lets use a specific service to dispatch to
QName service = new QName("http://servicemix.org/cheese/", "receiver");
exchange.setService(service);
client.send(exchange);/
But I have no idea how to incorporate it into my endpoint class:
/protected void processInOnly(MessageExchange exchange,
NormalizedMessage in) throws Exception { // do smth
System.out.println("[Calling other service]");
// CALL OTHER SERVICE!
}
/Thanks for any idea.
Ihor. aigor(dog)iforma(dot)com(dot)ua