How can i replace an XML element (Web Services Transformer)

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
srinivas2705
Participant
Posts: 3
Joined: Wed Sep 17, 2008 10:02 am

How can i replace an XML element (Web Services Transformer)

Post by srinivas2705 »

Hi,
I am developing a job which calls a web Service via the Web Services transformer. The Web Service gives an XML as an output Response. I am able to generate the response from the Web Service. Now i want to replace one of the elements in the XML which i have got and call another webService which stores it back into the database.
The Other Web Service mentioned above is also working fine. Instead of manually changing or using : sed command i want to check if we can use the Transformer for replacing the element.

Please respond in case you know how to do it.
Regards,

Srinivas Jalasuthram
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...just one? ...if it's not a HUGE xml document, I would just pass it into a Transformer and do it there... especially a BASIC Transformer. The BASIC Transformer is chock full of text functions that make pulling out a single string between delimieters (in this case, tags) fairly easy. You could also do a combination...XMLInput will mostly easily get you the single value of the element.....but for something like this I probably wouldn't bother with XMLOutput to write it back --- I'd just zap it with a selection of UV/Basic functions. Others in this forum can better suggest "which" functions to choose, but I know there are some good ones, like FIELD and others.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... or use a server job, which avoids the overheads of a parallel job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply