我在 HttpPost 上收到 IOExeption 'Host is unresolved'。在这种情况下,端点是我 LAN 上带有 Web 服务的计算机。(http://pc259:8080/test/service.asmx)。我使用 WIFI 连接我的局域网。Android 知道要解析计算机名吗?
StringEntity se = new StringEntity(xmlDataToSend);
se.setContentType("text/xml");
HttpPost httppost = new HttpPost(endPoint);
httppost.setHeader("Content-Type","application/soap+xml");
httppost.setEntity(se);
HttpClient httpclient = new DefaultHttpClient();
Log.i(TAG, " - Before execute");
httpResponse = (BasicHttpResponse) httpclient.execute(httppost);