1

A xml file with data will be sent over http to server my job is to get that xml file and parse it using web service and I am using Netbeans 6.9. How can i get that xml file can anyone tell me ?

2
  • possible duplicate of To recieve Soap Message over Http using Java Web Service Commented Jan 20, 2011 at 8:46
  • i'm voting to close this because it seems to be the same question you posted a few days ago. you havn't got any answers to your other questions till now, i've seen that, but shouldn't you consider giving more information about your problem instead of writing it in one confusing sentence? also, a link to your other question with would have been nice (but generally, reposting a question is never a good idea - you'll only get flames from that instead of answers... the best way would have been to edit you old question and try to rephrase it and giving more information about what you've tried) Commented Jan 20, 2011 at 8:49

3 Answers 3

1

Looking for something like this?

URL xmlUrl = new URL("http://www.rekindle.co.za/rss.xml");
InputStream in = xmlUrl.openStream();
Document doc = parse(in);

Taken from a similar question about parsing at http://www.java-forums.org/xml/22674-get-xml-data-url.html

Sign up to request clarification or add additional context in comments.

2 Comments

but problem is xml file will be generated automatically by another webservice for every 10 mins and sent to server using http. so i can't know xml file name then how can i read it from http port.
It sounds like you would need to use HttpServletRequest.
0

Assuming you're responsible for writing the service using servlets and the xml file will be POSTed to the server, you can access it using HttpServletRequest.getParameter(paramName).

1 Comment

tks but can you tell me briefly.
0

Use HttpClient for the same to recieve the XML , After recieving the xml use JAXB/XMLbeans parser to parse the xml. You must have to sure about xml's xsd before parsing the same. If already you are having xsd against the incoming xml then just created the classes by using using any above mentioned tool.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.