D
DarthLuch
I'd like to get suggestions on best practice way to return a large
amount of xml data using a webservice function.
Here's what I do today:
Using java, I write a function that will return an array of some
object. I write the function to loop through the database, getting each
record, perform any needed manipulations on it, then add each modified
record to an array. At the end, I marshall the array to a string (using
Castor) and return the xml-representation of it. I then use Apache Axis
to expose the function as a web-service. I know this is not a
well-though design, but it is easy to program. So now the problem I'm
having is that I run out of memory... With a large amount of data it
will eventually crash once it reaches its breaking point of adding so
many items to the array. I also know that taking the entire object and
marshalling it to a string to be returned is probably not the best way
either. Any suggestions and pointers would be appreciated.
My clients will usually deploy to a Tomcat server, using the default
settings. I'm not sure if there's even a way to increase the memory
allotted to it, but I'm not sure that is the best way to proceed anyway.
amount of xml data using a webservice function.
Here's what I do today:
Using java, I write a function that will return an array of some
object. I write the function to loop through the database, getting each
record, perform any needed manipulations on it, then add each modified
record to an array. At the end, I marshall the array to a string (using
Castor) and return the xml-representation of it. I then use Apache Axis
to expose the function as a web-service. I know this is not a
well-though design, but it is easy to program. So now the problem I'm
having is that I run out of memory... With a large amount of data it
will eventually crash once it reaches its breaking point of adding so
many items to the array. I also know that taking the entire object and
marshalling it to a string to be returned is probably not the best way
either. Any suggestions and pointers would be appreciated.
My clients will usually deploy to a Tomcat server, using the default
settings. I'm not sure if there's even a way to increase the memory
allotted to it, but I'm not sure that is the best way to proceed anyway.