Android应用程序与WCF沟通 [英] Android app communicating with WCF

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

问题描述

我目前是基于Windows技术(使用C#.NET)的客户端/服务器应用程序。我使用WCF与传输和消息凭据。 (即SSL与基本的用户名/密码信息认证)

I currently have a client/server application which is based on Windows technology (using C# .net). I use WCF with transport and message credentials. (i.e. SSL with basic username/password message authentication)

一要拿出项目,是允许客户端在Android平台(手机或平板电脑)上运行。

One of the projects about to come up, is to allow the client side to run on an Android platform (phone or tablet).

都可以从内部的Andr​​oid code?

Are there Android/Java/Linux libraries available to consume a WCF service from within Android code ?

如果不是这样,我想我得写围绕服务的包装,并使用另一种方法。

If not, I guess I'll have to write a wrapper around the services and use an alternative method.

推荐答案

您还可以创建一个JSON的WCF服务结合 - 这是暴露你的WCF服务既是一个WCF服务和JSON服务 - 然后使用标准的Andr​​oid Web服务方法 - 这是一种做作。这种方法的好处是,你不必再分发KSOAP - 和你少写code为Android。 JSON也使用较少的带宽(如果这是一个问题)

You can also create a JSON binding for your WCF service - that is expose your WCF service as both a WCF service and a JSON service - then use the standard Android webservice method - which is kind of hokey. The advantage of this approach is that you don't have to distribute KSoap - and you are writing less code for the android. JSON is also uses less band width (if that is an issue)

这篇关于Android应用程序与WCF沟通的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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