public class MainActivity extends AppCompatActivity {
EditText LoginText;
String SOAP_ACTION = "https://mywebsite.com/ReadLogin";
String METHOD_NAME = "ReadLogin";
String namespace = "https://mywebsite.com/";
String url = "https://mywebsite/login.asmx";
public void checkLogin(View view) {
String login = LoginText.getText().toString();
RequestParams params = new RequestParams();
if (isNotNull(login)) {
//params.put("username", login);
call();
//invokeWS(params);
}
else {
Toast.makeText(getApplicationContext(), "Please enter valid email", Toast.LENGTH_LONG).show();
}
}
public void call()
{
try {
SoapObject request = new SoapObject(namespace, METHOD_NAME);
request.addProperty("username", "abc");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
//envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(url);
androidHttpTransport.debug = true;
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
//final Vector<SoapObject> response = (Vector<SoapObject>)envelope.getResponse();
//final String str = response.toString();
//Object result = (Object)envelope.getResponse();
//String myResult = result.toString();
Toast.makeText(getApplicationContext(), resultsRequestSOAP.toString(), Toast.LENGTH_LONG).show();
} catch (Exception e) {
String mError =e.toString();
Toast.makeText(getApplicationContext(), mError, Toast.LENGTH_LONG).show();
}
}
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.