내 버튼 클릭 이벤트에 위의 코드를 써야합니다. webservice 작업 fine.webservice 메서드는 문자열을 반환합니다. thatString은 성공과 같습니다. 다음 layout.it은 정상적으로 작동합니다. 그렇지 않으면 부분적으로 작동하지 않습니다. 토스트는 예외를 만든다호출 웹 서비스 메서드에서 스레드를 처리 할 수 없습니다?
final SoapSerializationEnvelope envelope1 = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope1.setOutputSoapObject(request1);
//msg.setText("hi");
envelope1.dotNet = true;
final Thread webser=new Thread(){
public void run()
{
try {
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
System.out.println("four and Object value is : " +androidHttpTransport);
System.out.println("four and URL : " +URL);
//this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION, envelope1);
System.out.println("four a");
// Get the SoapResult from the envelope body.
SoapObject result1 = (SoapObject)envelope1.bodyIn;
if(result1 != null)
{
//Get the first property and change the label text
status=result1.getProperty(0).toString();
if(status.equalsIgnoreCase("success"))
{
Intent home=new Intent(LoginActivity.this,MainActivity.class);
startActivity(home);
}
else
{
Thread.sleep(1000);
Toast.makeText(LoginActivity.this,"Enter Valid Username/Password", Toast.LENGTH_LONG).show();
}
}
else
{
System.out.println("nodata");
}
} catch (Exception e) {
e.printStackTrace();
System.out.println("Exception" +e);
}
}
};
webser.start();
}
});
"작동하지 않습니다."는 설명하기에 충분하지 않습니다. 좀 더 설명 해주십시오. – JoxTraex
내 버튼 클릭 이벤트에 위의 코드를 써야합니다. webservice 작업 fine.webservice 메서드는 문자열을 반환합니다. thatString은 성공과 같습니다. 다음 layout.it은 정상적으로 작동합니다. 그렇지 않으면 부분적으로 작동하지 않습니다. 토스트는 예외를 만든다 – Palaniraja
의견이 아닌 게시물에서이를 분명하게 작성하십시오. – JoxTraex