To SOAP, or not to SOAP? That is the question

落花浮王杯 提交于 2019-12-22 13:46:17

问题


I have a background in protocol stack - for 3g handsets. Now I need to communicate from an Android slate PC to a server, and I will code both sides of the interfacet.


Update: I ought to have said, from Android (multiple) slate to local server (multiple), then over satellite to a single central master server.

And now I think that I might not be implementing, just designing so looking for something easy for junior engineers to handle


SOAP looks ok, but are their any good IDEs to develop something for SOAP (or GSOAP) for Android (not sure yet which o/s the server will run; with luck I will get to choose).

Or should I just roll my own and use TCP/IP? (I have feeling, which I can't justify, SOAP might be quicker to develop and easier for others to maintain).

If I roll my own, I can just use C or C++ at both ends. IF SOAP, can I use C/C++ on Android (I know that I can if it's non-SOAP), or do I go with Java? And, if I do, should I then go with Java at the server, for maintainability?

Final note: I guess that SOAP will add an overhead and I will be doing this over a satellite link, where every byte costs.

Does any of that make sense, or do I need to explain it better?


回答1:


Don't use SOAP if you control both ends. Think about JSON (or JSON-RPC) over HTTP or roll your own using prtocol buffers

SOAP is OK for B2B (remember that term, eh?) communications, but is very heavy and not pleasant to deal with. It might make sense to expose a SOAP interface to the outside world, especially in a Microsoft environment, but it is not ideal for internal use.

UPDATE: If using SOAP both ends do not have to be the same language/library. There are some quirks, I'm sure, but generally interoperability while not great, exists. So you can use Java on the device and C++ on the server, or the other way around, doesn't matter. Regarding IDE -- for Java Eclipse has some relatively bad but usable plugins. Now on to the satellite links... ARE YOU KIDDING ME? Seriously, depends on the size of your objects. If your requests and responses are going to be big, it might be tolerable... maybe. But if you are going to do a lot of small requests with short responses you are looking at 90% overhead. Check out these sample SOAP messages: http://www.w3schools.com/soap/soap_example.asp



来源:https://stackoverflow.com/questions/4532566/to-soap-or-not-to-soap-that-is-the-question

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!