my web service receives a xml as an input in string format.
it is passed to other web services for processing purpose.
during execution of each web service, I need to extract some node values multiple times which causes performance overhead.
can I convert the input xml (as string) into xsd structure (similar to OTD) so that I can simply map it while passing it to other web services? it should save me unnecessary extraction of same nodes in other web services.
how to do it?
is there any better approach for this?
Within the JBI environment, the XML message is typically passed around as a DOM Document (wrapped as a TRAX DOMSource), so the document is parsed only once. This should be very quick, even when evaluating XPath functions to find parts of the document repeatedly. DOM and OTD aren't that dissimilar, so you should be comfortable with it.
When sending the XML message "across the wire", you are forced to serialize to XML again. This is the foundation of interoperability and loose coupling.
Sometimes converting the XML to a more convenient form (different schema) can help make it easier/quicker to run queries against.