This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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

Win a copy of Building Microservices this week in the Design forum!
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: 20057

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: 19728

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.
Have you checked out Aspose?
subject: WSDL name and namespace
It's not a secret anymore!