I’m working on an Android app that connects to .NET webservices. I use the Apache HttpClient to connect using the HttpGet method. The method that makes the actual call has the following code:
public static String httpGet(String methodName, List<NameValuePair> params) {
String methodURL = BASE_URL + "/"+methodName;
HttpGet httpGet = new HttpGet(methodURL+"?"+URLEncodedUtils.format(params, "UTF-8"));
So I take a List<NameValuePair> object and make the whole get URL from it. For some reason, the webservice does not accept the value parameters unless they are enclosed in quotation marks.
Is there a way to get the parameters enclosed in quotes without have to manually add the "\"" to each and every parameter in the calls…?
If you can’t change the resolution of the Web Service on the server side, you could have a helper method that would do just that, add the quotation marks. Just a thought.