Hello Folks, I'd like to borrow your brains for a moment. I am working with soap web service. I'm constructing my own request message (user message) but DataStage keeps adding its tags (Envelope and body) to it making the request unreadable by the web service. Any ideas on how to stop it?
please provide some further details......for clarification, are you using Server or EE, Web Services Transformer or Web Services Client.....and on the input message tab, did you explicitly select "user defined message" and choose a specific column?
Yeah, I have server job, and I am using the webservice transformer stage.
The job is quite simple:
Text file ------>WBS transformer stage -----> text file
That message I picked up from the logs. My issue is that datastage is adding tags to my message and I want supress that. I am doing this because I was getting errors from the datastage (java null pointer exception) when allowing it to compose the envelope message so I decided to compose my soap requests manually as it seems to be the better way to handle it according some past posts.
A bad fishing day is much better than a great day at work
I had to dig up an old project and check out a scenario where I did this for an "array" based Web Service. Sure enough, the xpath in the xmlOutput Stage prior to the WSTransformer handles everything "up to" and including the element that is "inside" of Body.......
So....assuming that you are using xmlOutput, try just removing the /Envelope/Body parts of the xpath in the input link of that Stage.
...was looking at the Job and realized that it was one that I posted in my blog a long time ago. Go to this url and then download the two files (right click and "Save Link As...") ...then rename them...one is a .dsx and the other is the .wsdl
The service is not public, but the annotations in the Job explain what is going on, and you'll see in the xmlOutput Stage input link how Body and Envelope are not crafted prior to the WSTransformer.
Ernie, the envelope comes from a text file in a column and goes straight into the webservice transformer. As I am using "user defined message", I believe datastage should send the envelope "as is" to the webservice but it's not. It's wrapping up my envelope with additional tags. If you look at the soap envelope I posted, you'll see it has added the "Envelope" and "Body" clauses which I already have in my original envelope.
A bad fishing day is much better than a great day at work
Exactly. It is going to put on the Envelope and Body tags....so you need to remove them. Use an xmlInput Stage and just parse out the main element that you need....which looks like it is road:GenerateRoadCrashListForPeriod.....
Should be a one liner in the output link of an xmlInput Stage somewhere upstream.....
One large column on the output link called "mybody" and in the xpath, something like /Envelope/Body/GenerateRoadCrashListForPeriod/ ...with the correct namespaces, of course, and namespaces also loaded into the namespace property.
Import your xml via the xml metadata importer, or you could do this easily by hand if you 've done it before.
Your soap envelope is itself just an "xml document". So it can be parsed just like any other.
Play separately with the xmlInput Stage in another Job. Very likely, you are putting the xml document into a single large column? You'll have to spend some time learning the xmlInput Stage, but here are the basics:
a) use import...table definitions...xml table definitions..... and open up ONE ROW (copy a single row to its own file) of your input envelopes. You will see a tree....
b) expand that entire tree...there will be lots of check boxes...at various levels. You aren't doing any deep parsing here, so you should only need to check the highest level box, under Envelope and under Body, for the "crashes" element that you need. Notice what happens at the bottom of the page when you check it. You will get a single column....
c) At the bottom there, make it a KEY. Also --- make note of the "xpath" syntax on the right hand side... (the slashes and element names...).
d) Save the tabledef and return to DS
e) feed the rows into an xmlInput Stage from your text file.
f) declare that your incoming column is "xml content" (not url).
g) "load" the new tabledef to the output link
h) also "load" the new tabledef to the transformation "namespace" properties box.
i) send the output link to a sequential file. Use "none" for the delimiter and quote character or 000 for both if this is a Server Job.
j) compile and run the job.
You should see the inner "guts" of that SOAP envelope...now you have a "clean" xml chunk to send into the WSTransformer.