我使用.net webservice來捕獲我從Android應用程序獲得的響應。 我回到低於線從Android應用程序從.net中獲取httpResponse從android
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(
"http://10.0.2.2:51889/OMS/WebServices/Service.asmx/Test");
List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2);
nameValuePair.add(new BasicNameValuePair("email", "abc"));
nameValuePair.add(new BasicNameValuePair("pwd", "123"));
// Url Encoding the POST parameters
try {
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
} catch (UnsupportedEncodingException e) {
// writing error to Log
e.printStackTrace();
}
// Making HTTP Request
try {
HttpResponse response = httpClient.execute(httpPost);
} catch (ClientProtocolException e) {
// writing exception to log
e.printStackTrace();
} catch (IOException e) {
// writing exception to log
e.printStackTrace();
}
我怎樣才能在.NET Web服務的這種反應?
我從安卓
這樣的數據,所以我怎樣才能在C#.NET數據???
.NET web服務捕捉響應或請求?它應該是請求。 –
不,它是從Android應用程序響應返回。 –
從Anroid應用程序的響應?你是否在應用程序中運行HTTP服務器,或者如何從.net應用程序調用android應用程序?從我看到你是從Android發佈HTTP POST到服務器? – Kolja