What are the ways to achieve XML to XML transformation in webmethods?

What product/components do you use and which version/fix level?

I am using a free trial version of webmethods .

I am trying to achieve XML to XML transformation . I see that XSLT is the only way available in webmethods to transform XML . Apart from that CUSTOM MADE JAVA SERVICE can do this job .

Are there any more ways to achieve XML to XML transformation in webmethods?

Yes, via a nice friendly mapping service.
Remember xml is very easy to map to a webMethods Document and vice a versa.

First create webMethods document types for for XML files, use the schema if available.
Then develop a service to

1,. call xmlStringToXmlNode
2. call xmlNodeToDocument → Map output to an instance of your first wm document type/
3. Map using map steps, loops, transformers etc. etc. to your required document, by adding your target document type to the pipeline output.
4. Call documenToXmlString with your target document as input and hey presto.

Honestly, this is much nicer than XSLT and the visual notation much easier to maintain and really this type of mapping is what webMethods was designed for.

In a real world scenario step(3) should be a separate mapping service, because it allows you to reuse it and makes your code easier to maintain.

regards,
John.

1 Like

The steps @John_Carter4 are the way to go. XSLT is not only NOT the only way to transform XML but I would suggest you don’t use it in Integration Server at all unless there is a very compelling reason to do so. I think we’ve used it once and that was because there was a new person that was relatively inexperienced with wM but knew XSLT. :slight_smile:

Much like various threads you’ll encounter in this forum of “don’t write it in Java”, I would provide the general guideline “don’t use XSLT”. :slight_smile:

1 Like