cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abid Hussain <abid.huss...@abid76.de>
Subject Re: FileNotFoundException wsdl
Date Mon, 12 Nov 2007 16:04:42 GMT
Thanks, putting the wsdl in the classpath and using the following code 
in the ServiceImpl class finally did it:

     static {
         URL url = null;
         try {
//        	url = new URL("file:etc/kvvservice.wsdl");
             url = 
KvvServiceImplService.class.getResource("/kvvservice.wsdl");
             System.out.println("Using wsdl from (" + url + ").");
         } catch (Exception e) {
             System.err.println("Can not initialize the default wsdl 
from classpath:/kvvservice.wsdl");
             // e.printStackTrace();
         }
         WSDL_LOCATION = url;
     }

Regards,

Abi

Glen Mazza schrieb:
> Am Montag, den 12.11.2007, 11:08 +0100 schrieb Abid Hussain:
>> Hello everybody,
>>
>> I generated a client using wsdl2java and packed it in a jar, so that I 
>> can use it in other applications. When generating the client using 
>> wsdl2java I indicated that the wsdl file is in etc/kvvservice.wsdl.
>>
>> Now, when I try to use the client in an other application (using the jar 
>> file) I get the following error (full stack trace at the end):
>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem 
>> parsing 'file:etc/kvvservice.wsdl'.: java.io.FileNotFoundException: 
>> etc\kvvservice.wsdl (Das System kann den angegebenen Pfad nicht finden)
> 
>> First, I wonder how to indicate that the wsdl has moved to another place 
>> when using the client in another application.
>>
> 
> Your WSDL file will need to be in the classpath of the client app that
> you are running.  Basically, at the root of the classes directory is the
> easiest place to put it, but you can also specify other classpaths.
> 
> I find Ant easier to state classpaths, if you look at my "run-client"
> target in step 5 of my eBay tutorial this may help you:
> 
> http://www.jroller.com/gmazza/date/20070817
> 
> Also, in your Service class generated by JAX-WS, you can alter the
> syntax used for loading the file.  Instead of:
> 
> url = new URL("file:mywsdl.wsdl");  // filepath search, probably won't
> work for JARs
> 
> you should be able to use something like:
> 
> URL wsdlURL = getClass().getClassLoader().getResource("mywsdl.wsdl");
> // classpath search, should work for JARs
> 
> 
>> Second, I don't get why the CXF Runtime needs the wsdl file at all? The 
>> clients classes have already been generated using wsdl2java and I 
>> suppose that all information needed is contained in those generated classes.
>>
> 
> Vivek and Arun of Sun Metro have much to say about this, links below.
> 
> http://forums.java.net/jive/message.jspa?messageID=244333#244333
> http://blogs.sun.com/arungupta/date/20071108
> 
> HTH,
> Glen
> 
> 
> 

-- 

Abid Hussain
Mail: abid.hussain@abid76.de
Web: http://www.abid76.de

Mime
View raw message