Exporting Service via binding.ws and binding.rmi (SCA Tuscany 2.0 M4)Hi, First, you need to give two different names in the config.xml for binding.ws and binding.rmi.
When you register the OSGi service, you need to set the org.osgi.sca.bindings to an String[] or Collection<String> that contains "{http://sample}AddressBook1" and "{http://sample}AddressBook2". If that happens, when the OSGi service is exported, Tuscany resolves these two bindings to the ones in the config.xml. At this point, you probably need to restart the bundle to change the configuration. Thanks, Raymond From: Alexander Blotny Sent: Friday, February 05, 2010 7:40 AM To: user@tuscany.apache.org Subject: Exporting Service via binding.ws and binding.rmi (SCA Tuscany 2.0 M4) Hi, I am trying to export a service via rmi and ws. My config.xml looks that way: <scact:sca-config targetNamespace="http://sample" xmlns:scact="http://www.osgi.org/xmlns/scact/v1.0.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"> <tuscany:binding.rmi name="AddressBook" uri="rmi://localhost:8085/AddressBookService"/> <sca:binding.ws name="AddressBook" uri="http://localhost:8086/AddressBookService"/> </scact:sca-config> And the component.xml: <scr:component name="AddressBookComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> <implementation class="de.fhg.fokus.ngni.odysseus.service.addressbook.AddressBook" /> <service> <provide interface="de.fhg.fokus.ngni.odysseus.service.addressbook.impl.AddressBookImpl" /> </service> </scr:component> According to the samples I have set the path to these files in the Bundle-Manifest. When I am starting the bundle the service is only exported as rmi. By switching the declarations the service is exported as a web service. It seems that the second binding is ignored. There is no error message. Do I have to configure it another way? Additionally I have another question. I am wondering if it is possible to change the export of a service on runtime (after the bundle was started). Is it necessary to stop the bundle and change the xml file? If not how can it dynamically be done? Thanks, Alex