问题描述
我知道这个问题已经在这里问过,但我不认为这些问题的答案已经足够满足我的需求。
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:
肥皂溶液:
- 是否有可能生成Java从WSDL文件源$ C $ C,如果是的话,将它包含某种代理类调用Web服务和将它在Android合作环境呢?
- 在谷歌没有提供任何SOAP在Android的库,所以我需要使用第三方,任何建议?
- 怎么样的性能/开销与解析和发送SOAPXML在电线兑JSON解决办法?
- Is it possible to generate javasource code from a WSDL file, if so,will it include some kind of proxyclass to invoke the webservice andwill it work in the Androidenvironment at all?
- Google has not provided any SOAPlibrary in Android, so i need to use3rd party, any suggestion?
- What about the performance/overheadwith parsing and transmitting SOAPxml over the wire versus the JSONsolution?
JSON的解决方案:
- 有几个班的Android的SDK,让我解析JSON,但它支持通用解析,就像如果我想要的结果被解析为复杂类型?要么我需要实现我自己?
- 在我以前读到2库这里#1,GSON的杰克逊。区别是什么性能和可用性(从一个开发者的角度来看)明智吗?你做球员有任何的遭遇无论是这些库?
- There is a few classes in theAndroid sdk that will let me parseJSON, but does it support genericparsing, like if I want the resultto be parsed as a complex type? Orwould I need to implement thatmyself?
- I have read about 2 libraries beforehere on Stackoverflow, GSON anJackson. What is the differenceperformance and usability (from adevelopers perspective) wise? Do youguys have any experince with eitherof 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!