I am trying to develop a server job using RTI's Job Control Web Service which exposes the DataStage Job Control API as a Web Service.
I can run my Java program to log into a specific DataStage server and project, retrieve all Jobs and display jobs' names on the console without any problem.
However, my server job is working fine execept the output format of the array returned by the Web Service in the seqential file is still in, <item>job1</item><item>job2</item><item>job3</item>...........
one long..long...xml string format.
How can I output the retruned array as following:
Job1
job2
job3
job..
job...
My server job is as follows:
Seqential_File_01--->WS_Trns_01--->Trnsform_01-->WS_Trns_07-->Sequential_File_09.
Any help is appreciated.
How to reformat array returned by Web Service
Craig,
I have tried that before by inserting an XML input stage before the target sequential file. Then, the output of the sequential file became like "job1job2job3job4job5...", one long string. The Xpath in the column description is "/ns1:GetAllJobNamesResponse/return/item/text()" (without double quotes).
In my Java program, the following code will handle the returned array:
String[] allJobs = jobControl.getAllJobNames (sessionID);
for (int i=0; i<allJobs.length; i++) {
System.out.println (" " + allJobs [i]);
}
and data will be displayed on the console as follows:
job1
job2
job3
job.....
I just don't know what's the XPath syntax should be used in the xml input stage to handle SOAP's data type of ArrayOf_soapenc_string. Any idea? Thanks.
I have tried that before by inserting an XML input stage before the target sequential file. Then, the output of the sequential file became like "job1job2job3job4job5...", one long string. The Xpath in the column description is "/ns1:GetAllJobNamesResponse/return/item/text()" (without double quotes).
In my Java program, the following code will handle the returned array:
String[] allJobs = jobControl.getAllJobNames (sessionID);
for (int i=0; i<allJobs.length; i++) {
System.out.println (" " + allJobs [i]);
}
and data will be displayed on the console as follows:
job1
job2
job3
job.....
I just don't know what's the XPath syntax should be used in the xml input stage to handle SOAP's data type of ArrayOf_soapenc_string. Any idea? Thanks.
What release are you using lstsaur?
If 7.5.x or earlier, what Craig is saying should work great. Just be sure first to use the "user defined message" for the output link of your Web Service Pack stage (just have a single column with a long varchar datatype and specify that in the pull down of the stage message tab)...
Capture the XML coming from your Web Services stage and also be sure that you are getting what you expect....it should be a perfectly formed SOAP body in XML format --- perhaps it's not.
If this is 8.x, that could be an issue also. There are some problems with partial xml strings in 8.0 where tags are being removed. That may be reflected also in the partial SOAP body delivery from the WSPack.
Ernie
If 7.5.x or earlier, what Craig is saying should work great. Just be sure first to use the "user defined message" for the output link of your Web Service Pack stage (just have a single column with a long varchar datatype and specify that in the pull down of the stage message tab)...
Capture the XML coming from your Web Services stage and also be sure that you are getting what you expect....it should be a perfectly formed SOAP body in XML format --- perhaps it's not.
If this is 8.x, that could be an issue also. There are some problems with partial xml strings in 8.0 where tags are being removed. That may be reflected also in the partial SOAP body delivery from the WSPack.
Ernie