XML Input stage - Workaround

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
skywayterrace
Participant
Posts: 7
Joined: Thu Aug 15, 2013 8:49 pm
Location: ny

XML Input stage - Workaround

Post by skywayterrace »

Hi,
I am using the XML Input stage to parse the XML Document.

issue : i am using the Web service msg _out defination to parse the XML using xml input stage.its complaining document structure is not matching properly.

Detail :
in the xml file..its <Env: ><Body>....</Body></env)
but in each colum xml defination points to report_Data/Report_Entry/id.tex()


If i change xm defination tag in env/body/ for each colum..then jobs works fines..challenge is ..we have xml defination of 280 columns..it cumbersome to change and modifying the defination is not method.

Can i define in the XPATH in the transformation setting in XML input stage?

Additional info : if use the XML Importer in Datastage to create a xml table defination and refered in XML input stage to parse the data.it works fine..

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

Post by eostic »

try the _OUT table definition instead of the msg_out definition.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
skywayterrace
Participant
Posts: 7
Joined: Thu Aug 15, 2013 8:49 pm
Location: ny

Post by skywayterrace »

eostic wrote:try the _OUT table definition instead of the msg_out definition. ...
Hi Eostic,
Thanks for the reply. I read your blog site for Webservice..its very helpful.

I am using the _out table definition( my apologize its not the msg_out).

issue is Table description in _out table and XML data received are not matching from definition perspective.

for example : xml data is
<?xml version="1.0" encoding="UTF-8" ?>
- <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Body>
- <Report_Data xmlns="xxx">
- <Report_Entry>
<W_ID>44</W_ID>
</Report_Entry>
</Report_Data>
</env:Body>
</env:Envelope>

but the column description at the column level for W_id is different in _out table.(note all _out and XML data types matches)...


due to these..we always import the XML data using xml importer to create xml defination and use it in XML Input stage to parse the data.I am trying to avoid doing above step.

How do i define Namespace in the transformation setting?

Appreciate your input.

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

Post by eostic »

Ok...no problem. One reason that the wsdl _out doesn't match is that the payload may have been too complex for the wsdl importer. If it wasn't too complex, you wouldn't even need to use the xml Stage -- the WSTransformer output link would have done all the parsing for you.

I will assume that you have only a single column on the output link for your WSTransformer or your WSClient....and passing that into your xmlInput Stage.

Try this when importing your wsdl....with your cursor on the operation you are interested in importing, right click and say "Import using XML Metadata Importer"....then the more complete (but likely more complex) soap response will be visible to you...proceed as normal with the xml metadata importer to select the elements and attributes that you want.

It's the same as you are doing now, but with one less step --- doing it at the same time as the wsdl import initially.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
skywayterrace
Participant
Posts: 7
Joined: Thu Aug 15, 2013 8:49 pm
Location: ny

Post by skywayterrace »

Hi Ernie,
Unfortunately i couldn't see the whole post.It was not complex xml file..

Attached the description in the field.W_ID.

/defns:Report_Data/defns:Report_Entry/defns:W_ID/text()

...

if i export the xml file using the xml imported ..i get the following..it matches with XML input.

/env:Envelope/env:Body/ws:Report_Data/ws:Report_Entry/wd:W_ID/text()



Thanks,
Post Reply