You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Peter Klotz <pe...@blue-elephant-systems.com> on 2006/08/24 16:08:26 UTC

Setting endpoint in exchange using DefaultServiceMixClient

Hi,

short questions, with a DefaultServiceMixClient one can send a ME to a service
using a QName, like so

client = clientFactory.createClient();
resolver = client.createResolverForService(new QName(NS_URL, service, NS_PREFIX));
client.sendSync(exchange, timeout);
client.done(exchange);

But when I have one service with two endpoints, produced by having two SUs with
the same service but different endpoints specified, how can one specify the
endpoint name programatically?

The resolver has a resolveAvailableEndpoints() method that would give all
endpoints, but I want a specific one. How does the resolve method using
EndpointFilter work?
Does anybody have a code sample?


Thanks, Peter

Re: Setting endpoint in exchange using DefaultServiceMixClient

Posted by Guillaume Nodet <gn...@gmail.com>.
Something like the following should work
   ServiceEndpoint se = client.getContext().getEndpoint(service, endpoint);
   exchange.setEndpoint(se);
   client.sendSync(exchange, timeout);

On 8/24/06, Peter Klotz <pe...@blue-elephant-systems.com> wrote:
>
> Hi,
>
> short questions, with a DefaultServiceMixClient one can send a ME to a
> service
> using a QName, like so
>
> client = clientFactory.createClient();
> resolver = client.createResolverForService(new QName(NS_URL, service,
> NS_PREFIX));
> client.sendSync(exchange, timeout);
> client.done(exchange);
>
> But when I have one service with two endpoints, produced by having two SUs
> with
> the same service but different endpoints specified, how can one specify
> the
> endpoint name programatically?
>
> The resolver has a resolveAvailableEndpoints() method that would give all
> endpoints, but I want a specific one. How does the resolve method using
> EndpointFilter work?
> Does anybody have a code sample?
>
>
> Thanks, Peter
>
>


-- 
Cheers,
Guillaume Nodet