开发者

What is the best way to send XML data to webservices jaxws

What is the best way to send XML data to web services jax-ws?

One of the way I could make out is to convert xml into String from client side and send it as a String to 开发者_运维问答WebService.

I don't think this is the best way / best practice .


I use the serialized Java objects directly.


Best way is to use framework that supports web-service standards. For Java try Apache CXF or Apache Axis 2.


Why are using XML would be the first question.

I would say take a look at the google protocol buffer, you will be able create a .proto file same as you create xsd and then you will be able to generate code from that proto file into different languages, the way you send over to the webservice is just takes the bytes array out of the google proto object and send it.


Encode --> Escape/ Wrap with CDATA --> set value to a string --> pass as a parameter to webservice/remote method as defined in your wsdl.


I can understand the need to do so such XML request -response.. Though there could be varied views on this.. at times the need is defined by the application/package that we work on ..

1 good article which i found on this http://java.dzone.com/articles/implementing-jax-ws-web

Hope this helps

Samant

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜