XML through web service
I have some data which I think would be best to be represented in XML. I want this data to be transmitted from a Java Web service to a web client so basically I want the XML data to be transmitted. What I'm thinking is reading from the XML file from the web service converting it to an object and sending it to the client and the client would convert it to xml again.
But I'm not sure if this is the best way I could do it... Any opinions please?
Thanks an开发者_运维知识库d regards, Krt_Malta
I have to disagree. A web service should be auto descriptive. When someone points to the WSDL it is far better to have an object model than a single string property which will contain some proprietary XML. Also there will be e big overhead of serialization/deserialization. My recommendation would be to design an object model which will represent your data and expose this model in the web service. Manipulating objects is easier than manipulating XML.
If its already xml you shouldnt convert it to an object. Your server module should stream the xml file/data to teh client directly instead of going for the web service model.
精彩评论