1. Are you ready for the Galaxy S20? Here is everything we know so far!

saop parsing

Discussion in 'Android Development' started by Shruti Shukla, Apr 12, 2012.

  1. Shruti Shukla

    Shruti Shukla Lurker
    Thread Starter

    private static final String WSDL_TARGET_NAMESPACE = "http://cfsdf.ffff.net";
    SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, FunctionName);
    try {
    PropertyInfo p1, p2, p3;
    p1 = new PropertyInfo();
    p2 = new PropertyInfo();
    p3 = new PropertyInfo();
    p1.setName("username");
    p1.setValue(usrname);
    p2.setName("password");
    p2.setValue(password);
    p3.setName("first_name");
    p3.setValue(sixValue);
    request.addProperty(p1);
    request.addProperty(p2);
    request.addProperty(p3);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
    SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);

    HttpTransportSE androidHttpTransport = new HttpTransportSE(
    WebServiceUrlRegistration);
    try {
    androidHttpTransport.call(SoapAction, envelope);
    SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;

    Object soapObj = resultsRequestSOAP.getProperty(0);
    String SoapString = soapObj.toString();
    for (int j = 0; j < SoapString.length() && flag == 0; j++) {
    String tem = SoapString.substring(j, j + 3);
    if (tem.equals("id=")) {
    for (int m = j; m < SoapString.length() && flag == 0; m++) {
    if (SoapString.substring(m, m + 1).equals(";")) {
    id = SoapString.substring(j + 3, m);
    flag = 1;
    idInt = Integer.parseInt(id);
    }
    }
    }
    }



    } catch (Exception e) {
    e.getMessage();
    }
    } catch (Exception e1) {
    e1.getMessage();
    }


    /////////////////////////to fatch data///////////////////////////



    String WebServiceUrlLogin = WebServiceUrl + "getlogin.php";
    String FunctionName = "GetLoginInfo";
    Boolean isUserValid = false;
    SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, FunctionName);
    try {
    PropertyInfo p1, p2;
    p1 = new PropertyInfo();
    p2 = new PropertyInfo();

    p1.setName("username");
    p1.setValue(UserName);

    p2.setName("password");
    p2.setValue(Password);

    request.addProperty(p1);
    request.addProperty(p2);

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
    SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);
    // SoapObject response = (SoapObject)this.call(SoapAction +
    // FunctionName, envelope);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(
    WebServiceUrlLogin);
    try {
    androidHttpTransport.call(SoapAction, envelope);
    SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
    Object soapObj = resultsRequestSOAP.getProperty(0);
    String SoapString = soapObj.toString();
    for (int j = 0; j < SoapString.length() && flag == 0; j++) {
    String tem = SoapString.substring(j, j + 3);
    if (tem.equals("id=")) {
    for (int m = j; m < SoapString.length() && flag == 0; m++) {
    if (SoapString.substring(m, m + 1).equals(";")) {
    id = SoapString.substring(j + 3, m);
    flag = 1;
    idInt = Integer.parseInt(id);
    }
    }
    }
    }

    if (idInt != 0) {
    isUserValid = true;
    }

    PollMain.userId = id;
    ServiceCaller.UserInfoService = null;
    ServiceCaller.cityservicecaller = null;
    SurveyModuleActivity.userId=idInt;
    //PollMain.userId = "32";
    // SoapPrimitive c
    // =(SoapPrimitive)resultsRequestSOAP.getProperty(0);

    // isUserAdd =new Boolean(c.toString());

    } catch (Exception e) {
    e.printStackTrace();
    }
    } catch (Exception e) {
    e.getMessage();
    }
    :D
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Shruti Shukla

    Shruti Shukla Lurker
    Thread Starter

    u can find out a project which teaches u google map
     

    Attached Files:

Loading...
Similar Threads - saop parsing
  1. frozen_sun
    Replies:
    6
    Views:
    1,689

Share This Page

Loading...