Consuming Web Services

S

scottrbutler

Can someone point me to a decent resource about consuming a web service
in Java? Or maybe reccomend a book?

Thanks,
Scott
 
S

scottrbutler

I have a web service, it returns an XML stream. I need to access the
XML to get to the data.
 
A

Andrew Thompson

I have a web service, it returns an XML stream. I need to access the
XML to get to the data.

Oh, riiiigt.

OK, try this snippet..

DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
/*
factory.setValidating(true);
factory.setNamespaceAware(true);
factory.setSchema(schema);*/
try {
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse( f );
....

DocumentBuilder.parse() also accepts a stream, so..

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top