public class ServiceCaller extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
ServiceCaller.ServiceException |
| Constructor and Description |
|---|
ServiceCaller(URL wmServer) |
| Modifier and Type | Method and Description |
|---|---|
<M extends Service.Message> |
callService(String serviceName,
Class<M> messageClass,
HashMap<String,String> params)
Calls the given service with the given parameters, and retrieves the response, parsed into a convenient Java object.
|
public ServiceCaller(URL wmServer)
wmServer - the URL of the wikipedia miner server to call.public <M extends Service.Message> M callService(String serviceName, Class<M> messageClass, HashMap<String,String> params) throws IOException, ServiceCaller.ServiceException
M - The type of message expected from the given serviceserviceName - The name of the service to callmessageClass - The expected class of message this service returnsparams - Your query parameters. Note that 'responseFormat' will be ignored.IOException - If there was a problem communicating with the Wikipedia Miner serverServiceCaller.ServiceException - If there was a problem processing your request (missing parameters, invalid ids, etc)Copyright © 2012 David Milne. All Rights Reserved.