peakit
peakit

Reputation: 29359

Transforming SOAP WS output to an .xsd complaint XML in Java

I have a SOAP based Web Service which returns back an XML response. I need to convert this XML into another XML which should be compatible with a provided XSD file.

Is there any opensource Java framework which can help me in achieving this XML transformation per the XSD file? Will appreciate any help or pointers on this.

Thanks in advance!

Upvotes: 0

Views: 863

Answers (2)

Biju Kunjummen
Biju Kunjummen

Reputation: 49915

I have a recommendation, if you are more comfortable with java than xsd/xml:

Assume that your first soap response xml is compliant with first.xsd and the second one is second.xsd. Generate the java types for each using xjc, which comes with jdk1.6.

Now the exercise will be to simply convert instance of one type to other and serizalize.

Basically, First.xml -> First java Type -> Second Java Type -> Second.xml

If absolutely needed, you can even use the Dozer framework to convert across java bean types

Upvotes: 1

Oleg Pavliv
Oleg Pavliv

Reputation: 21162

XSL transformation is the standard way to tranform XML to XML. You can use xalan engine to do the transformation

Upvotes: 1

Related Questions