REST? WSDL? WADL?

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

Moderators: chulett, rschirm

william.wang_GMA
Premium Member
Premium Member
Posts: 21
Joined: Thu Mar 07, 2013 10:11 am

REST? WSDL? WADL?

Post by william.wang_GMA »

Hi
I have used ISD to publish WebService using SOAP over HTTP binding.
Then I can use the WSDL to give to the client (DataStage, .net Console app). ISD gives me the address of the WSDL. Everythin works fine.

Now I try to bind it using REST, Format=XML, HTTP Action=GET, Parameter Type=URLQUERY. I don't really know what these means; they are just default options.

When i go to create the client, how do I indicate the REST webservice? With SOAP over HTTP i can get WSDL to use in the client. What do you do with REST?

I've hear about WADL, but how do you get there from WSDL?

Where can i find more doc/tutorial for REST web services?

Very new to this REST stuff.
Thanks
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

These are the only links I'm aware of that even mention REST - though Ernie ("Mr. Real-time!") may know of better ones.

Developing a Web 2.0 application using the InfoSphere Business Glossary REST API
https://www.ibm.com/developerworks/data ... phererest/

Light overview of JSON / REST
https://namitkabra.wordpress.com/2013/0 ... on-vs-xml/

Parsing JSON data (somewhat related), Youtube - audio only
http://www.youtube.com/watch?v=LLttdYs4UyQ

Speaking of Ernie - his blog, which has some great real-time articles:
http://dsrealtime.wordpress.com/
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Hi...

There is lots of material on REST out on the web...do some searching and you will find out more about it. From our perspective as users of this forum and specialists on Information Server, REST is really "just another protocol" for moving data around and for having applications "talk" to each other.

Largely, you'll find that REST is an alternative to "SOAP". There are millions of debates --- "SOAP is too heavy and too complex"....and REST is "not standardized and not rigid enough".......etc. etc. etc. Whatever. All of us here don't usually get the opportunity to choose one or the other...we just have to "deal" with what is handed to us.

REST is attractive from one point of view --- it is super easy to test. It uses all HTTP based verbiage for the action you are taking (things like GET, PUT, POST).......and just about everyone has a very simple processor for "GET" on their desktop ---- their browser! So you don't need to learn java, or have a SOAP processor, or SOAPui or anything else for testing the most simple REST services [not so easy for the other verbs, unless you have a proper testing tool].

If you have a REST service, such as this one from an ISD application, just find out the URL for it's "GET" functionality (a typical simple REST service just returns a bunch of rows within xml):

http://my.info.server:9080/wisd-rest/my ... yoperation
(not a real service, but what a simple REST URL might look like).

Issuing that will dump a whole lot of xml into my browser page. Not that useful. Zero metadata. I still have to save that xml and get the metadata from it, or find someone with an xsd that describes it....and then use that metadata and/or xsd in the xmlInput Stage or the xmlStage.

REST can optionally send back JSON (Java Script Object Notation), which is less verbose than xml.

To do REST today, you need to run the REST call at the command line using CURL or something else, or use Java and JavaPack and send the resulting xml or json downstream on a link. Since 9.1, the xml Stage is able to parse JSON in addition to REST.

In the not-too-distant future, the xml Stage is getting a REST step, which will allow the actual HTTP calls to be made within a Stage.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
william.wang_GMA
Premium Member
Premium Member
Posts: 21
Joined: Thu Mar 07, 2013 10:11 am

Post by william.wang_GMA »

Yea, It's kind of hard to find.

We were able to find tutorial for how to build a SOAP-based web service using DataStage and Service Directory. We were able to create Type 1, 2, 3 jobs, clients ...

But I just can't find any tutorials on how to create REST webservices/clients. There are some docs on JAX-RS (Java REST Service). Look like it's only doable using Java code, and not DataStage code.

When you deploy a DataStage job in Service Directory you can specify "SOAP over HTTP", REST, REST 2.0. So it is doable somehow.

With SOAP we have WSDL, and a client app just imports it and generates all needed classes/proxy, and we just call it. But with REST I am totally at a lost at this time.

Just have to keep digging. Eventually it turns up, I hope ;)


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

Post by eostic »

You aren't saying what your objective is....is it:

a) you have been asked to invoke a REST based service "somewhere else" and pull data back from that service into a DataStage Job?

b) you have been asked to BUILD a REST based service for Java or other such clients "somewhere else" and have questions on how to do that with ISD.

c) you are trying to just learn more about REST.

d) other?

Let us know and we can answer you better. There are literally thousands of "general" resources on the web for "what is REST" and why is it different from SOAP and "which one is better", etc.

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 »

Isn't WADL a description of duck locomotion on land? :lol:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
william.wang_GMA
Premium Member
Premium Member
Posts: 21
Joined: Thu Mar 07, 2013 10:11 am

Post by william.wang_GMA »

Hi
Thanks for all the replies, I've been out a couple of days, and just now getting back.


Thanks for the above URLs. I'll certainly will go through them.

I've read somewhere that says: major players (Google, flicker, yahoo? amazon...) are dumping SOAP and using REST instead. Even REST is superceding SOAP?

So my objective is: I want to learn to code REST, besides SOAP.

Up till now I am able to create simple SOAP WebService using DataStage and ISD. It's very simple to do, mainly:
1. create DS job;
2. deploy it in ISD with SOAP over HTTP binding
3. create .net C# console client; Add reference pointing to WSDL generated from ISD.

Now I want to do the same thing, but with REST over HTTP instead.
ISD says it deploys it. But what do I do next? There's is no WSDL.


I read somewhere that you can generate WADL, and with that you can add Reference to that WADL?

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

Post by eostic »

SOAP isn't dead yet. ; ) It will a long time coming before it is replaced, and WSDL has a lot to do with that. Where things are super strict, the WSDL still has strong supporters who want metadata and agreed-upon contract definitions for what each side of the application needs or should provide.

At the same time, REST is more loosey-goosey, with not strings attached, and no need for the overhead of parsers and code generators at development and design time.

The debate will go on for a long time.....

That being said, just use your browser. I outlined how to do it up above. Your browser issues a GET...which is the simplest protocol for REST and the one that delivers data, and the one that ISD is supporting.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
egs
Participant
Posts: 2
Joined: Tue Aug 13, 2013 10:20 am

Post by egs »

To test the URL from ISD, use below client
http://code.google.com/p/rest-client/

Or
You can write a simple java program using URLConnection class and pass the URL and the input

If you using REST2.0
See http://pic.dhe.ibm.com/infocenter/iisin ... 3%74%22%20

Sample URL looks like
http://servername:port/wisd-rest2/<application-name>/<OperationContext>?arg1=value1&arg2=value2
EGS
william.wang_GMA
Premium Member
Premium Member
Posts: 21
Joined: Thu Mar 07, 2013 10:11 am

Post by william.wang_GMA »

Thanks your replies.
I will try out the REST using browser and the urls above.

Just a side note:
I was testing to see how much data can go across webservice.

I developed a simple Datastage job with Teradata stage lookup (1 simple query), then deployed it through ISD with array option on both input/output.

The query was simply: "select top 1200000 ..."

A C# client program simply pulls the resultant data into its own array on my laptop. Then it does a for loop, adding up rows, bytes ...

This is intranet, and I don't really know how far is the server is from my laptop, and laptop is on wifi to network, not direct connection.

I was able to pull back, in a single call, over 2.8 Meg of data (equivalent to a 1.2 M rows of 118 chars per row (2 bytes each char) in about 2.3 mins.

118x2 = 236 bytes/row
236 bytes/row x 1,200,000 rows= 283,200,000 bytes =~ 283Meg


When i increase to 1.3m rows, it aborts.

I am not sure if this is due to my laptop not having enough memory or the webserver not having enough memory. More likely my laptop.

This is a lot of data to go across the wire through parameters, not attachment!

FWIW
william.wang_GMA
Premium Member
Premium Member
Posts: 21
Joined: Thu Mar 07, 2013 10:11 am

Post by william.wang_GMA »

Hi
eostic wrote:If you have a REST service, such as this one from an ISD application, just find out the URL for it's "GET" functionality
Where do you find the URL?

I deployed my webservice in ISD as using REST2.0 binding. It says it deployed. When I clicked on "View Service in Catalog", then clicked on "Bindings" it displays some generic info, but I don't see any URL.

With SOAP ws, when I clicked on "Binding" it gives button "Open WSDL Document"; when I click it, it opens up a new window with the URL in the address bar. I can use this URL in my client app, or SOAPUI.

Where do I find this URL in REST?

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

Post by eostic »

Egs outlined the url pattern above.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
william.wang_GMA
Premium Member
Premium Member
Posts: 21
Joined: Thu Mar 07, 2013 10:11 am

Post by william.wang_GMA »

Hi


I use this command in browser:

Code: Select all

https://xxxxx:port/wisd-rest2/MDB_App_REST/REST_SVC1/DBC_Lookup_REST?TableName=RL0PARTS
Thanks
william.wang_GMA
Premium Member
Premium Member
Posts: 21
Joined: Thu Mar 07, 2013 10:11 am

Post by william.wang_GMA »

sorry, click wrong button too fast!

Code: Select all

AppName:            MDB_App_Rest
ServiceName:        REST_SVC1
OperationName:      DBC_Lookup_REST 
Binding:            REST2.0
Operation Context:  /REST_SVC1/DBC_Lookup_REST   (pulled from ISD) 

1 input parameter:   TableName.  Its values is "RL0PARTS"


==> URL is:
https://xxxxx:port/wisd-rest2/MDB_App_REST/REST_SVC1/DBC_Lookup_REST?TableName=RL0PARTS 

where  xxxxx:port is actual value from the URL of ISD Web Console:
    https://xxxxx:port/yyyyy/iis/console/ 

I just copy the 1st portion to use as my URL.  I hope this is correct
I think the URL looks correct.

But it gives this error:

Code: Select all

<exception xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://java.sun.com">
<errorcode>500</errorcode>
<message>
com.ascential.asb.agent.HandlerException: DataStage job J_DBC_LOOKUP1_1inStr_2outStrs.1396392535707 stopped unexpectedly. at com.ascential.asb.agent.handler.datastage.PipeReceiver.handleResponses(PipeReceiver.java:221) at com.ascential.asb.agent.handler.datastage.PipeReceiver.getResponse(PipeReceiver.java:145) at com.ascential.asb.agent.handler.datastage.PipeReceiver.run(PipeReceiver.java:100)
</message>
<classname>javax.ejb.EJBException</classname>
<requestURI>/wisd-rest2/MDB_App_REST/REST_SVC1/DBC_Lookup_REST</requestURI>
</exception>



Why the error:
Errorcode=500?
"stop unexpectedly"?



This Datastage job, J_DBC_LOOKUP1_1inStr_2outStrs, when declared with "SOAP over HTTP", ran to completion and returns correct result. I just ran it again and still is successful.


Any idea?

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

Post by eostic »

Perfect! Congrats.
Ernie Ostic

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