How to receive http/xml data file in J2EE Application Server

Hi,


I'm using Websphere App Server 5.1 (WAS) and am required to accept a http/xml file containing prices for stock which I am to process and store in a database.


Could an expert recommend the best approach for the requirement.

Basically I'm after guide-lines regarding the technologies to use for intercepting this file in a WAS environment.

Examples on how a simple file could be processed would be great.  Ideally the data should be received in the form of messages from MQ for the app server to process.

Regards,

azsat.

azsatAsked:
Who is Participating?
 
girionisConnect With a Mentor Commented:
>I'm using WAS 5.1 and as far as I'm aware there is no scheduling facility available in this
>version , how does WAS behaving as a web server in this cause actually await the XML request?

All servers behave in the same manner, they just wait for requests to arrive and then serve them. This is transparent to the user. No matter if you request a simple html page, a JSP, a servlet, a CGI script or whatever the mechanichs are the same. The server waits to see if requests arrive at its port.

With regards to the question above, WAS does not know what kind of request it is, it just receives it (receives the stream of data) and then the proper web application is in charge to process the XML request.

You do not have to worry about how all those things work, to be honest I don't know too, you just need to know that the web application you will write will be waiting for requests to arrive.
0
 
girionisCommented:
It depends on what the client is using to send the data, but a Web Service would be a good approach here. Here is a good tutorial to get you started:

 http://java.sun.com/webservices/docs/1.0/tutorial/doc/JavaWSTutorialTOC.html
0
 
sudhakar_koundinyaCommented:
Listening
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
azsatAuthor Commented:
Hi

Thanks for the pointer  girionis.  Please clarify this:

Doesn't  http/xml imply Web Sevices ?  

ie XML plus HTTP. HTTP is a ubiquitous protocol, running practically everywhere on the Internet. So XML provides a metalanguage ?  So if my client system (which could be any platform)  wants to send data to WAS it uses http
as the protocol and XML the metalanguage describing the data?

Last but not least,  would my WAS server be functioning as a webserver reading in the XML?

OK if you say yes to the above then when would WAS know that an XML file is ready for delivery, basically how would this scheduling be achieved in the web services scenario?

My hungry mind awaits....

0
 
girionisCommented:
> Doesn't  http/xml imply Web Sevices ?  

Not necessarily. It is the commonest way nowadays but it does not force you to use web services. XML is a metalanguage indeed (which, very briefly, means that it is a language of a "meta" (higher) state, i.e. a language to describe other languages) but it is merely text (you can also send binary objects but this is another story), which means that it can be transmitted by any means that can transmit text, be it using a web service, a plain POST or a plain GET request, an FTP, a TCP/IP connection and so on. The only thing you have to do is to construct the XML string, send it and have a parser at the other end to parse it and extract the data you want. The way you will send this XML string does not matter at all.

> so if my client system (which could be any platform)  wants to send data to WAS it uses http
> as the protocol and XML the metalanguage describing the data?

Exactly.

> Last but not least,  would my WAS server be functioning as a webserver reading in the XML?

Yes it will.

>OK if you say yes to the above then when would WAS know that an XML file is ready for delivery,
>basically how would this scheduling be achieved in the web services scenario?

A web server (or an evolved state of a web server - an application server) basically awaits for requests. When a request arrives it triggers an action and this action does what it is supposed to do (in your case it will be to serve the web service). So WAS will be running waiting for request. Your web service will be deployed waiting also for requests. When a web service request will arrive, WAS will forward it to the web serivce, the web service will process the request and will return the result back to the user who initiated the call.
0
 
azsatAuthor Commented:
Thanks  girionis,

Very helpful indeed, I'm a little unlcear on "basically awaits for requests. When a request arrives it triggers an action and this action does what it is supposed to do"

I'm using WAS 5.1 and as far as I'm aware there is no scheduling facility available in this version , how does WAS behaving as a web server in this cause actually await the XML request?

Regards

azsat.
0
 
azsatAuthor Commented:
cause=case :-)
0
 
azsatAuthor Commented:
Good man,thank you.
0
 
girionisCommented:
Thank you for accepting, glad I was of help :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.