Solved

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

Posted on 2004-08-03
9
227 Views
Last Modified: 2010-03-31
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.

0
Comment
Question by:azsat
  • 4
  • 4
9 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 11707072
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
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 11707082
Listening
0
 

Author Comment

by:azsat
ID: 11708831
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
 
LVL 35

Expert Comment

by:girionis
ID: 11712716
> 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:azsat
ID: 11720850
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
 

Author Comment

by:azsat
ID: 11720863
cause=case :-)
0
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 11723537
>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
 

Author Comment

by:azsat
ID: 11729697
Good man,thank you.
0
 
LVL 35

Expert Comment

by:girionis
ID: 11729775
Thank you for accepting, glad I was of help :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now