I am making web service tha开发者_JS百科t generates and accepts xml information, and i am wondering, whether generated from xml schema jaxb classes could be transferred as-is.
The details depends on what technology you're using as the transport for your web service but the answer is yes.
For example, if you're using JAX-WS (for soap) or JAX-RS (for rest) then both of those technologies have a way of using JAXB objects. If you're writing a pure servlet then you can marshal the JAXB objects and write the XML onto the response or unmarshal the request with JAXB. Of course, your client is also going to need some way of interpreting the data.
精彩评论