File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Help with Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Help with Application" Watch "Help with Application" New topic
Author

Help with Application

Markus Nilsson
Greenhorn

Joined: Dec 03, 2012
Posts: 2
Hi everybody, i was searching the web for information about my problem and stumble up across this forum wich looks awesome!

I have an programing task i need help with. And its should work like this.

• A server hosted at http://www.weatheroverground.moc provides weather information of cities to its clients as a web service.
• A client GUI based application is used to send the name of the city.
• The server gets the request from a local database then replies back a response to populate the client screen with the relevant weather data (such as temperature, rain, wind speed, condition/sunny/cloudy/windy).
• The information contains both textual and non-textual components such as symbols for sunny, cloudy, etc., conditions.



I have a few questions about this. Wich type of JEE componets should i use on the Server side?
I also need som understanding on how were are accsessing an gui based application through the http://www.weatheroverground.moc.
So how should i develop the client side of the application to consume the weather web service at weatheroverground.moc.

So far i have thought that i would use a Stateless session bean as the webservice wich have following operations.
*getWeatherdata - This method returns the weather info about the specified city.

Then we have the nontextual data wich should be pictures like (Sun, Raindrops, Cloud etc).
With the info we get from getWeatherdata we check wich picture we should use like.

If(Weathertype = cloudy){
Return cloud.img}

This is for now, hope you guys can help me and sorry for my terrible English!





Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

Hi Markus,
Welcome to the Ranch!

Your thoughts are along the right lines. You need to develop a webservice. It can either be RESTful one or use SOAP. REST is preferred these days with the response as JSON.
JAX-WS is the API for SOAP based web services and JAX-RS is the API for RESTful services.

I will suggest you go through this tutorial to know more about web services.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Markus Nilsson
Greenhorn

Joined: Dec 03, 2012
Posts: 2
Ranganathan Kaliyur Mannar wrote:Hi Markus,
Welcome to the Ranch!

Your thoughts are along the right lines. You need to develop a webservice. It can either be RESTful one or use SOAP. REST is preferred these days with the response as JSON.
JAX-WS is the API for SOAP based web services and JAX-RS is the API for RESTful services.

I will suggest you go through this tutorial to know more about web services.


Okey!

Ive been looking into to it a bit further now, and im confused how im going to pass an image and a string with weather info at the same time.

Im looking at this tutorial (http://netbeans.org/kb/docs/websvc/flower_overview.html) and in this one he is passing the image ass an bytearray to the client and he modifys the schema file to interpret arrays of bytes as Images.
I want to do this but also send a text string with weather data.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with Application