This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Advice on use of Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Advice on use of Web Service" Watch "Advice on use of Web Service" New topic
Author

Advice on use of Web Service

Abbhinav Sharma
Greenhorn

Joined: Jan 12, 2012
Posts: 6
Hi Guys

I am a near beginner in java and certainly not familiar with webservices.

I have a problem where I have been asked to send over data to other parties in the form of an xml, and I am wondering if I really need to implement Webservices or a simpler solution would do?

The data I need to send is some customer information such as:

Name Ph No Add Car Owned
D.Xavier 1231312 xxxxx a
F.Ahmed 1231211 xxxxx b
C.Gibson 12312 xxxxx c
A.Fowler 1231 xxxxx a


Where each row is a record and might go as an element between user-defined tags in an xml.


The alternate simple solution that I am referring to could include:

Having a blank input table on my screen (created using html/jsf) , entering the values that are needed and bind the values to a List.
Iterate the list, pick and write these to an output file (.txt) with respective tags needed for the xml to be produced.
Let the caller fetch the text based xml file directly as a resource from my server address.

I am certain this sounds overly simplistic, however would appreciate if anyone could please help me understand the flaws in this approach.

Appreciate any help that can come.

Cheers

P.S.: Given my clear lack of hold on the subject, it would be very helpful to know if there is a live chat option available (here or any other forum) to be able to interact with others from whom I can learn.


William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
If your client users are simply expecting an XML formatted document, then you certainly don't need to create a complex web service.

What you describe sounds like a "RESTful" architecture to me where the client is handed a URL that GETs your XML document.

You could also be sending users the XML document as email body or an email attachment.

Bill
Abbhinav Sharma
Greenhorn

Joined: Jan 12, 2012
Posts: 6
Hi Bill

Thanks very much for the advice. The request from the client at this time is for a simple xml file, and it may well be best to solve it the most simple way by simply constructing the file in an off-hand manner.

As clearly I am a 'greenhorn' I am yet to learn a lot conceptually about the capabilities, complexities and limitations of WebServices.
As I had mentioned in my postscript, it would be very helpful to know of a live chat forum, where it would be possible to interact with adept programmers to seek help in clearing my concepts interactively.

Would be great if you could suggest any relevant forums or how best to get clarify my concepts.

Thanks
Abhinav
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Advice on use of Web Service
 
Similar Threads
Data loss converting StringBuilder to byte[]?
Newbie to Axis webservices
How to store values in a ArrayList from startElement?
Archeticting out of a bad architecture...
using XSD to generate XML document