Solved

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

Posted on 2004-08-03
9
244 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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
 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
egit plugin on eclipse 8 63
windows explorer path to command prompt 5 43
table example 4 29
iterator/ListIterator approach 17 26
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

776 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