Calling several web services in one job

Dedicated to DataStage and DataStage TX editions featuring IBM<sup>®</sup> Service-Oriented Architectures.

Moderators: chulett, rschirm

Post Reply
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Calling several web services in one job

Post by kduke »

I have to read from several web services in a row. In my test I have to get a session id and then use that in the next call. I need to add one column to the session id with a hard coded value.

Code: Select all

RowGen => WebServiceTransform1 => WebServiceTransform2 => XmlOut
Simple job but debugging these seems difficult. I would like to see exactly what gets sent to WebServiceTransform2. The only thing I found to work was a copy stage then XML output. It seems to not like normal transforms or even peek stages.

Code: Select all

RowGen => WebServTrans1 => 
                             CpStg => WebServTrans2 => XmlOut
                                   => XmlOut

There is derivation on the web services columns out. Not sure what is allowable in it because when I used a hard coded value it was null downstream. Also not sure what is expected in Xml transform stage. When I added the column there the job aborted without any messages.
Mamu Kim
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

You need to add a Transformer stage between ws_tranformer_1 and ws_transformer_2. In Transformer stage, set the value for the added column and then pass returned sessionID + added column (name) to ws_transformer_2. In ws_transformer_2 under the Input tab you should have something like for example:
/ns1:GetJobName/sessionId[@xsi:type="xsd:string"]/text(),
/ns1:GetJobName/name[@xsi:type="xsd:string"]/text(). Make sure they correspond to WSDL's PortType operations.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Thanks. It does seem to be working now. I think the issue is on the client side now.
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

We are still not getting back results expected from the second web service call. Is there a way to turn on tracing or logging so we can see every XML message sent and received? What other way to prove you are sending the exact XML needed for this service is there?

We thought about creating the same web service on our end so we could loop back onto ourselves and dump the XML sent. That way we know for sure what the XML sent was. Otherwise there is no way to prove if a problem is on your end or the other end of the call.

I think if this is not in the product it needs to be added.
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

It appears from another post that the trace function worked in older versions of DataStage. I hope we can get a patch to put it back into 8.1.
Mamu Kim
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

It (tracing) works in 8.1 FP1, and lets you ultimately see the SOAP envelopes being sent out...and coming back in.....

You certainly did the right thing with lsatur's suggestion, to separate the WSTransformers....there is too much activity based on the Description property to not have something in between....

Test them separately....Use a test job with the first WSTransformer that just has a single "/" in a single large column on the output link (change the column list AFTER you load the Web Service and the Message Tab that populates the output column list)....send it to a sequential file.....that will save your "session code" that you can pass in another separate Job to test the second WS call.....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Trace in 8.1 does not show the XML sent or received. I hope they fix that.

The description field needs to be blank in our case because the used namespace at the field level. So we had to build the full value in the trasnform. So field needs to be

Code: Select all

<tag> ns='namespace' <field tag>field value</field tag></tag>
A lot more complex than I thought. The session also had namespace so it looked like:

Code: Select all

"<Session xmlns='urn:soap.whoever.com'> <SessionId>":GotSessionId.SessionId:"</SessionId> </Session>"
The SessionId had to be in header so it had to be UserDefined and so did the previous field.
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

UserDefined header is different than UserDefined column.
Mamu Kim
Post Reply