Webservice Transformer XML output

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
efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Webservice Transformer XML output

Post by efxuser »

Hi,

Currently facing a problem with Webservice Transformer Stage, It is suppose to take an ID as input, call the Webservice, and get the response back in an XML format, However the output XML seems to be weird when checked by a peek stage. This, in turn is not parsed by the XML input stage and gives no output from it. Pls help
The peek stage o/p is as under:

Peek_12,0: calculateAttributesReturn:<?xml version="1.0" encoding="UTF-8"?>
<ns1:calculateAttributesResponse xmlns:ns1="http://analytics.ic.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encodin ... utesReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?>
<attributes><attribute><name>Number of Bs</name><value>10</value><id>1</id></attribute><attribute><name>Number of Ts</name><value>25</value><id>1</id></attribute></attributes></calculateAttributesReturn></ns1:calculateAttributesResponse>

Thanks,
- efxuser
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmm... try setting the Data Element in the XML Transformer to "XML" to keep it from translating things like that, see if that helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Post by efxuser »

Hi Craig,
Thanks for your reply.
I already tried that option, it results in the same output as mentioned above, Also tried with String as Data element. Is their any limitatino with Webservice Transformer stage that it gives this distorted XML or some property that I am missing !!

-efxuser
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm not aware of any limitations or settings that would affect this, but I haven't done all that much with that particular stage. Need to see what someone like Ernie has to say when he gets a chance to stop by.
-craig

"You can never have too many knives" -- Logan Nine Fingers
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

On your Web_Services_Tranformer stage, did you populate all the Namesapce Information for both Input Message and Output Message. Also, on Output-->Columns-->Description, did you have something like "ns1:calculateAttributesReturn/text()" in there?
efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Post by efxuser »

Yes.. I have populated the Namespace Information for both Input Message and Output Message.And also on Output-->Columns-->Derivation, I have "calculateAttributes_OUT.calculateAttributesReturn"..

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

Post by eostic »

Hi all...

It looks like this is a service sending xml inside of xml...meaning, that the web service is designed to send back a big string --- and that "string" just happens to have XML in it. On the wire, that means that it will be XML inside of XML, and thus the xml content is automatically "escaped" (that's what all the &gt and &lt stuff is). The question is, why isn't it getting "un-escaped" by the SOAP engine on the receiving side.......

Just for kicks, what happens if you delete everything on the output link of the WSTransformer and replace it with a single column: myOutput, with longvarchar and length of say...99999, and nothing but a single '/' in the Description?

And second, what do you see with this service using an external testing tool, such as SOAPscope?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Add namespace's prefix "ns1:" in front of the "calculateAttributes_OUT.calculateAttributesReturn".
efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Post by efxuser »

Hi,
Thanks for giving a shot at this.
I tried with My output column option and the Job returned the same o/p, which is as under:

Peek_12,0: My_op:<ns1:calculateAttributesResponse xmlns:ns1="http://analytics.ic.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encodin ... utesReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?>
<attributes><attribute><name>Number of Bs</name><value>10</value><id>1</id></attribute><attribute><name>Number of Ts</name><value>25</value><id>1</id></attribute></attributes></calculateAttributesReturn></ns1:calculateAttributesResponse>

Also I tried with the option of adding "ns1:" in front of the "calculateAttributesReturn" with the same result. Is it the xml structure in webservice output not adhering to the standards that DataStage is looking for?
The systemout log of webservice gives the foll:

[10/13/08 13:52:04:189 EDT] 00000062 SystemOut O transactionId: 000010000006880000.
[10/13/08 13:52:04:189 EDT] 00000062 SystemOut O productName: WirelessPlan
[10/13/08 13:52:04:190 EDT] 00000062 SystemOut O --------------returning xml begin----------------
[10/13/08 13:52:04:190 EDT] 00000062 SystemOut O <?xml version="1.0" encoding="UTF-8"?>
<attributes><attribute><name>Number of Bs</name><value>10</value><id>1</id></attribute><attribute><name>Number of Ts</name><value>25</value><id>1</id></attribute></attributes>
[10/13/08 13:52:04:190 EDT] 00000062 SystemOut O --------------returning xml end---


Let me know if any of you experts find some hint as to where I troubleshoot more.
~efxuser
efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Post by efxuser »

Thanks everyone for spending time on this,
The problem is resolved now, It seemed the problem with the way Webservice was configured. Onc ewe changed the encoding style, It started working.
-efxuser
efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Post by efxuser »

Thanks everyone for spending time on this,
The problem is resolved now, It seemed the problem with the way Webservice was configured. Onc ewe changed the encoding style, It started working.
-efxuser
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please inform us how you changed the encoding style to get this to work?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

Post by MrBlack »

I too would like to know how you resolved the issue. Changing the encoding style? Where? How? to What?
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

Me thinks the 'encoding style' was changed in the WSDL definition or the Web service operation defn , may not have been a datastage change.
Post Reply