• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting null instance of WSDLSet when using WOMParser

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The above code does not give any problem if the wsdl parsed in the code is not importing any other xsd or wsdl file.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic