aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "WSDL name and namespace" Watch "WSDL name and namespace" New topic
Author

WSDL name and namespace

Harsha Hegde
Greenhorn

Joined: Jan 12, 2009
Posts: 17

Hi,
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
Thanks,
Harsha
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40


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.

Henry


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

Joined: Jan 12, 2009
Posts: 17

I tried it with DOM parser and failed
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: WSDL name and namespace