调用.NET web服务与Android [英] Call .NET Webservice with Android

查看:149
本文介绍了调用.NET web服务与Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经在这里问过,但我不认为这些问题的答案已经足够满足我的需求。

I know this question has been asked here before, but I don't think those answers were adequate for my needs.

我们有一个用于iPhone应用程序中的SOAP Web服务,但它是可能的,我们需要一个Android特定版本或服务的代理,所以我们可以选择去与SOAP或JSON。我有一个关于这两种方法的几个关注点:

We have a SOAP webservice that is used for an iPhone application, but it is possible that we need an Android specific version or a proxy of the service, so we have the option to go with either SOAP or JSON. I have a few concerns about both methods:

肥皂溶液:

  1. 是否有可能生成Java 从WSDL文件源$ C ​​$ C,如果是的话, 将它包含某种代理 类调用Web服务和 将它在Android合作 环境呢?
  2. 在谷歌没有提供任何SOAP 在Android的库,所以我需要使用 第三方,任何建议?
  3. 怎么样的性能/开销 与解析和发送SOAP XML在电线兑JSON 解决办法?
  1. Is it possible to generate java source code from a WSDL file, if so, will it include some kind of proxy class to invoke the webservice and will it work in the Android environment at all?
  2. Google has not provided any SOAP library in Android, so i need to use 3rd party, any suggestion?
  3. What about the performance/overhead with parsing and transmitting SOAP xml over the wire versus the JSON solution?

JSON的解决方案:

  1. 有几个班的 Android的SDK,让我解析 JSON,但它支持通用 解析,就像如果我想要的结果 被解析为复杂类型?要么 我需要实现 我自己?
  2. 在我以前读到2库 这里#1,GSON的 杰克逊。区别是什么 性能和可用性(从一个 开发者的角度来看)明智吗?你做 球员有任何的遭遇无论是 这些库?
  1. There is a few classes in the Android sdk that will let me parse JSON, but does it support generic parsing, like if I want the result to be parsed as a complex type? Or would I need to implement that myself?
  2. I have read about 2 libraries before here on Stackoverflow, GSON an Jackson. What is the difference performance and usability (from a developers perspective) wise? Do you guys have any experince with either of those libraries?

所以我想最大的问题是,什么方法去?

So i guess the big question is, what method to go with?

我希望你能帮助我。在此先感谢: - )

I hope you can help me out. Thanks in advance :-)

推荐答案

我一直在做类似的东西我自己,虽然我可能不是这个最好的权威,我会说9次了10 JSON是这样的你想去。这并不是说肥皂没有它的位置,但对于大多数事情JSON将更加简单,如果不看这样,它更可能是您的服务需求重构,而不是一个真正的复杂领域重新present。

I have been working on something similar myself, and although I may not be the best authority on this, I would say 9 times out of 10 JSON is the way you want to go. Not that soap doesn't have it's place, but for most things JSON will be simpler, and if it doesn't look that way it's more likely that your service needs refactoring rather than having a genuinely complex domain to represent.

如果你想使用iPhone,黑莓,WinMo7,阿贾克斯网站相同的服务,还是真的在其他地方,这将是对你多好很多的好处ofcourse是: - )

The added bonus ofcourse is if you want to use the same service on iPhone, Blackberry, WinMo7, Ajax website, or really anywhere else, it will be much much better for you :-)

我的$ 0.02

这篇关于调用.NET web服务与Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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