Android에서 .asmx 웹 서비스를 호출하려고합니다. 아래에서 내 코드를 볼 수 있습니다. 다른 웹 서비스에서 사용할 때 작동하지만 사용해야하는 웹 서비스에서는 작동하지 않습니다. 문제점은 "java.io.IOException : HTTP 요청 실패, HTTP 상태 : 500"입니다. 먼저 문제는 웹 서비스 측에서 발생한다고 가정합니다. 그러나 그것은 Devexpress 및 .NET을 사용하여 도달하려고 할 때 작동합니다.Android 오류에서 asmx 웹 서비스 호출 : "java.io.IOException : HTTP 요청이 실패했습니다. HTTP 상태 : 500"
"contentType :"application/json을 제거 할 때 Devexpress에서 같은 오류가 발생했습니다. charset = utf-8 ","line.
참고 : 웹 서비스 정의에는 오류가 없습니다.
개인 클래스 KullaniciServiceAsync는 하등의 I/O 예외가 발생한 AsyncTask를 {
protected void onPreExecute(){
Toast.makeText(getApplicationContext(), "Kullanici Bilgileri Alınıyor...", Toast.LENGTH_SHORT).show();
}
@Override
protected KullaniciBilgisiGetir doInBackground(String... Str) {
try {
//ArrayList<HeaderProperty> headerProperty = new ArrayList<HeaderProperty>();
//headerProperty.add(new HeaderProperty("Content-Type", "application/json; charset=utf-8"));
k = new KullaniciBilgisiGetir();
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("UserId","1234567890");
request.addProperty("Password",Pass);
request.addProperty("Kod",Kod);
request.addProperty("Sifre",Sifre);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
Log.e("Request",request.toString());
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
try{
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject) envelope.getResponse();
if (response.hasProperty("KResult")) {
if (response.getPropertyAsString("KResult") == null) {
k.setKullaniciRespond(null);
} else {
k.setKullaniciRespond(response.getPropertyAsString("KResult"));
}
}
}catch(Exception e){
Log.e("httpTRYCATCH", e.toString());
}
} catch (Exception e) {
Log.e("ilkTRY",e.toString());
}
return k;
}
protected void onPostExecute(KullaniciBilgisiGetir e){
txt1.setText("ResponseText ->" + e.getKullaniciRespond());
//txt2.setText("bu "+e.getResponse());
//txt3.setText("Count "+count);
}
}
이 오류는 웹 서버 소프트웨어에 대한 수정하여 해결할 수 있습니다 :
또한 당신이 튜토리얼을 따를 수 있습니다. 그것은 클라이언트 측 문제가 아닙니다. –
어떻게 해결 될 수 있습니까?시스템 관리자에게 문의 할 수 있습니다. 그러나 나는 그가해야 할 일을 말해야한다. – user00001