Hi guys,
Apologies if this issue has already been addressed, I did a quick
check in JIRA and on the mailing lists and could not find it. It's a
rather fundamental issue so it's possible that I misunderstand
something in the way composite services should be obtained.
Basically I have a composite file that contains a component and that
also exposes a service (which promotes the component's implicit
service). My standalone Java client can obtain the component's
implicit service using SCADomain.getService(SERVICE_CLASS,
"COMPONENT_NAME") but cannot obtain the same service by just using
the composite's service name.
Here's the composite:
<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://www.inria.fr"
xmlns:reservation="http://www.inria.fr" name="WeatherComposite">
<service name="InnerWeatherService" promote="InnerWeatherComponent">
<interface.java interface="services.WeatherService" />
</service>
<component name="InnerWeatherComponent">
<implementation.java class="implementations.WeatherImplementation"
/>
</component>
</composite>
And the client code:
SCADomain domain = SCADomain.newInstance("weather.composite");
WeatherService service = domain.getService(WeatherService.class,
"InnerWeatherComponent");
WeatherService service2 = domain.getService(WeatherService.class,
"InnerWeatherService");
System.out.println("The weather is: " + service.getForecast());
System.out.println("Again, the weather is: " + service2.getForecast());
The last line generates an org.osoa.sca.ServiceUnavailableException
exception with the message No service invoker is available for
reference default (bindingURI=InnerWeatherService operation=getForecast)
Please let me know if this is the expected behaviour and if so why
(i.e. is this a bug or a feature? :) ).
Thanks,
Adrian.