*
The moose likes Web Services and the fly likes How to order the elements in soap message? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to order the elements in soap message?" Watch "How to order the elements in soap message?" New topic
Author

How to order the elements in soap message?

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
I am having a web service provider on AXIS1.3 and when am sending below response to the consumer:



But instead of above soap message I want to send below and want to order the elements.




Is there any tweaking reqired in the generated AXIS server-config.wsdd file. Please suggest.


RR Kumaran
SCJP 1.4
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2053
Hello, how do you generate the xml currently? Using saaj?
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
I am using Java2WSDL and deployed my service using server-config.wsdd and Axis generated SOAP message for me while sending the web service response.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2053
If you are open to changing the wsdl, and possibly the java items involved (complex return object or helper class/interface) that you use, you can change the wsdl accordingly (to the order of the xml items you prefer), and use wsdl2java to generate the interface.
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
I am following bottom up approach for developing and deploying my web service using AXIS. I first hava POJO that needs to be exposed as web service and then I did java2wsdl and then I have created the server-config.wsdd and deployed the service and generated finally the wsdl. If I change wsdl then it is not going effect the way I send the *response* soap message and chaging the wsdl will effect the client and the way he sends his *request* soap message since client side stubs will determine the request soap message which are generated from wsdl.

Please correct me if my understanding is wrong.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2053
That is correct.

I havent tried, but, have you tried rearranging the variables in your return object?...just in case the xml elements gets rearranged too
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
yep, I dont want to rearrange the elements in an return object but want to rearrange the return objects themselves...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to order the elements in soap message?