After calling a Web Service I get a response with the ascii extended characters codified as you can see on this picture (e.g. "<" instead of "<"):

If I call the Web Service with the same Get line ( http://www.webservicex.net/hcpcs.asmx/GetHCPCSbyHCPCSCode?HCPC=12345 ) from a browser it displays the characters correctly:
Using xml Syntax Highlighting
- <string><NewDataSet /></string>
Parsed in 0.000 seconds, using GeSHi 1.0.8.4
Does anybody knows if I am missing something? I think this is a codification issue.
Here is the source code:
Using java Syntax Highlighting
- package org.quauhtli.webservices;
- import org.apache.commons.httpclient.HttpClient;
- import org.apache.commons.httpclient.HttpStatus;
- import org.apache.commons.httpclient.methods.GetMethod;
- import android.app.Activity;
- import android.os.Bundle;
- import android.util.Log;
- import android.widget.TextView;
- public class CallingWebServices extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- HttpClient client = new HttpClient();
- GetMethod get = new GetMethod(
- "http://www.webservicex.net/hcpcs.asmx/GetHCPCSbyHCPCSCode?HCPC=12345");
- try {
- int status = client.executeMethod(get);
- TextView resultado = (TextView) findViewById(R.id.ws_response);
- String res = "";
- if (status == HttpStatus.SC_OK)
- res = get.getResponseBodyAsString();
- else
- res = getString(R.string.ws_not_found);
- resultado.setText(res);
- } catch (Exception e) {
- Log.e("Error:", e.getMessage());
- } finally {
- get.releaseConnection();
- get = null;
- }
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4








