마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

ksaop2로 wcf 이용해서 로그인 구현중인데 연결이 안됩니다

0 추천
public class MainActivity extends AppCompatActivity {
    //AAsyncTask mTask;
    LoginBackgroundTask backgroundTask;
    static String ID;
    static String PW;
    static int asklogin;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void click_regist(View v)
    {
        Intent it= new Intent(getApplicationContext(),regist.class);
        startActivity(it);
    }
    public void click_login(View v) {
        EditText ido=(EditText)findViewById(R.id.idtext);
        EditText pwo=(EditText)findViewById(R.id.pwtext);
        ID=ido.getText().toString();
        PW=pwo.getText().toString();

        backgroundTask  =new LoginBackgroundTask();
        backgroundTask.execute();

        if(asklogin==0)
        {
            Toast.makeText(this, "로그인 오류!", Toast.LENGTH_SHORT).show();
        }
        else if(asklogin==1)
        {
            Intent stu= new Intent(getApplicationContext(),Student.class);
            startActivity(stu);
        }
        else if(asklogin==2)
        {
            Intent tea= new Intent(getApplicationContext(),Teacher.class);
            startActivity(tea);
        }

        else if(asklogin==3)
        {
            Intent stu= new Intent(getApplicationContext(),Student.class);
            startActivity(stu);
        }
    }

    public class LoginBackgroundTask extends AsyncTask<String,Integer,String>
    {
        protected void onPostExecute(String result)
        {
            super.onPostExecute(result);
        }
        @Override
        protected String doInBackground(String...params)
        {
            SoapObject request = new SoapObject("http://tempuri.org/","Login");
            request.addProperty("user_id",ID);        //로그인시 전달할 아이디
            request.addProperty("pw",PW);             //로그인시 전달할 비번


            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
            envelope.setOutputSoapObject(request);
            envelope.dotNet=true;
            HttpTransportSE androidHttpTransport=new HttpTransportSE("http://192.168.33.49:11000/Service");
            try{androidHttpTransport.call("http://tempuri.org/IService/Login",envelope);
                Object result=envelope.getResponse();
                String Re=result.toString();
                int ii=Integer.parseInt(Re);
                asklogin=ii;
                return Re;
            }
            catch (Exception e)
            {
                e.printStackTrace();
                return e.getLocalizedMessage();
            }
        }
    }
}

 

웹 페이지 xml은 http://192.168.33.49:11000/?wsdl

입니다 부디 전문가님의 손길을 앙망합니다

 

soap버전도 문제 없는것 같은데 뭐가 문제인가요..... 

ver11 도 안되고 ver 12도 안됩니다 

탄빵 (310 포인트) 님이 2016년 7월 10일 질문

1개의 답변

0 추천
자체 해결 했습니다 결국 버전 문제군요...
탄빵 (310 포인트) 님이 2016년 7월 11일 답변
...