1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

WebService Client


Last Updated:

  1. ramesh_bh

    ramesh_bh Member This Topic's Starter

    Joined:
    Sep 16, 2010
    Messages:
    17
    Likes Received:
    1
    HI,

    I want to invoke sugarcrm wsdl in my Android App,
    For this i have done two of the process, but failed in those two,

    1) I have created webservice stub using wsdl in eclipse editor, i got all the methods but when i want to run the program it is showing error "The project can not built until build path errors are resolved",even i cleared the red mark errors,

    2) I have implemented ksoap in my App, and here is my code that i have called in Activity
    String namespace = "http://www.sugarcrm.com/sugarcrm";
    String method = "is_user_admin";
    String action = "http://127.0.0.1/sugarcrm/soap.php/is_user_admin";
    String url = "http://127.0.0.1/sugarcrm/soap.php";

    SoapObject request = new SoapObject(namespace, method);
    request.addProperty("admin",MD5.getHashString("ramesh"));

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);
    envelope.dotNet = true;
    System.out.println ("<><><><><><><>Ramesh");
    HttpTransportSE androidHttpTransport = new HttpTransportSE(url);
    androidHttpTransport.call(action, envelope);

    Object result = envelope.getResponse();

    if (result instanceof SoapPrimitive ) {
    System.out.println ("<><><><><><><>"+((SoapPrimitive) result).toString());
    }

    System.out.println("dd");

    } catch (Exception e) {
    e.printStackTrace();
    }

    After running the program i got the output as Permission denied, I dont know where could i done mistake

    Please help with example (as i am new to this application developement)
     

    Advertisement
  2. roysamuel

    roysamuel New Member

    Joined:
    Oct 6, 2010
    Messages:
    2
    Likes Received:
    0
    Have u tried adding permission "android.permission.INTERNET" in the android manifest file?
     
  3. ramesh_bh

    ramesh_bh Member This Topic's Starter

    Joined:
    Sep 16, 2010
    Messages:
    17
    Likes Received:
    1
    Solved, i forgot to add the permission, thanks for the reply
     

Share This Page

Loading...