Bad Request Error when calling a Web Service through WST

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

Moderators: chulett, rschirm

Post Reply
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Bad Request Error when calling a Web Service through WST

Post by Amit_111 »

I need to call a Web Service which is a simple Request Response Synchronous Web Service.

I am not able to import the Web service metadata though the importer as it is giving me the error mentioned in below link:
http://www-01.ibm.com/support/docview.w ... wg1JR41390

We are yet to install the FP1 so inserting the metadata manually.

I have inserted the WSDL elements in the "Advanced" section on Stage Tab.
I have inserted an 'input' column in Input Tab and a 'result' column on Output Tab.

I have not inserted anything in Input Message and Output Message Tabs.

When I execute the DataStage Job, I get the below error:

Web_Services_Transformer_19,0: Fatal Error: Fatal: 0026`:`com.ascentialsoftware.wsclient.ServiceInvocationException: Service invocation exception: <ns1:Fault xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:HTTP</faultcode>
<faultstring>(400)Bad Request</faultstring>
<detail>
<string>return code: 400
<HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>
Bad Request</H1><PRE>Error parsing envelope: &#40;3, 35&#41;
Expected name instead of =.</PRE></BODY></HTML></string>
</detail>
</ns1:Fault>
at com.ascentialsoftware.wsclient.OperationCall.handleRemoteException(OperationCall.java:369)
at com.ascentialsoftware.wsclient.OperationCall.invoke(OperationCall.java:274)
at com.ascentialsoftware.wsclient.WebService.callServiceInternal(WebService.java:1685)
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:105)
at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
at com.ascentialsoftware.jds.StageFactory.runTransformer(StageFactory.java:361)


I can understand that Web Service is not able to read the input which I am passing but I am not able to get why the Web Service is not able to read the input as it is a simple Column passed as input.

Any help is greatly appreciated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I too have had problems importing WSDL that had namespace labels in the lowest level elements. Replacing these with actual namespace URLs (suggested by Ernie Ostic) allowed the WSDLs to be imported.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

Thnaks Ray !!

I tried changing the Namespace labels with actual links in the Description section for the "Input" column in "Input-->Columns" Tab.

Accordingly I changed the description from

/ns1:HelloWorldSynchronousRequestReplyWSProcessRequest/ns1:input/text()

to

/http://xmlns.oracle.com/HelloWorldSynch ... input/text()

But now I am getting an Incorrect XPath error.

Please let me know incase I am going in a right direction as per your suggestions or correct me incase I am further complicating the things.

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

Post by eostic »

...it's been awhile since we did it, but I think Ray and I actually made edits to the WSDL itself prior to importing it....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Ernie's recollection is correct. I'm no longer at that site so will have to dig through my notes to post more. It'll be a couple of days before I can do that - I'm at a UniVerse conference at the moment.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

Thanks Ernie and Ray for your reply !!!

I will keep trying from my side till it gets resolved or we get the patch installed.

Meanwhile, please reply at your convenience
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

I tried to analyze this further and I observed that the import namespace declared in WSDL i.e. http://xmlns.oracle.com/HelloWorldSynch ... estReplyWS is not accessible from IE.

I contacted the person who created the WSDL and he said that this Webservice is working fine and has been called many times from other tools.

I checked few Webservices from internet and their WSDL's. I was able to access their target namespace and import namespace details from IE.

I still think the problem is that DataStage is somehow not able to access this schema Location due to which it is throwing the Bad Request Error.

Please let me know if my understanding is correct so that I can take this further in that direction.
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

Further updates from my side:

I started with a parallel job to invoke the web service but after reading few posts here, I found that we have an option to trace the logs in Server Job.

I created a Server Job and looking at the logs I found that I had declared few extra Namespces in "Input Namespace" tab due to which the Input XML created by DataStage was not in the same format as expected by the Web Service.

So i kept only those required namespaces and the Server Job worked fine with the expected output from the Web Service.

Now, I tried to repeat exactly the same options in the Parallel job and tried calling the same Web Service through Parallel Job with same set of Name Spaces declared.

Here, I am still getting the "Bad Request Error".

I am not able to get why I am able to call a Web Service thorugh Server Job but when I try calling the Same Web service through a Parallel Job with same set of Options and Namespaces declared, its not working and giving me a Bad Request Error.

Please let me know incase anyone has any information regarding the same.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

We ended up using a packet sniffer (WireShark) to see what was actually being transmitted/received.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

Thank you Ray !!

Right now installing this software is restricted so will check with my Admin guys if they can do something.

Meanwhile, from DataStage perspective I am curious to know why a DataStage Server Job is sending an XML request to a web service in a different format when compared to that of a DataStage Parallel job when they both are having exactly same set of options selected in them?

And if it is sending XML requests differently and then what is it that is different?

It will be a great learning if i can get the answers for these questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Even better if you share the answers you discover!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply