how pass param to Webservice

Dedicated to DataStage and DataStage TX editions featuring IBM<sup>®</sup> Service-Oriented Architectures.

Moderators: chulett, rschirm

Post Reply
Pikty
Participant
Posts: 13
Joined: Mon Nov 12, 2012 8:32 am

how pass param to Webservice

Post by Pikty »

Hi there,

I'm facing a critical issue querying a Webservice. I'll try to describe as much as possible.

I'm working on Datastage v8.1 Server on Unix & DB2

1st/
I tried to load a WSDL file used by other departments with the Web Service Meta Data Importer tool without success. When I tried that the web methods were not visible, and when I tried to load the wsdl from my hard drive I received an error message regarding the namespace = ""

The workaround was to:
- create manually the webmethod in the WebServiceTransformer stage
- In the Output Message in the Output tab of the WSTransformerPX stage the Namespace information is empty. So I checked the User-Defined Message box and selected the newly created field soapResponse.
- specify the namespace in the XMLInput stage

Here is the stages of my 1st job calling a webservice with no input param: WebServiceTransformer stage -> XMLINPUT stage -> FileSequential stage

So calling a Web method which does not require any input param works fine for me.

2nd/ Now I would like to call another webmethod which requires couple of params (same webservice than above, meaning I can not load the WSDL file and have to add manually the details of the webmethod in the WebServiceTransformer stage

So I created the following job: DB2 stage (returns 3 fields [string]) -> Transformer stage -> WebServiceTransformer stage -> Peek stage

This time in the WSTRansformer stage I have an Input Message in the WSTransformer stage ! I can not check the User Definied Message box as it will pick up only 1 field coming from db2 !!

I'm running couple of tests, now I'm getting the following error:

ws_transformer,0: Failure during execution of operator logic.

APT_CombinedOperatorController,0: Fatal Error: Fatal: 0026`:`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)
... 4 more

Please could you help there
Thanks in advance
Pikty
Participant
Posts: 13
Joined: Mon Nov 12, 2012 8:32 am

Re: how pass param to Webservice

Post by Pikty »

All right - the solution of reading a xml file containing the soapRequest to consume the webservice is explained here

below the list of stages I'm using:
ExternalSource stage -> XML Input stage -> WSTransformer stage -> XML Input stage and a peed to check the result

http://www-01.ibm.com/support/docview.w ... wg21502464

see below a sample of the soapRequest XML file

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://..."
xmlns:web="http://...">
<soapenv:Header/>
<soapenv:Body>
<web:personnePhysiqueFinderFindPersIdf>
<!--Optional:-->
<personneFinderFindPersIdfWSRequest>
<!--Optional:-->
<criterionListeWSVO>
<!--Zero or more repetitions:-->
<criterionWSVOArray>
<!--Optional:-->
<criterionName>your param</criterionName>
<!--Optional:-->
<criterionValue>your param</criterionValue>
<!--Optional:-->
<operator>your param</operator>
</criterionWSVOArray>
</criterionListeWSVO>
</personneFinderFindPersIdfWSRequest>
</web:personnePhysiqueFinderFindPersIdf>
</soapenv:Body>
</soapenv:Envelope>
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...a strong recommendation for ANY reading of an xml document and something, for other readers of this thread, that is discussed throughout this forum....there is too great a chance that the sequential stage will react to things like CRLF's embedded in the document --- character sequences that from an xml standpoint, are just noise....but if the sequential stage sees them, will change what parts (or the overall formatting) of the xml document are sent downstream.

Glad you got it working!

Ernie
Ernie Ostic

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