Web Services Transformer Error - Content is not allowed

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
Kingland
Premium Member
Premium Member
Posts: 4
Joined: Wed Oct 20, 2010 8:55 am

Web Services Transformer Error - Content is not allowed

Post by Kingland »

I need to access a Web Service thru a web services transformer stage. The Web Service requires a Header that includes userid and password. I was successful in connecting to the Web Service outside of DS as well as thru the Web Service Client Stage and hardcoding the input. I want to be able to have a job like

SF Input --> Transformer1 --> Web Services Transformer --> Transformer2 --> SF Output

Input file consists of a list of ID numbers. Transformer1 adds a column for the Header to each incoming record. The Header is set up as a VarBinary and in the Derivation I have this

("<AuthHeader xmlns=":'"':"EFXDMWS":'"':"><Username>user</Username><Password>pswd</Password></AuthHeader>")

In the Web Service transformer I have not checked the Authentication Required on the Security tab. On the Input tab under Input Header I have checked the User-Defined Header option and choosen the appropriate column from the drop down.
When I run this job I get this error "Content is not allowed in prolog". any suggestions on what to change?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

....I often take the same dev/debugging approach as you, and test with WSClient and hard coding. Step two would then be to use the exact same hard coded header with a WSTransformer, before going on with something more dynamic. Have you cut/pasted the exact hard coded header from the job that works into the Derivation of the job that fails (instead of building it)? Then at least you might be able to determine where the differences are....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Kingland
Premium Member
Premium Member
Posts: 4
Joined: Wed Oct 20, 2010 8:55 am

Post by Kingland »

I took the Value from my Header Input Argument in the WSClient and pasted it as a String into the header column derivation in Transformer1 of my job. The value I posted is the result I got. I am not sure how else to code the value.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Sort of....it looks like you are building the header, adding the first element and the concatenation of the string as part of your derivation.

It's only a subtle difference, but I would imagine that you have the "whole header" in your working WSClient Job.

Copy that "as is" into the derivation. Just have '***string from your other Job ***' in the Derivation. No concatenation....and just for safety sake, make the datatype char or varchar.

Also...also try this all in a Server Job, in case its a datatype issue of some kind.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Kingland
Premium Member
Premium Member
Posts: 4
Joined: Wed Oct 20, 2010 8:55 am

Post by Kingland »

I took the header from the WSClient Job and pasted into the derivation between two single quotes and made the datatype VarChar. Still did not work. So then I surrounded that header with Soap:Header tags. Did not work. So removed them. Works! :D Crazy. I must have had something in the header string that I deleted when I removed the additional tags.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Cool! Congrats...
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply