Reputation: 511
I had a response from a soap webservice and after I unmarshall the response I have an object hierarchy response similar to this:
products
result 1 price=12
collection_method_1
from=1 to=3
result 2 price=14
collection_method_1
from=1 to=3
result 3 price=15
collection_method_2
from=2 to=5
result 4 price=16
collection_method_2
from=1 to=5
result 5 price=17
collection_method_2
from=1 to=2
result 6 price=18
collection_method_2
from=1 to=4
result 7 price=19
collection_method_2
from=2 to=3
result 8 price=21
collection_method_2
from=3 to=4
result 9 price=22
collection_method_2
from=4 to=5
legend
locations
location 1 text=""
location 2 text=""
location 3 text=""
location 4 text=""
location 5 text=""
location 6 text=""
locations
collection_methods
collection_method_1 text=""
collection_method_2 text=""
collection_methods
legend
products
which is the best way in Java, JAXB ...(or any other technology) to given a location X from the legend that you want to delete from the response, delete all the results that have this location? Note that locations are referenced in the response with "from" and "to". Any suggestions?
thanks
regards
Upvotes: 0
Views: 149
Reputation:
With SOAP best way is to use some XSLT to convert the returned message to your required format.
Few more option 1: use JAXB convert the output to some collection and use that 2. Use SAX and not JAXB to if you want to discard huge data and only need to navigate to a piece of data.
Upvotes: 1