aspose file tools*
The moose likes XML and Related Technologies and the fly likes Getting null instance of WSDLSet when using WOMParser 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 "Getting null instance of WSDLSet when using WOMParser" Watch "Getting null instance of WSDLSet when using WOMParser" New topic
Author

Getting null instance of WSDLSet when using WOMParser

harbeer kadian
Greenhorn

Joined: Jul 07, 2009
Posts: 12
Hi,

I tried to use the org.jvnet.wom api to parse a wsdl.
Here is the snippet of code i used

String tempLocation = "D:/harbeer/Documents/HWE-Connect/TeamCener_WebService/ExportDataFromPDMService.wsdl";
WOMParser womParser = new WOMParser();
womParser.parse(new FileReader(new File(tempLocation)));
WSDLSet wsdlSet = womParser.getResult();
System.out.println("WSDLSet -> "+wsdlSet);

The application is getting a null instance of WSDLSet.

The wsdl used here is importing an xsd, where the input and output message structure is defined.


With Regards
Harbeer Kadian
harbeer kadian
Greenhorn

Joined: Jul 07, 2009
Posts: 12
The above code does not give any problem if the wsdl parsed in the code is not importing any other xsd or wsdl file.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18656
    
    8

I'm not familiar with that product, but I notice that you're passing a Reader to the parser. That means that the parser won't have a system ID for the input document (i.e. it won't know where it is).

And if your method of importing involves a relative URL then the parser won't know what it's relative to, and won't be able to find the imported document.

The usual way to deal with this in JAXP is to pass a File to the parser, or a URL, or something which enables the parser to locate the document. Perhaps you could do that with this parser too. (That would also fix any problems you might have caused by using a Reader with a charset different from the document's encoding.)
harbeer kadian
Greenhorn

Joined: Jul 07, 2009
Posts: 12
Thanks paul

I got the solution.
I passed the url of the file and now this api is able to find out imported documents.
Thanks a lot, you saved my day
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting null instance of WSDLSet when using WOMParser