This blog is mainly about Java...

Wednesday, March 28, 2012

WSDL is not part of this compilation. Is this a mistake for wsdl file?

I tried generating a web service client based on wsconsume (which is located in the java distribution folder (bin).

However, upon running the following command:

wsimport.exe -verbose FooBar.wsdl -b Foobar Foobar-jaxb-mapping.xml -s .

I got the following error message:

[ERROR] "file:/C:/workspace/tmp/wsdl/FoobarProxy.wsdl" is not a part of
this compilation. Is this a mistake for "file:/C:/workspace/tmp/FoobarPr
oxy.wsdl"?
line 5 of file:/C:/workspace/tmp/FrontenServiceProxy-jaxb-mapping.xml


I tried googling the error message, and most people suggested that the url had to be changed, and you needed to put #types?schema1 at the end of the url.
However, this wasn't what was wrong for me.

In line 5 of the mapping file, I am referring to the WSDL file. The problem was that in the WSDL file it said that the file should be located in the wsdl folder, and it wasn't. So I created a wsdl folder and put the wsdl file in the correct folder, and voila.

So next time, instead of just blindly googling the error message, I should have read more carefully and looked at the hint "line 5 in the mapping file".
Then I am sure I would have spotted the error!

Lesson learned...

Labels