Capture attribute from webservice response
Posted: Wed Mar 25, 2015 4:57 am
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
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