Here, service means object which implements some business logic. It must satisfy to some requirements:
- It must implement a business interface; access will be made through this interface.
- Business interface methods must accept arguments and return pretty serializable values. This does not necesserily require your value classes to implement java.io.Serializable (although it would be great), but be serializable by the current Serializer.
To use your service via HTTP(s), you have to do the following:
- Add needed libraries to classpath
- Create business interface and its implementation
- Expose your service interface on the server via HTTP(s)
- Use XRemotingProxyFactory to get proxy for your remote service (on the client)
Read the following to learn about requirements and dependencies.
YourService.java:
public interface YourService {
String sayHello(String username);
}
YourServiceImpl.java:
public class YourServiceImpl implements YourService {
public String sayHello(String username) {
return "Hello " + username + "!";
}
}