Web Service Error -Content is not allowed in prolog

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Web Service Error -Content is not allowed in prolog

Post by srai »

Hi All,

I am in process of accessing web service-

My web service does kind of Echo operation means takes string as input and returns that as output.
It is working fine with Web service client stage when I hardcode the string parameter for one value in input column.

But same web service operation throws error as mentioned below.

My job design is like this-

Seqfile_source-Transformer-WST-Transformer-Seq File target

There are 3 rows (strings) in the source seq file.


WST_PING..Web_Services_Transformer_36: com.ascentialsoftware.wsclient.ServiceInvocationException: Service invocation exception: Content is not allowed in prolog.
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1602)
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1544)
at com.ascentialsoftware.wspack.Transformer.process(Transformer.java:104)
at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
at com.ascentialsoftware.jds.StageFactory.runTransformer(StageFactory.java:361)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.ascentialsoftware.wsclient.xml.TreeBuilder.xmlReaderToDom(TreeBuilder.java:325)
at com.ascentialsoftware.wsclient.InputRequest.buildRequestBodyDocument(InputRequest.java:922)
at com.ascentialsoftware.wsclient.WebService.callServiceInternal(WebService.java:1625)
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1591)
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1544)
at com.ascentialsoftware.wspack.Transformer.process(Transformer.java:104)
at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
at com.ascentialsoftware.jds.StageFactory.runTransformer(StageFactory.java:361)


Thanks in advance.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Question 1.... does it work successfully in an other testing tool..... many have been mentioned in the forum here, such as the Web Services Explorer in various Rational tools, ones that Oracle makes available, SOAPscope, and others.....

2 ....does the WSDL import without error?

3. can you share the wsdl?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Post by srai »

Hi Ernie

1) WSDL is working fine with other testing tool.
2) I could able to import WSDL without any error.
3) I am very sorry but sharing wsdl is not possible at this point of time.

But same wsdl is working fine with Web service client stage when I pass obly single value to input parameter and I could see the desired result in target seq file. Same when I am trying to implement using Web service transformer stage and passing Data thru source seq file which contains more than one record I am getting this error.

Thanks,
-Santosh Rai
eostic wrote:Question 1.... does it work successfully in an other testing tool..... many have been mentioned in the forum here, such as the Web Services Explorer in various Rational tools, ones that Oracle makes available, SOAPscope, and others.....

2 ....does the WSDL import without error?

3. can you share the wsdl?

Ernie
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Thanks for the extra detail...that helps....... although there should be little or no difference between the "run time" funcationality of the two. Remember how in the WS Client you supplied the input values via fixed property, or with Job Parameters? With the WSTransformer, you simply supply the same things on a per-row basis. The WSClient makes one single call, sending output at the start of the job.....where the WSTransformer does the exact same thing, but makes one single call for every incoming row.

Couple of things to check...

a) build a new simple test job for your WSTransformer. Maybe there's some stray meta data laying around messing you up.
b) always surround your WSTransformer with regular transformers...just as a safety check....an upstream xml stage of any kind could mess up your xpath.
c) did you load the input link via the "message" tab load button?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Post by srai »

Hi Erine,

Shall I pass input through XML file?

I am passing input via Seq file as I mentioned in discussion earlier.

Thanks
Santosh

eostic wrote:Thanks for the extra detail...that helps....... although there should be little or no difference between the "run time" funcationality of the two. Remember how in the WS Client you supplied the input values via fixed property, or with Job Parameters? With the WSTransformer, you simply supply the same things on a per-row basis. The WSClient makes one single call, sending output at the start of the job.....where the WSTransformer does the exact same thing, but makes one single call for every incoming row.

Couple of things to check...

a) build a new simple test job for your WSTransformer. Maybe there's some stray meta data laying around messing you up.
b) always surround your WSTransformer with regular transformers...just as a safety check....an upstream xml stage of any kind could mess up your xpath.
c) did you load the input link via the "message" tab load button?

Ernie
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Does the webservice need xml? Doesn't seem like it from what you've said so far.
-craig

"You can never have too many knives" -- Logan Nine Fingers
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Post by srai »

chulett wrote:Does the webservice need xml? Doesn't seem like it from what you've said so far. ...

Hi Ernine,

No webservices does not need input form XML.
I just wanted to confirm. I am passing input via seq file and trying to get responce in Seq file as well.

Not sure ...what to do? Same webservice is giving me proper responce when I am using WS Client stage and hardcoding parameter in input message. But same thing when I am trying with WS Transformer stage and passing input parameter via seq file not getting the output.

tks
rai
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Not getting the output while using the WS_Transformer stage, but did you get any error message?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Right...did the error now go away? Not getting data is an entirely different symptom.

Stilll...based on your saying that it works as WSClient is the most important thing of all......

Don't worry about "sending XML"....or what your source stage is...in fact, it can and should be anything....as I said in the other post, build a new job from scratch, surround your WSTransformer with regular Transformers..and then"load" each message (input and output) after seleting your web service (the little gear)......and for a test, just hard code the values you need in the Derivation on the upstream side. It is effectively the same thing as using the WSClient...

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Post by srai »

Thanks a lot Erine!!!

Now I could able to resolve this issue.
There was problem with the web service BUS itself which was some time running fine fine and some time not returing any responce.

Thanks a lot everyone ...this forum had helped me lot in solving this issue.
eostic wrote:Right...did the error now go away? Not getting data is an entirely different symptom.

Stilll...based on your saying that it works as WSClient is the most important thing of all......

Don't worry about "sending XML"....or what your source stage is...in fact, it can and should be anything....as I said in the other post, build a new job from scratch, surround your WSTransformer with regular Transformers..and then"load" each message (input and output) after seleting your web service (the little gear)......and for a test, just hard code the values you need in the Derivation on the upstream side. It is effectively the same thing as using the WSClient...

Ernie
Post Reply