我正在开发一个使用 Web 服务并调用 API 来发送请求和获取响应的 android 应用程序。
我的应用程序以前运行良好,但现在当我开始我的应用程序并尝试登录(应用程序的第一页)时,这显示以下警告和异常
我的应用程序代码行是:
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, 信封);
完整的警告日志是:
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)
几天前该项目运行良好时,任何人都可以提出为什么现在出现此错误的原因吗?