Page 1 of 1

Capture attribute from webservice response

Posted: Wed Mar 25, 2015 4:57 am
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

Posted: Wed Mar 25, 2015 11:30 am
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