Page 1 of 1

Webservice call from datastage

Posted: Wed Nov 15, 2017 12:48 pm
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.

Posted: Wed Nov 15, 2017 1:11 pm
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

Posted: Wed Nov 15, 2017 2:04 pm
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

Posted: Fri Nov 17, 2017 9:12 am
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.

Posted: Mon Nov 20, 2017 10:48 am
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