當前位置:首頁 » 安卓系統 » android訪問wcf

android訪問wcf

發布時間: 2023-07-11 14:25:05

Ⅰ Android與WCF傳輸數據類型Wcf如果不拼XML,不做序列化!手機怎麼與之交互

我的方案是:中間建立一個代理網站, android 訪問代理網站,代理網站調用WCF,將WCF返回的數據序列化成json返回給android。

代理網站可以採用1. asp.net WebForm, 2. asp.net webAPI
當採用WebForm,安卓訪問url.aspx,參數通過url QueryString傳遞, 頁面WCF返回結果直接寫入相應流中。
當採用webAPI,這個相對復雜點,還要處理跨域,驗證等問題。而且還要ASP.NET MVC 4才支持。

Ⅱ 如何搭建android客戶端的伺服器端

建議你可以用webservice做服務端 如果資源較大的話 可以用ftp來做服務端 android有很多ftp客戶端的代碼 你可以參考一下 做業務類的字元類的數據 就用json編碼的webservice 或者是目前比較流行的wcf服務端 網路一下一大堆

Ⅲ android開發中,如何連接伺服器,從伺服器讀取到數據

伺服器端生成JSON:

使用HttpURLConnection連接,通過JSON格式傳遞對象數據

java">	URLurl=newURL(urlpath);
HttpURLConnectionconn=(HttpURLConnection)url.openConnection();
InputStreaminStream=conn.getInputStream();
=newByteArrayOutputStream();
byte[]data=newbyte[1024];
intlen=0;
while((len=inStream.read(data))!=-1){
outStream.write(data,0,len);
System.out.println(len);
}
inStream.close();
byte[]rlt=outStream.toByteArray();
returnnewString(rlt);

Ⅳ Android客戶端如何連接到資料庫伺服器,請指明學習內容,謝謝!

通過webservice 連接,網路下很多

Ⅳ 如何發送多個參數,從 android 到 wcf 伺服器使用 ksoap2

若要發送多個參數、 字元串、 整數,等等:
SoapObject request = new SoapObject(NAMESPACE, METHOD);

PropertyInfo variableHeight = new PropertyInfo();

variableHeight.setName("height");
variableHeight.setValue(value); // your variable value
variableHeight.setType(Integer.class); // if its string type change to String.class
request.addProperty(variableHeight);

PropertyInfo variableWidth = new PropertyInfo();

variableWidth.setName("width");
variableWidth.setValue(value);
variableWidth.setType(Integer.class);
request.addProperty(variableWidth);

但用於發送位元組數組我不太清楚,看看這個: http://code.google.com/p/ksoap2-android/issues/detail?id=116

Ⅵ android請求wcf服務提交數據是response.getstatusline.getstatuscode的值為40

response.getStatusCode()==200:代表請求成功
response.getStatusCode()==303:代表重定向
response.getStatusCode()==400:代表請求錯誤
response.getStatusCode()==401:代表未授權
response.getStatusCode()==403:代表禁止訪問
response.getStatusCode()==404:代表文件未找到
response.getStatusCode()==500:代表伺服器錯誤

熱點內容
scratch少兒編程課程 發布:2025-04-16 17:11:44 瀏覽:626
榮耀x10從哪裡設置密碼 發布:2025-04-16 17:11:43 瀏覽:356
java從入門到精通視頻 發布:2025-04-16 17:11:43 瀏覽:71
php微信介面教程 發布:2025-04-16 17:07:30 瀏覽:296
android實現陰影 發布:2025-04-16 16:50:08 瀏覽:787
粉筆直播課緩存 發布:2025-04-16 16:31:21 瀏覽:337
機頂盒都有什麼配置 發布:2025-04-16 16:24:37 瀏覽:202
編寫手游反編譯都需要學習什麼 發布:2025-04-16 16:19:36 瀏覽:798
proteus編譯文件位置 發布:2025-04-16 16:18:44 瀏覽:355
土壓縮的本質 發布:2025-04-16 16:13:21 瀏覽:582