NewBeee_Java
NewBeee_Java

Reputation:

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 .

Upvotes: 3

Views: 4886

Answers (5)

Samant
Samant

Reputation: 92

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

Upvotes: 0

Puspendu Banerjee
Puspendu Banerjee

Reputation: 2651

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

Upvotes: 0

Yogesh
Yogesh

Reputation: 1343

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.

Upvotes: 0

vnfedotov
vnfedotov

Reputation: 31

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

Upvotes: 0

Shervin Asgari
Shervin Asgari

Reputation: 24517

I use the serialized Java objects directly.

Upvotes: 1

Related Questions