Webservice call from datastage

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
sandhya.budhi
Premium Member
Premium Member
Posts: 18
Joined: Wed Nov 15, 2017 10:50 am

Webservice call from datastage

Post by sandhya.budhi »

Hi,

I am looking for some guidance to invoke a JSON web service call using WST stage. The existing DS job calls an XML web service (SOAP) to push items onto the SharePoint hosted queue. The Job has to be modified to invoke the new JSON call and pushes the data to Azure cloud. Any examples I can refer to see how JSON calls were made from WST stage.
Thanks,
Sandhya
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

You will need to learn how to use the Hierarchical Stage, which was updated around the 11.3 time frame to support REST calls using JSON and XML payloads.

Short of that, if you are on an older release with out REST support within the Hierarchical Stage (former XML Stage), you would need to write your own class and use the Java Integration Stage (or Java Client/JavaTransformer if in a really old release).

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
sandhya.budhi
Premium Member
Premium Member
Posts: 18
Joined: Wed Nov 15, 2017 10:50 am

Post by sandhya.budhi »

Hi eostic,

The datastage version is 11.3 and I think REST is supported in the Hierarchical stage. I will try using it. Thanks
Thanks,
Sandhya
sandhya.budhi
Premium Member
Premium Member
Posts: 18
Joined: Wed Nov 15, 2017 10:50 am

Post by sandhya.budhi »

I am using Hierarchical stage for create REST calls using JSON payload. I need to create a JSON file before doing a REST call. In the Hierarchical stage we have JSON composer which creates the JSON file. My data is not in XML format to feed in JSON composer. The data is stored in the dataset. Do I need to create the XML file before sending the data to the JSON composer or I can use dataset for creating the JSON file. Most of the examples I have seen used XML file as input to the JSON composer. Please help.
Thanks,
Sandhya
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

It's the same as for XML, but the nice thing is, you don't need any kind of schema. Just get a sample json document and "import it" via the Library Manager. Then you will feed in your normal data (not xml) from your input links, and use the JSON Composer Step to build the nodes as needed.......you still have to learn how lists work, and how to perform re-groups for nested lists, etc., but the process/approach/logic is the same as what you would use for XML. Search the forum -- there are lots of posts on creating xml, and probably some on JSON also......reach out in the forum if you get stuck.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply