File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes WSDL name and namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "WSDL name and namespace" Watch "WSDL name and namespace" New topic

WSDL name and namespace

Harsha Hegde

Joined: Jan 12, 2009
Posts: 17

I have a WSDL file in a string. How can I get the name and namespace from it? Is there any parser for reading this
Henry Wong

Joined: Sep 28, 2004
Posts: 20521

A WSDL file is just an XML file -- it can be parsed by any XML parser. It is also just text, so you can try using regex too (although it may be more difficult).

Regardless, I'll move this to the XML forum for you.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Harsha Hegde

Joined: Jan 12, 2009
Posts: 17

I tried it with DOM parser and failed
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

That's because the DOM parser is by default NOT namespace-aware. You'll need to call the method which makes the parser namespace-aware. I don't remember which one it is, and I don't remember if you apply it to the parser or the parser factory, but you should be able to find it in the API documentation with no problem.
I agree. Here's the link:
subject: WSDL name and namespace
It's not a secret anymore!