0

I have a web service that provides queries functionality using hibernate. A query can return multiple results - each results contains multiple parameters.

The question is: how should I return the result:

  1. Can serialize everything into 1 string nd client will parse it.
  2. I know there is a possibility to return Array of strings or Array of complex types.

Which is better for performance - there might be lots of user doing request etc.

If better using the complex types - can give an example of using it - or a link to some info.

Thanks Yoav

1 Answer 1

1

Web services generally return results in a platform-independent, but structured way. XML and JSON are two frequent choices.

There are plenty of apis in Java to generate XML and JSON. Google for them. I like using JAXB for XML. Some APIs take JAXB-annotated objects and serialize them into JSON instead of XML.

Sign up to request clarification or add additional context in comments.

2 Comments

it is using soap - but what is better for performance - a string or a complex type
Make it usable and correct before thinking about making it fast. Use a complex type, which will be directly usable by your clients, rather than forcing them to implement a complex parsing algorithm. web services are slow because of the network, not because of the transmitted data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.