Something's not making sense to me. Your client passes XML to a web
service that transforms that to complex objects, right? But then you
want to get that same xml back? Try to clarify your question a bit and
maybe I can help. Any which way though, why can't you just return
String for the xml, etc?
iksrazal
It does seem backwards doesn't it! :) Basically the web service is
wrapping a legacy component (vb component) that expects a string that
contains xml. Our development is phased in that Phase One is putting a
web service front end to this legacy code. Phase Two will rewrite the
legacy component in a java. We don't want to change the web service
interface once its published initially and we want a richer interface
than just asking for a string. So for the initial phase we want to
have the interface utilize java classes for the data coming in. At
first we'll turn around and extract the data into an string of xml and
pass it on to the legacy component. In the later phase we'll pass the
java objects. I hope this make sense? In a perfect world this
wouldn't occur, but... So my issue is finding out what is the easiest
way to get an xml representation of the data (preferably in the format
it was sent) once inside the logic of the webservice. I'm working with
both weblogic and axis to prototype this out and both handle the
population of the incoming xml into the java classes. I'm hoping to
find a way to do the reverse of this, if such an animal exists. I'm
also investigating options such as Castor to take the java classes and
serialize them to xml, although this option appears to require a
mapping step to get the data in the format that the legacy component
requires. Any help/suggestions would be appreciated.
iksrazal@terra.com.br - 15 Jun 2005 14:14 GMT
"I'm working with
both weblogic and axis to prototype this out and both handle the
population of the incoming xml into the java classes. "
OK, seemingly you just want to transform your xml String into objects,
and then pass those objects back to clients, other languages etc, is
that it?
One option is JAXB. That is well documented and has lots of users - I
use it alot. You do need an XML schema though. Once you are past that,
the trick would be to map those JAXB generated classes to WSDL. Now
that would be an interesting project. If that's the idea, you might
want to post to the users@jax-rpc.dev.java.net about it, as that's
pretty specialized. Maybe a wrapper/adapter, hmm....
HTH,
iksrazal
http://www.braziloutsource.com/