开发者

How to use WCF in Android

开发者 https://www.devze.com 2023-03-15 16:32 出处:网络
I provid开发者_运维百科e a remote tool to other websites through web service in WCF. Now I want to provide same remote tool to Android Apps.

I provid开发者_运维百科e 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.


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).

  • 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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号