Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Web Services and the fly likes Web Service XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web Service XML" Watch "Web Service XML" New topic

Web Service XML

Daniel Afonso

Joined: Jan 27, 2011
Posts: 16

Hi! I did an export of data from a table in a PostgreSQL database to an XML file. What i want to do is a Java web service that allows me to insert the data from the XML back into the database. I do not know how the process works. Would appreciate help.

best regards
Shashank Ag
Ranch Hand

Joined: Dec 22, 2009
Posts: 88

For starters you can use bottom up approach, so just write a method which accepts string argument (containing xml) and do thedb updates as you require.
Now, to generate webservice out of it, there are sevreral java2wsdl generators. Axis is one of it (easier) although JAX-WS will be better choice in terms of adheraing to latest standards.

SCJP 91%, SCWCD 97%
Daniel Afonso

Joined: Jan 27, 2011
Posts: 16

i' m new to this. How a make a string to accept xml?
Paul Clapham

Joined: Oct 14, 2005
Posts: 19856

XML is a text format. So to create a String variable to which you can assign XML:
Daniel Afonso

Joined: Jan 27, 2011
Posts: 16

thanks. but can somebody tell me where i can find a tutorial to see how to do this? what i want is to make a web service that receives a xml file and insert the data back to db.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Take a look at section 9.4 in this document:
Best wishes!

My free books and tutorials:
I agree. Here's the link:
subject: Web Service XML
It's not a secret anymore!