This discussion is archived
2 Replies Latest reply: Oct 22, 2008 6:41 AM by 843830 RSS

converting string xml to xsd format ?

843830 Newbie
Currently Being Moderated
Hi,

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?

suraj
  • 1. Re: converting string xml to xsd format ?
    843830 Newbie
    Currently Being Moderated
    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.
  • 2. Re: converting string xml to xsd format ?
    843830 Newbie
    Currently Being Moderated
    Hi!

    I do this operation in a application and I encapsulate the message in Base64. I recibe the message like a string in Base64 and decode this and I take the xml.