Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- playOnlineButton.setOnClickListener( new View.OnClickListener() {
- public void onClick( View v ) {
- final String username = usernameInput.getText().toString();
- final String password = passwordInput.getText().toString();
- final String DBIP = "192.168.2.137";
- new Thread( new Runnable() {
- public void run( ) {
- try {
- String NAMESPACE = "http://QuizWS.gawhisper.com/";
- String URL = "http://" + DBIP + ":8080/QuizWebService/QuizWS";
- String METHOD_NAME = "CheckLogin";
- String SOAP_ACTION = "http://QuizWS.gawhisper.com/QuizWS/CheckLogin";
- SoapObject request = new SoapObject( NAMESPACE, METHOD_NAME );
- PropertyInfo usernameProperty = new PropertyInfo();
- usernameProperty.type = PropertyInfo.STRING_CLASS;
- usernameProperty.setName( "username" );
- usernameProperty.setValue( username );
- PropertyInfo passwordProperty = new PropertyInfo();
- passwordProperty.type = PropertyInfo.STRING_CLASS;
- passwordProperty.setName( "password" );
- passwordProperty.setValue( password );
- request.addProperty( usernameProperty );
- request.addProperty( passwordProperty );
- SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11 );
- envelope.setOutputSoapObject( request );
- HttpTransportSE androidHttpTransport = new HttpTransportSE( URL );
- androidHttpTransport.call( SOAP_ACTION, envelope );
- SoapPrimitive response = ( SoapPrimitive ) envelope.getResponse();
- answer = response.toString();
- Toast.makeText( StartActivity.this, "ANSWER IS: " + answer, Toast.LENGTH_SHORT ).show();
- } catch ( Exception e ) {
- Log.e( "", "ERROR ----------------->" + e.getMessage() );
- }
- }
- } ).start();
- }
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement