• Post Reply Bookmark Topic Watch Topic
  • New Topic

web services learning curve question  RSS feed

 
steve francisco
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to build a struts web application. Now I'm thinking about introducing web services (i.e. publish it as web services). However, I only know struts, servlet, etc but don't anything about web services yet.
What will be an easier path for me ---

1) build the web component application first, then learn web services and change my application into a web services.
2) learn web services, and then build a service for this web application.

Is 1) or 2) easier for me ?

thanks
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just consider webservices as a plugin , that will help you to decide further.

I would reckon option1 if webservices is part of your other requirements. For example:An application with support to browser based users, mobile based users, webservices based users, rss/atom etc.,

I would reckon option2 if ur whole application is gonna be exposed as webservices.
 
steve francisco
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Balaji Loganathan:
Just consider webservices as a plugin , that will help you to decide further.

I would reckon option1 if webservices is part of your other requirements. For example:An application with support to browser based users, mobile based users, webservices based users, rss/atom etc.,

I would reckon option2 if ur whole application is gonna be exposed as webservices.


A follow-up question from web service rookie --- If the whole application is exposed as web services, what "difference" will the front end user feel ? Suppose user types two URLs, one URL for the application without web services, and another URL for the application exposed as web service, they won't feel any difference, right ? It is just the behind-scene architecture change, right ?
 
William Barnes
Ranch Hand
Posts: 1049
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> If the whole application is exposed as web services, what "difference" will the front end user feel ?

Web services return SOAP, not html. A browser is not a web services client.
 
steve francisco
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Barnes:
> If the whole application is exposed as web services, what "difference" will the front end user feel ?

Web services return SOAP, not html. A browser is not a web services client.


So, there is no way to access the web services through a browser ? My web application lets user going through few web pages by hitting "next' and "submit" buttons and eventually return a HTML output. If a web services only accepts standalone application, how does it handle the "interactive" part of my web application (like "selecting" from picklist, etc)? and how does user see the results in html format ?
 
Heonkoo Lee
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was confused like you before. Web services are not for displaying output to a web client such as browser. You can think of it simply as a Remote Procedure Call that can be called by client programs language-independently.

So, as with RPC (or RMI in Java) the web service may expose one or many public methods to be called by the clients. Servlets can establish an end point for web serives and call the remote methods as if they are local, and process the returned data to send responses back to the browser.

I recommend Apache Axis which is an implementation of SOAP and most popular in the Java World. If you seach for 'Axis tutorial example...', you will find plenty. I think you can easily deploy a simple web service in a day. Actually you can convert a plain old java program to a web service simply by changing file extension from .java to .jws, and hot deploy to axis web app root. You will get a feel if you just read some tutorial. SOAP, WSDL, WSDL2Java, SOA..... I also need to study more. Just started to use recently.
[ April 03, 2005: Message edited by: Heonkoo Lee ]
 
William Barnes
Ranch Hand
Posts: 1049
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> My web application lets user going through few web pages by hitting "next' and "submit" buttons and eventually return a HTML output.

Given this example think of web services as a source of data. The client would use your web page to ask for something, your web application would talk to a web service to get the data and return html to the client. This is an example of your web application as a web service client.

If you want to be a web service provider (server) you would return SOAP, and the client (whoever they may be) would be responsible for generating the html. The client in this example is not a browser.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!