This is really easy and assumes that you've already set up your Eclipse workspace as described here.

Creating a Distributed OSGi Service

1. Create a new Plugin Project for a 'standard' OSGi Framework.

2. Create an OSGi service and and register it with the OSGi Service Registry. I'm creating a service that implements my test.distributed.service.TemperatureService.

package test.distributed.service;
import java.util.Date;

public interface TemperatureService {
    int getTemperature(Date date, String city, boolean celcius);

The service is registered with the OSGi Service Registry in the Activator.

package test.distributed.service;
import java.util.*;
import org.osgi.framework.*;

public class Activator implements BundleActivator {
    private ServiceRegistration registration;

    public void start(BundleContext bc) throws Exception {
    Dictionary props = new Hashtable();
    props.put("osgi.remote.interfaces", "*");

    registration = bc.registerService(TemperatureService.class.getName(), 
                                      new TemperatureServiceImpl(), props);	}

    public void stop(BundleContext context) throws Exception {

The only thing you need to do to expose a service remotely is setting the osgi.remote.interfaces property to the (comma separated) list of interfaces of the service that need to be exposed. Specifying * simply takes all the interfaces that were passed in to the registerService() call.
By default the service will be made available on http://{machine}:9000/fully/qualified/ClassName (so in this case http://localhost:9000/test/distributed/service/TemperatureService). You can change this by adding the osgi.remote.configuration.type and osgi.remote.configuration.pojo.address properties on the service, e.g.:

props.put("osgi.remote.interfaces", "*");
props.put("", "http://localhost:8888/temp");

The Consumer Side

Developing the consumer side bundles requires no different setup than the server side bundles.

If you are using a OSGI-INF/remote-service/remote-services.xml file to statically configure the client side with the remote service, you will need to include this in your file to ensure that Eclipse puts it in your bundle. If you are using Discovery, this change to the is not needed.

See the samples/greeter demo for a full example.