I am designing a mobile application which gets server data through SOAP messages.
I wanted to know what is the best practice:
*PS:*user can have many vehicles and if I use second approach then web services will be called for every vehicle.
SOAP is a messaging protocol for exchanging information between two computers based on XML over the internet. SOAP messages are purely written in XML which is why they are platform and language independent. A SOAP message contains: An Envelope that indicates the start and end of the message.
SOAP can be carried over a variety of protocols, enabling communication between applications with different programming languages on both Windows and Linux. Works on the HTTP protocol. Even though SOAP works with many different protocols, HTTP is the default protocol used by web applications.
SOAP is a protocol for the exchange of information in a distributed environment. SOAP messages are encoded as XML documents and can be exchanged using various underlying protocols.
Couple of points
As pointed out in the comment Use JSON instead of SOAP where ever possible, SOAP is very heavy weight and is not being recommended these days.( look at all the endpoints being exposed by Google and others - most of them use JSON )
If the xml size is becoming too large ( beyond few kilobytes) it is better to make multiple calls rather than loading a large object in memory.
On a mobile connection, I'd opt for larger responses because of the network latency. It's better to fetch a bunch of things in one go than to fetch each item in a new roundtrip. This will keep your app fast.
Even larger responses can be efficiently handled without needing to store those in memory if you use a library that can "stream" the response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With