Click here to Skip to main content
13,045,285 members (61,625 online)
Rate this:
Please Sign up or sign in to vote.
Hello Everyone!

I want to build a webservice for android clients to access. I follow this article[^] to build a simple webservice project, it really worked fine when I access it through Java Client or MyEclipse WebService Explorer.
Then I build a simple android client following this article[^]

Unfortunately, I always received http 500 error... Please Help..!!!!

public class SendValuesActivity extends Activity {
  private final String NAMESPACE = "";
  private final String URL = "";
  private final String SOAP_ACTION = "";
  private final String METHOD_NAME = "sayHello";
  protected void onCreate(Bundle savedInstanceState) {
    Thread networkThread = new Thread() {
      public void run() {
        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
        envelope.dotNet = false;
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        Log.w(getClass().getName(), "========message: Begin to access web =========");
        try {
, envelope);
          SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
          Log.w(getClass().getName(), "========message: "+response.toString()+"=========");
        } catch (Exception e) {
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(, menu);
    return true;

[edit]indexation changed to improve readability[/edit]
Posted 16-Mar-13 22:45pm
Updated 16-Mar-13 23:49pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100