Page 1 of 1

Webservice Transformer XML output

Posted: Wed Oct 15, 2008 2:28 pm
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

Posted: Wed Oct 15, 2008 2:38 pm
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.

Posted: Wed Oct 15, 2008 2:43 pm
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

Posted: Wed Oct 15, 2008 2:50 pm
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.

Posted: Wed Oct 15, 2008 4:01 pm
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?

Posted: Wed Oct 15, 2008 5:34 pm
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

Posted: Wed Oct 15, 2008 5:40 pm
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

Posted: Wed Oct 15, 2008 10:09 pm
by lstsaur
Add namespace's prefix "ns1:" in front of the "calculateAttributes_OUT.calculateAttributesReturn".

Posted: Thu Oct 16, 2008 9:16 am
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

Posted: Tue Oct 21, 2008 3:04 pm
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

Posted: Tue Oct 21, 2008 3:06 pm
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

Posted: Tue Oct 21, 2008 3:08 pm
by ray.wurlod
Can you please inform us how you changed the encoding style to get this to work?

Posted: Thu Jul 18, 2013 11:08 am
by MrBlack
I too would like to know how you resolved the issue. Changing the encoding style? Where? How? to What?

Posted: Mon Jul 22, 2013 4:47 pm
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.