Capture attribute from webservice response

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
pnpmarques
Participant
Posts: 35
Joined: Wed Jun 15, 2005 9:27 am

Capture attribute from webservice response

Post by pnpmarques »

Hello everyone!
In my Web Services Transformer, after sending a request I am getting the following response:

<ns0:RetrieveTicketRS xmlns:ns0 = "http://company/CORPORATE/RetrieveTicketRS">
<ns0:Errors>
<ns0:Error Code = "310.PT" ShortText = "Not Found" Type = "F">401 - </ns0:Error>
</ns0:Errors>
</ns0:RetrieveTicketRS>

From the response I am capturing the output with the following xpath:
/ns0:RetrieveTicketRS/ns0:Errors/ns0:Error/text() -->"401 - "
/ns0:RetrieveTicketRS/ns0:Errors/ns0:Error/@ShortText -->"Not Found"

In DataStage version 8 this works fine, but after migrating this job to version 9.1 I can no longer capture attributes (those with @). This is what happens:
/ns0:RetrieveTicketRS/ns0:Errors/ns0:Error/text() -->"401 - "
/ns0:RetrieveTicketRS/ns0:Errors/ns0:Error/@ShortText --> empty

Has anyone experienced this? Known bug, workaround?

Thanks in advance!
Pedro
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Anything is possible, but that would be a blatantly horrible anomaly if it doesn't work in general......and I recall no problems that serious in 9.1....

I would check some additional things first....

a) check another simple test xml document...see if attributes are working for you at all.
b) send this snippet of xml to disk and look at it using a hex editor...make sure there aren't any bizarre characters in there where you are expecting spaces between the attributes
c) where is the repetition element...I suspect it is element "Error"....just something else to check.

Ernie
Ernie Ostic

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