如何使用WCF Android中 [英] How to use WCF in Android

查看:137
本文介绍了如何使用WCF Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我提供了通过WCF Web服务的远程工具到其他网站。
现在,我想提供相同的远程工具,Android应用程序。
我的问题是:
Android应用程序可以消耗我的WCF Web服务(托管网络服务器上),或者我需要改变某些事情了。

I provide a remote tool to other websites through web service in WCF. Now I want to provide same remote tool to Android Apps. My question is: Can Android apps consume my WCF web services (hosted on webserver) or do I need to change something.

推荐答案

您有WCF服务,你希望从Android应用程序使用它。首先你的服务必须是可互操作。在Android客户端的情况下,你应该使用 basicHttpBinding的(SOAP服务)或的WebHttpBinding (REST服务)。

You have WCF service and you want to consume it from Android application. First of all your service must be interoperable. In case of Android client you should use either basicHttpBinding (SOAP service) or webHttpBinding (REST service).


  • 要消耗SOAP服务使用 kSoap2 - <一个href=\"http://stackoverflow.com/questions/2589486/how-to-call-a-wcf-service-using-ksoap2-on-android\">here一些描述如何调用该服务

  • 要消耗REST服务使用使用 DefaultHttpClient 并调用serivice其他任何HTTP资源(REST的服务,最好是使用JSON作为传输格式) - 的这里是一些例子。

  • To consume SOAP service use kSoap2 - here is some description how to call the service
  • To consume REST service use use DefaultHttpClient and call the serivice as any other HTTP resource (for REST service it is better to use JSON as a transport format) - here is some example.

这篇关于如何使用WCF Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆