我正在開發一個使用Web服務和調用API發送請求並獲取響應的Android應用程序。Android應用程序中的UnknownHostException警告
我的申請被罰款前工作,但現在當我開始我的應用程序了,並嘗試登錄(應用程序的第一頁。)這說明下面的警告和例外
我的應用程序代碼行:
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("requestXml", envelope1);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
Object response = null;
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
response = envelope.getResponse();
authenticationLoginResponse = response.toString();
} catch (Exception e) {
e.printStackTrace();
}
我收到以下行的警告:
androidHttpTransport.call(SOAP_ACTION,envelope);
完善的報警日誌:
05-28 17:09:06.819: W/System.err(1771): java.net.UnknownHostException: capsconnect.phasestreamtest.com
05-28 17:09:06.822: W/System.err(1771): at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
05-28 17:09:06.832: W/System.err(1771): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
05-28 17:09:06.832: W/System.err(1771): at java.net.InetAddress.getAllByName(InetAddress.java:256)
05-28 17:09:06.832: W/System.err(1771): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:69)
05-28 17:09:06.832: W/System.err(1771): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
05-28 17:09:06.832: W/System.err(1771): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
05-28 17:09:06.842: W/System.err(1771): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
05-28 17:09:06.842: W/System.err(1771): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
05-28 17:09:06.853: W/System.err(1771): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
05-28 17:09:06.853: W/System.err(1771): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205)
05-28 17:09:06.853: W/System.err(1771): at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:76)
05-28 17:09:06.853: W/System.err(1771): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:152)
05-28 17:09:06.853: W/System.err(1771): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
05-28 17:09:06.853: W/System.err(1771): at commerce.app.lib.login.LoginScreen.performBackgroundProcess(LoginScreen.java:273)
05-28 17:09:06.862: W/System.err(1771): at commerce.app.lib.login.LoginScreen.access$2(LoginScreen.java:233)
05-28 17:09:06.862: W/System.err(1771): at commerce.app.lib.login.LoginScreen$1$1.run(LoginScreen.java:219)
05-28 17:09:06.862: W/System.err(1771): java.lang.NullPointerException
05-28 17:09:06.862: W/System.err(1771): at java.io.StringReader.<init>(StringReader.java:46)
05-28 17:09:06.872: W/System.err(1771): at commerce.app.lib.login.LoginScreen.performBackgroundProcess(LoginScreen.java:285)
05-28 17:09:06.872: W/System.err(1771): at commerce.app.lib.login.LoginScreen.access$2(LoginScreen.java:233)
05-28 17:09:06.872: W/System.err(1771): at commerce.app.lib.login.LoginScreen$1$1.run(LoginScreen.java:219)
任何機構可以說明爲什麼這個錯誤是蓄勢而這個項目很好,前幾天運行?
你在使用模擬器嗎?如果然後卸載應用程序並重新啓動您的模擬器.. – hacker
你的網址在哪裏? – Akram
@SpK是的,我已經授予 –