Hi Dan, the reason why we catch this exception is because this exception is
safely to be ignored as the real WSDL_LOCATION is always passed into Service
from client code to overload the original URL, see below:
URL wsdlURL;
File wsdlFile = new File(args[0]);
if (wsdlFile.exists()) {
wsdlURL = wsdlFile.toURL();
} else {
wsdlURL = new URL(args[0]);
}
System.out.println(wsdlURL);
SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
Cheers,
Jervis
> -----Original Message-----
> From: Dan Diephouse [mailto:[EMAIL PROTECTED]
> Sent: 2007?3?26? 12:37
> To: [email protected]
> Subject: URL in Client stub
>
>
> Hola,
>
> When using the WSDL2Java program it always generates hard
> coded urls in the
> client stub like so:
>
> static {
> URL url = null;
> try {
> url = new
> URL("file:/C:/cygwin/home/Dan%20Diephouse/some.wsdl");
> } catch (MalformedURLException e) {
> e.printStackTrace();
> }
> WSDL_LOCATION = url;
> }
>
> There is a problem with this though - It may not be in that
> same location
> when I deploy my service. I can specify a relative URL using
> wsdl to java,
> but then the URL string will be something like "some.wsdl" -
> which is not a
> valid URL and will throw a MalformedURLException.
>
> First, the exception is caught, which strikes me as odd. If
> its important,
> we should do something about it. If its not important, then why is it
> there??
>
> Is there anyway around this?
>
> Thanks,
> - Dan
> --
> Dan Diephouse
> Envoi Solutions
> http://envoisolutions.com | http://netzooid.com/blog
>