Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:02:03+00:00 2026-06-07T20:02:03+00:00

Hi i developed one login form calling soap webservices.it is success fully worked for

  • 0

Hi i developed one login form calling soap webservices.it is success fully worked for me…But now i implement the one part.when my login details are successfully means it is go to next activity.
how is to do..here am facing some difficulties.
the coding part is below.

dis is my webservices java project:

package com.userlogin.ws;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Login {
public String authentication(String userName,String password){

String retrievedUserName = "";
String retrievedPassword = "";
String status = "";
try{

 Class.forName("com.mysql.jdbc.Driver");
 Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/androidlogin","root","");
 PreparedStatement statement =  con.prepareStatement("SELECT * FROM user WHERE username = '"+userName+"'");
 ResultSet result = statement.executeQuery();

 while(result.next()){
retrievedUserName = result.getString("username");
retrievedPassword = result.getString("password");
}

if(retrievedUserName.equals(userName)&&retrievedPassword.equals(password)){
status = "Success!";

 }

 else{
 status = "Login fail!!!";
 }

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

  }

  }

dis is my android side coding part:

package com.androidlogin.ws;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.content.Intent;

public class AndroidLoginExampleActivity extends Activity {
private final String NAMESPACE = "http://ws.userlogin.com";
private final String URL = "http://192.168.1.168:8085/Login/services/Login?wsdl";
private final String SOAP_ACTION = "http://ws.userlogin.com/authentication";
private final String METHOD_NAME = "authentication";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Button login = (Button) findViewById(R.id.btn_login);
    login.setOnClickListener(new View.OnClickListener() {

   public void onClick(View arg0) {
   loginAction();

   }
  });
   }

private void loginAction(){
 SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

    EditText userName = (EditText) findViewById(R.id.tf_userName);
    String user_Name = userName.getText().toString();
    EditText userPassword = (EditText) findViewById(R.id.tf_password);
    String user_Password = userPassword.getText().toString();

  //Pass value for userName variable of the web service
    PropertyInfo unameProp =new PropertyInfo();
    unameProp.setName("userName");//Define the variable name in the web service method
    unameProp.setValue(user_Name);//set value for userName variable
    unameProp.setType(String.class);//Define the type of the variable
    request.addProperty(unameProp);//Pass properties to the variable

  //Pass value for Password variable of the web service
    PropertyInfo passwordProp =new PropertyInfo();
    passwordProp.setName("password");
    passwordProp.setValue(user_Password);
    passwordProp.setType(String.class);
    request.addProperty(passwordProp);

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

    try{
        androidHttpTransport.call(SOAP_ACTION, envelope);
           SoapPrimitive response = (SoapPrimitive)envelope.getResponse();

           TextView result = (TextView) findViewById(R.id.tv_status);
           result.setText(response.toString());

    }
    catch(Exception e){

    }

    Button registerScreen = (Button) findViewById(R.id.btn_login);

    // Listening to register new account link
    registerScreen.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // Switching to Register screen
            Intent i = new Intent(getApplicationContext(), RegisterActivity.class);
            startActivity(i);
        }
      });
   }

   }

Here when am clicked button means it is redirect to next activity..but i wish to need if successful login means it is go to next activity….please where is putting dis intent coding or tell me how is to do…please guide me .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:02:04+00:00Added an answer on June 7, 2026 at 8:02 pm

    As I understand your question, You have to check the response form your login web service call and make a condition on that base.

    If your response contains Success! status then start NewActivity else show Login Failure Dialog or Toast.

    For Example:

    your logic should goes here for start new Activity,

    try{
            androidHttpTransport.call(SOAP_ACTION, envelope);
            SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
            String status = response.toString();
    
            TextView result = (TextView) findViewById(R.id.tv_status);
            result.setText(response.toString());
    
        if(status.equals("Success!"))
         {
           Intent i = new Intent(getApplicationContext(), NextActivity.class);
           startActivity(i);    
         }
        else
         {
             // Code for Login failure 
         }
       }
        catch(Exception e){
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi i successfully develped one login form with mysql database via soap webservices.here i
i have developed one login form (username,password and submit button) using a MySQL connection
I have developed one login form in Android. I have used validation here. I
My application login is developed using Shiro Apache, it's working fine but now i
I developed one database related application for iPhone device(SQlite database). Now i want to
I developed one swing application but each time you run application new window is
I had developed one website purely in HTML .I have my form with fields
Here i want to developed one application using google account login facility and i
Hi i have successfully developed one listview app..now i have to click any item
I've developed a login module using AJAX. One of the functionalities is username availability

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.