Access web service through DataStage

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
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Access web service through DataStage

Post by SURA »

Hi there,

I managed to Pass a request and get back the reply from a free Web Service using Datastage. This point is to make clear the Datastage is working fine!!

When I tried to import the Metadata from a Web Service which was created for my Organization I got the below error.

Code: Select all

The XML Schema that defines the message structure has syntax or semantic errors. For more details, proceed to a manual mapping using the XML Meta Data importer.

Then I cross checked the free public WDSL file and its structure with my Organization WDSL file and found a difference.

In the Public Free Web Service I can see the format is like Schema, Element and so on. When i imported the meta data it imported those schema details in to the Datastage!

Whereas when i check the details with my Organization one i was bit confused!

In the schema section instead of schema details, it provided a link to fetch. Then If i open that link it is asking me to go for some other link and so on ......

Code: Select all

<xsd:import schemaLocation="http://SERVERNAME.corp.XXXX.XXXX.XXXX.au:22/1.7/XYZService.svc?xsd=xsd0" namespace="http://SERVER.XXXX.XXXX.XXXX.au" /> 

In here xsd0 is up to xsd14
Now my question is,

1. Is it possible to access the above mentioned Web Services using Datastage?

2. Is it possible only, if the XML is having a clear and straight forward structure ?

How to handle this in Datastage ?

Any guidance please!
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try using a freeware client such as SOAPui to see (a) if you can access the web service from your DataStage machine, and (b) what the WSDL looks like.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

There are some bug fixes for the ASB pack in Fix pack 2 , are any of them relevant ?

JR43541
JR33738

Thanks
Ramesh
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

Ray

I installed SOAP. I will test it and get back to you.

Hi Ramesh

Thanks for sharing this info.

Let me check it and get back to you.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

Hi Ray

I can access that web service from the machine where the DS is installed.

I am not sure what to answer for the "WSDL looks like" !

For some reason at the time of REAL Development, ETL team fails to connect the Web Services. Then an exe was created to communicate this web services. Now the ETL will generate an input file for that exe and exe communicate with Web Services and get back the result.

Now I am trying to rid-out of that exe, so that DS can interact directly with that web services.

If i want to access a web service using Datastage, then how the wsdl file should look like?

Any specifications or format is there? For example Schema details must be in the file itself rather than point somewhere else etc etc.

Please guide me.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

When you do the Web Service Metadata Importer, you get to see what the "WSDL looks like" on the left part of the screen.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

There are various things that could be going on here.

1. the importer in the release that you are using might not be capable of handling the "import" or "include" statements. Usually that gives you a more fatal error, so that's probably not your issue, but it's possible.

2. the message to use the xml importer is saying that the xml "body" of the SOAP envelope is too complex. Right mouse on the Operation and you will see an option while inside the wsdl importer to invoke the XML metadata importer.

3. the tricky part is understanding how complex that XML is, and what you need to do to read that xml or to produce that xml. Have you done a lot yet with xml and datastage?

[there may be a good reason that the prior developers used a file --- they may not have had the experience with xml to integrate with this particular web service]

Quite often with services like this, the best thing to do is to invoke it via SOAPui, as noted by earlier posters, and then "capture" the xml from SOAPui for the request and for the response.

You also will want to do this from DataStage ....look carefully at the Web Services Transformer Stage....go to its "message" tab....find the pull down that says "user defined message". Set up your Job with one single large varchar column going into the Web Services Stage and one large one coming out. Upstream, paste the payload "as is" from a working SOAPui session into that column and choose that column as your user defined message. Downstream, just send the single large column to a sequential stage with zero formatting ("none" for quote character and delimiter) This gives you the prototype that proves that you are able to successfully make the call.

Then, in entirely separate Jobs and testing, learn how to write/build that xml for the request, and how to parse, and pull out details for the xml from the response.

...then, when you have that technique mastered, you can combine it for invocation of your service.

It's a lot of steps --- be patient and first spend time in SOAPui understanding everything you can about that web service and its needs.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

lstsaur wrote:When you do the Web Service Metadata Importer, you get to see what the "WSDL looks like" on the left part of the screen.
It seems good as like the other one (Test job as i mentioned in the first thread) i imported successfully. When i try to import the metadata, Input message meta data imported successfully, whereas i am getting the below error for output message.

Code: Select all

The xml schema that defines the message structure has syntax or semantic errors.
But i couldn't find any issues. This could be because i am not good in XML could be the reason. But i will spend time to find it!!
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

Hi Ernie

Thanks for your long and detailed notes. Let me go through with your guidance and get back to you.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

This is the other reason that it is ABSOLUTELY MANDATORY that you get yourself a testing tool to test THIS web service outside of DataStage. SOAPui and Actional's Soap tester are two free ones that a lot of people like, but there are others...

Use that tool to see if the service works, if it is available, if it has issues with xml structures, and ultimately to get access to a "working" sample payload.

Such a tool is also critical so that you can learn the behavior of the service, what it is expecting, etc. ---- talking directly with the owner/author of the service is helpful also.

Ernie
Ernie Ostic

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