DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
hobocamp



Group memberships:
Premium Members

Joined: 31 Aug 2006
Posts: 97

Points: 1033

Post Posted: Tue Apr 21, 2015 10:39 am Reply with quote    Back to top    

DataStage® Release: 8x
Job Type: Parallel
OS: Unix
I don't see anything that I can directly relate to this problem I'm encountering when using a Web Service Client stage - so here goes -

I'm trying to call a web service from a vendor, who supplied the wsdl definitions for the various services we need to call.

The wsdl for this particular service is only two nodes - one gets loaded with an xml payload, and the other with a string.

After I've imported the wsdl, the xpath definition for the second node type is text(). But the first node has a type of "*". Of course if you run the job with that value, it results in an "invalid token" error.

The only thing I've been able to get to work is to set the value to text(), like the second node. However, with that, DataStage interprets the xml payload with ;gt and ;lt, instead of left and right brackets. The end result is that the web service call fails.

I know that this is the cause of the failure, because if I run a trace on the job, capture the payload, convert the gt and lt values to left and right brackets, and run it in SoapUI, the call works perfectly.

(On the other hand, if I capture the data as is, and run it in SoapUI, I get the same error that I get in DataStage, which is "Object reference not set to an instance of an object".)

Has anyone run into something similar when call web services?

Thanks!
Tom
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3773

Points: 30298

Post Posted: Tue Apr 21, 2015 3:29 pm Reply with quote    Back to top    

I guess one question for starters is.....does it ever work in a soap testing tool? ...on the & escape characters, it's hard to say what is going on...but "maybe" the xml data element will h ...

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
hobocamp



Group memberships:
Premium Members

Joined: 31 Aug 2006
Posts: 97

Points: 1033

Post Posted: Tue Apr 21, 2015 6:30 pm Reply with quote    Back to top    

Hi Ernie - Thanks for your reply.

To answer your question - yep, it works perfectly in SoapUI, as long as I manually convert the &lt; and %gt; to brackets (<>) first. (If I paste the soap envelope as is into SoapUI, I get the same error that DataStage produces.)

I had also tried setting the Data Element value to XML at the column level, but so far that has produced the same results.
Rate this response:  
Not yet rated
JRodriguez



Group memberships:
Premium Members

Joined: 19 Nov 2005
Posts: 413
Location: New York City
Points: 4531

Post Posted: Tue Apr 21, 2015 10:22 pm Reply with quote    Back to top    

Hi Tom,
Recently I ran into a similar issue. In our case the web service payload was defined to generate the payload with a node string and that caused that the returned XML payload was xml escaped ( < --&lt and > --&gt). This depend entirely on the web service provider...

We ended up downloading the payload to disk and performing a global replace to fix the XML tags...and continue processing the XML

It looks like you are facing a similar web service weakly typed defined with anode string which always by definition will encode the XML payload

Good luck!!

_________________
Julio Rodriguez
ETL Developer by choice

"Sure we have lots of reasons for being rude - But no excuses
Rate this response:  
Not yet rated
hobocamp



Group memberships:
Premium Members

Joined: 31 Aug 2006
Posts: 97

Points: 1033

Post Posted: Tue Apr 21, 2015 11:57 pm Reply with quote    Back to top    

Hi Julio -

Thanks for your response. What a frustrating issue this has been.

Would you mind giving me a few more details, such as how you went about determining that it was caused by the service, and how your workaround worked?

Thanks so much.

Tom
Rate this response:  
Not yet rated
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3773

Points: 30298

Post Posted: Wed Apr 22, 2015 4:57 am Reply with quote    Back to top    

You can provide the input payload yourself...use the WSTransformer Stage instead of the WS Client Stage, and have a dummy Transformer or RowGen in front of it (or dummy read from a file/database...wha ...

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
hobocamp



Group memberships:
Premium Members

Joined: 31 Aug 2006
Posts: 97

Points: 1033

Post Posted: Wed Apr 22, 2015 5:51 am Reply with quote    Back to top    

Hi Ernie -

By "payload that works", I was referring to the soa envelope I copied from the Trace log of the DS job. I copied that to notepad, converted all of the escape characters back to brackets, and posted the entire thing into SoapUI. The service worked correctly in that case. Make sense?

Tom
Rate this response:  
Not yet rated
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3773

Points: 30298

Post Posted: Wed Apr 22, 2015 9:48 am Reply with quote    Back to top    

Either way, the solution I outlined above will do the trick. Manage the payload entirely on your own using the user-defined message methodology...... ...and then work separately on ways to build ...

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
hobocamp



Group memberships:
Premium Members

Joined: 31 Aug 2006
Posts: 97

Points: 1033

Post Posted: Wed Apr 22, 2015 10:03 am Reply with quote    Back to top    

Thanks Ernie.

Couple of questions just to clarify -

-When you mentioned adding the 'working' payload to a derivation (inside a dummy transformer I'm assuming), do you mean the entire soa envelope content? I'm assuming yes.

-Also, you mentioned the input and xml output stage. You also mentioned having an output from that stage. What is the target for that output?

Thanks again.

Tom
Rate this response:  
Not yet rated
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3773

Points: 30298

Post Posted: Wed Apr 22, 2015 3:18 pm Reply with quote    Back to top    

I haven't done it in awhile, but if memory serves correctly, you just need the whole <body>. A decade or so ago I asked engineering to give us a default Table definition for this purpose...if ...

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours