My problem with this is that: a) Its completely impossible to do relative urls when calling new URL(). If we are going to enable the -wsdlLocation flag for this, we should be using the URIResolver class to create a URL. Are there any issues with doing that?
b) If, as Jervis says, the exception can be safely ignored, why do we print the stack trace? Its annoying for those who don't have a WSDL around. I can see how we need the WSDL to pull metadata out of sometimes, but it shouldn't be required in my mind. Is the stack trace printing just there so people can figure out why their WSDL isn't loading on the client side if that is in fact what they want to do? - Dan On 3/26/07, Daniel Kulp <[EMAIL PROTECTED]> wrote:
For wsdl2java, I added a -wsdlLocation flag last week that is opionally used to specify the wsdlLocation that is embedded into the annotations. Most likely, the sample here should also use that flag if specified. Dan On Monday 26 March 2007 03:41, Liu, Jervis wrote: > Is this a bug? I believe the logic here is that we generate a Stub > that always has an absolute path as default, then if you know this > absolute path does not work for your client (you know this because you > write the client code, you know how the client bundle is deployed, > where to expect the WSDL), you need to use a relative path or using > whatever revolvers to resolve your WSDL location in your client code > then pass the resolved result into the service stub. So I do not see > this as a bug unless we want to change the default behavior of Service > stub to be able to work with both relative path and absolute path. But > my feeling is its better to leave the resolving job to the users as > they most likely want to clearly control where they get the WSDL > loaded. > > Cheers, > Jervis > > > -----Original Message----- > > From: James Mao [mailto:[EMAIL PROTECTED] > > Sent: 2007?3?26? 14:52 > > To: [email protected] > > Subject: Re: URL in Client stub > > > > > > This seems a bug to me, we just fixed a bug about the > > relative URI for > > annotation in SEI and Service class. > > The static block in service class should still use absolute > > path, which > > used as a default wsdl location. > > > > Please fire an issue for this. > > > > Thanks, > > James. > > > > > 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 -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727 C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
-- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
