• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps saop parsing

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
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones