WebService Client

Discussion in 'Android Apps & Games' started by ramesh_bh, Sep 16, 2010.

  1. ramesh_bh

    ramesh_bh Member
    16

    Sep 16, 2010
    17
    1
    16
    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
    5

    Oct 6, 2010
    2
    0
    5
    Have u tried adding permission "android.permission.INTERNET" in the android manifest file?
     
  3. ramesh_bh

    ramesh_bh Member
    16

    Sep 16, 2010
    17
    1
    16
    Solved, i forgot to add the permission, thanks for the reply
     

Share This Page

Loading...