aspose file tools*
The moose likes Web Services and the fly likes Web service client - Browser or Webstart/JNLP or Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web service client - Browser or Webstart/JNLP or Swing" Watch "Web service client - Browser or Webstart/JNLP or Swing" New topic
Author

Web service client - Browser or Webstart/JNLP or Swing

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

I have a webservice which does a number of things. A simple example of things it could do (note just example):

Return list of products
Update product price
Add new product
Update existing product
Return product price
Return product brochure + image
Add product brochure + image

The first 5 services are simple enough in that a request is sent to the SOAP web service and it will either return a list or it will update an existing row in the database or create a new one.

The last two a slightly tricky in that they involve sending binary files to the service and recieving binary files from the service.

There is no problem in implementing the SOAP service on the server end. I already have a framework in place i now just need to implement the services. What i am having problems with is how to implement the client that will be consuming these services.

I have been reading up about SOAP clients and know that i can send the files as SOAP attachements but i dont quite understand how this is converted into a HTTP request.

Questions:

- I would like the client to be a web portal but i am not quite sure how you can call a web service from a web browser. is this possible?
- How does a web service call work from a browser? Is it a normal HTTP call?
- And most importantly, how would the upload/download of the binary files work?
- In terms of securing the requests, which is more secure? A web portal based client or a thick client based client?
- Is there any advantage in using Java Web Start/JNLP in place of a web portal or a thick client?
- Is it possible to mix and match between a web portal and Web start for the binary data transfer?
- Is it common practice to call a web service from a web portal (i.e. from a web browser)?

The other alternative i think is to implement the client as a thick client (Desktop application). The problem with this is that i have 0 experience in GUI Swing based applications.

One important aspect of the solution is that it has to be secure so whichever approach i use will need to be secured using certificates. The majority of the services will be implemented using Spring technologies. I am using Spring-WS for the Web service and will probably use Spring-MVC if it is doable as a web portal.

The Web Service and the Web Application will both be running in the same application server.
Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 124

looks like you need some REST. Try Apache CXF, which is SOAP as well as REST.
O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

How does REST help if the consumer is a web portal?
Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 124

you can call the services just by making GET/POST requests (ajax) from your web page & can receive back the response, parse it & use it.
O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

Does this include the upload/download of binary files?
Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 124

you can have upload/download for sure with interceptors (there may be more ways, may be somebody else could help in this).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Web service client - Browser or Webstart/JNLP or Swing