Page 1 of 1

Web Services Transformer Error - Content is not allowed

Posted: Wed Oct 20, 2010 10:15 am
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?

Posted: Wed Oct 20, 2010 12:32 pm
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

Posted: Wed Oct 20, 2010 1:50 pm
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.

Posted: Wed Oct 20, 2010 2:02 pm
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

Posted: Fri Oct 22, 2010 7:48 am
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.

Posted: Fri Oct 22, 2010 8:06 am
by eostic
Cool! Congrats...