+1 - NPE's are bad. However, this just delays the problem if relative URL's are present. At least the exception can give a clearer explanation. How about definition a new exception class for this case, or maybe a good message like "Unable to resolve relative URI since document base is absent"

Arthur Ryman,
IBM Software Group, Rational Division

blog: http://ryman.eclipsedevelopersjournal.com/
phone: +1-905-413-3077, TL 969-3077
assistant: +1-905-413-2411, TL 969-2411
fax: +1-905-413-4920, TL 969-4920
mobile: +1-416-939-5063, text: [EMAIL PROTECTED]


John Kaputin <[EMAIL PROTECTED]> wrote on 06/24/2006 09:59:41 PM:

> Eran/Arthur,
> I can change the behaviour of the readWSDL(WSDLSource) method so that at
> least it does not NPE if WSDLSource.baseURI is null. Instead the
> Description.documentBaseURI will be set to null. Of course, if the WSDL
> contains imports or includes with relative location paths, they will not be
> resolved correctly and the resulting MaflformedURLException will be wrapped
> as a WSDLException.  This is the way WSDL4J behaves.
>
> A URL resolver (one of Woden's 'TODOs') might choose to do something useful
> with these relative paths. WSDL4J provides a similar option with it's
> WSDLLocator interface.
>
> Any objections to me making this change - to avoid the NPE and let the
> docBaseURI be null?
>
> John Kaputin
>
>
>
>                                                                            
>              Arthur Ryman                                                  
>              <[EMAIL PROTECTED]                                            
>              >                                                          To
>                                        [email protected]            
>              22/06/2006 17:58                                           cc
>                                        [email protected]            
>                                                                    Subject
>              Please respond to         Re: Problem in parsing WSDL URI    
>              [EMAIL PROTECTED]                                            
>                   he.org                                                  
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>
>
>
>
>
> Eran,
>
> No. The spec says that relative URLs are allowed, for example in
> <ws:include>. We need to know the base URL even if you are given a stream.
> The URL can be passed in as a parameter.
>
> Arthur Ryman,
> IBM Software Group, Rational Division
>
> blog: http://ryman.eclipsedevelopersjournal.com/
> phone: +1-905-413-3077, TL 969-3077
> assistant: +1-905-413-2411, TL 969-2411
> fax: +1-905-413-4920, TL 969-4920
> mobile: +1-416-939-5063, text: [EMAIL PROTECTED]
>
>                                                                            
>  Eran Chinthaka                                                            
>  <[EMAIL PROTECTED]>                                                
>                                                                         To
>                                                    [email protected]
>  06/22/2006 12:32 PM                                                    cc
>                                                                            
>                                                                    Subject
>             Please respond to                      Re: Problem in parsing  
>          [email protected]                   WSDL URI                
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>
>
>
>
>
> Arthur Ryman wrote:
> > Eran,
> >
> > Even if you have an input stream, you still need a URI for the WSDL
> > document since the document might contain relative URIs. You need to know
>
> > the base URI of the document in order to interpret relative URIs.
>
> I agree, but these relatives paths are not urls. Basically they are just
> relative file locations without a scheme.
> If you create a URL from that, most probably you will get
> MalformedURLException.
>
> Can't we have a trade-off for this, please.
>
> -- Chinthaka
>
> (See attached file: signature.asc)
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> org[attachment "signature.asc" deleted by Arthur Ryman/Toronto/IBM]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to