axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@yahoo.com>
Subject Re: bug in Service.java
Date Mon, 17 Mar 2003 12:39:23 GMT
Please log a bug report in Bugzilla (http://nagoya.apache.org/bugzilla)

Thanks,
dims
--- Daniel Elenius <danel698@student.liu.se> wrote:
> I think there's a bug in Service.java (RC2). The constructor
> 
>     public Service(InputStream wsdlInputStream, QName serviceName)
>                            throws ServiceException {
> 
> doesn't set wsdlLocation, so initService() doesn't work. Also, it seems
> strange that initService:
> 
>     private void initService(Document doc, QName serviceName)
>             throws ServiceException {
> 
> Doesn't use its doc parameter at all. It just parses from wsdlLocation
> and passes the parser and serviceLocation on to:
> 
>     private void initService(Parser parser, QName serviceName)
>             throws ServiceException {
> 
> Below are the methods in question. Note how the first Service()
> constructor sets wsdlLocation, but not the second:
> 
> /Daniel
> 
> 
> ------------------------
> 
>     /**
>      * Constructs a new Service object for the service in the WSDL
> document
>      * pointed to by the wsdlLocation and serviceName parameters.  This
> is
>      * just like the previous constructor but instead of URL the
>      * wsdlLocation parameter points to a file on the filesystem
> relative
>      * to the current directory.
>      *
>      * @param  wsdlLocation    Location of the WSDL relative to the
> current dir
>      * @param  serviceName     Qualified name of the desired service
>      * @throws ServiceException If there's an error finding or parsing
> the WSDL
>      */
>     public Service(String wsdlLocation, QName serviceName)
>                            throws ServiceException {
>         this.serviceName = serviceName;
>         this.wsdlLocation = wsdlLocation;
>         engine = getAxisClient();
>         // Start by reading in the WSDL using Parser
>         Parser parser = null ;
>         if ( cachingWSDL &&
>              (parser = (Parser) cachedWSDL.get(wsdlLocation)) != null )
> {
>           initService( parser, serviceName );
>         }
>         else {
>             Document doc = null;
>             try {
>                 doc = XMLUtils.newDocument(wsdlLocation);
>             } catch (Exception exp ) {
>                 throw new ServiceException(
>                    Messages.getMessage("wsdlError00", "" + "", "\n" +
> exp) );
>             }
>           initService(doc, serviceName);
>         }
>     }
> 
>     /**
>      * Constructs a new Service object for the service in the WSDL
> document
>      * in the wsdlInputStream and serviceName parameters.  This is
>      * just like the previous constructor but instead of reading the
> WSDL
>      * from a file (or from a URL) it is in the passed in InputStream.
>      *
>      * @param  wsdlInputStream InputStream containing the WSDL
>      * @param  serviceName     Qualified name of the desired service
>      * @throws ServiceException If there's an error finding or parsing
> the WSDL
>      */
>     public Service(InputStream wsdlInputStream, QName serviceName)
>                            throws ServiceException {
>         engine = getAxisClient();
>         Document doc = null;
>         try {
>             doc = XMLUtils.newDocument(wsdlInputStream);
>         } catch (Exception exp ) {
>             throw new ServiceException(
>                Messages.getMessage("wsdlError00", "" + "", "\n" + exp)
> );
>         }
>         initService(doc, serviceName);
>     }
> 
>     /**
>      * Common code for building up the Service from a WSDL document
>      *
>      * @param doc               A DOM document containing WSDL
>      * @param serviceName       Qualified name of the desired service
>      * @throws ServiceException  If there's an error finding or parsing
> the WSDL
>      */
>     private void initService(Document doc, QName serviceName)
>             throws ServiceException {
>         try {
>             // Start by reading in the WSDL using Parser
>             Parser parser = new Parser();
>             parser.run(this.wsdlLocation.toString());
> 
>             if ( cachingWSDL && this.wsdlLocation != null )
>               cachedWSDL.put( this.wsdlLocation.toString(), parser );
> 
>             initService( parser, serviceName );
>         }
>         catch( Exception exp ) {
>             throw new ServiceException(
>                     Messages.getMessage("wsdlError00", "" + "", "\n" +
> exp) );
>         }
>     }
> 
>     private void initService(Parser parser, QName serviceName)
>             throws ServiceException {
>         try {
>             this.wsdlParser = parser ;
>             ServiceEntry serviceEntry =
> parser.getSymbolTable().getServiceEntry(serviceName);
>             if ( serviceEntry != null)
>                 this.wsdlService    = serviceEntry.getService(); 
>             if ( this.wsdlService == null )
>                 throw new ServiceException(
>                         Messages.getMessage("noService00", "" +
> serviceName));
>         }
>         catch( Exception exp ) {
>             throw new ServiceException(
>                     Messages.getMessage("wsdlError00", "" + "", "\n" +
> exp) );
>         }
>     }
> 
> 


=====
Davanum Srinivas - http://webservices.apache.org/~dims/

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

Mime
View raw message