Hi Miguel, (copying [email protected])
Yes, you can return certain objects, have a look at the Greeter Demo on the CXF-DOSGi wiki: http://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html It has the following Service Interface: public interface GreeterService { Map<GreetingPhrase, String> greetMe(String name); GreetingPhrase [] greetMe(GreeterData name) throws GreeterException; } In this case it returns (a Map/array of) GreetingPhrase which is a custom object. As mentioned in this thread: http://www.nabble.com/-DOSGi--Using-a-Data-Object-as-an-argument-of-a-Remote-Service-td25437925.html It's not possible to return any old object. You have to make sure that the Class/Interface you're returning is designed properly for Remote Computing. In practise this means that you should only use getters and/or setters on the object that is sent across the wire. Hope this helps, David 2009/9/17 Miguel <[email protected]> > Hello, > I have just read your article about *Distributed OSGi – A Simple > Example<http://coderthoughts.blogspot.com/2009/02/distributed-osgi-simple-example.html> > * and I have a question if you have time. > > All the request you do from the client are to methods which return int or > collection. Can I create a method to return the whole object? I have tried > it but it didn't work. The idea is to return the object AuctionItem like > this: > > > public interface AuctionService { > [...] > > AuctionItem getItem (); > } > > > is it posible? > Thank you very much, > > Miguel >
