Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-03
9
Medium Priority
?
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

718 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