public class WebServiceUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static WebServiceUtil |
getInstance()
Returns the one
WebServiceUtil instance |
void |
postCommand(java.lang.String serviceURL,
java.lang.String commandName,
java.util.List<org.apache.http.NameValuePair> params,
AsyncCallbackPair<java.lang.String> callback)
Make a post command to serviceURL with params and return the
response String.
|
void |
postCommandReturningArray(java.lang.String serviceURL,
java.lang.String commandName,
java.util.List<org.apache.http.NameValuePair> params,
AsyncCallbackPair<org.json.JSONArray> callback)
Make a post command to serviceURL with params and return the
response String as a JSON array.
|
void |
postCommandReturningObject(java.lang.String serviceURL,
java.lang.String commandName,
java.util.List<org.apache.http.NameValuePair> params,
AsyncCallbackPair<org.json.JSONObject> callback)
Make a post command to serviceURL with paramaterss and
return the response String as a JSON object.
|
public static WebServiceUtil getInstance()
WebServiceUtil instanceWebServiceUtil instancepublic void postCommandReturningArray(java.lang.String serviceURL,
java.lang.String commandName,
java.util.List<org.apache.http.NameValuePair> params,
AsyncCallbackPair<org.json.JSONArray> callback)
serviceURL - The URL of the server to post to.commandName - The path to the command.params - A List of NameValuePairs to send as parameters
with the post.callback - A callback function that accepts a JSON array
on success.public void postCommandReturningObject(java.lang.String serviceURL,
java.lang.String commandName,
java.util.List<org.apache.http.NameValuePair> params,
AsyncCallbackPair<org.json.JSONObject> callback)
serviceURL - The URL of the server to post to.commandName - The path to the command.params - A List of NameValuePairs to send as parameters
with the post.callback - A callback function that accepts a JSON object
on success.public void postCommand(java.lang.String serviceURL,
java.lang.String commandName,
java.util.List<org.apache.http.NameValuePair> params,
AsyncCallbackPair<java.lang.String> callback)
serviceURL - The URL of the server to post to.commandName - The path to the command.params - A List of NameValuePairs to send as parameters
with the post.callback - A callback function that accepts a String on
success.