Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 4079 invoked by uid 500); 17 Mar 2003 12:39:23 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 4070 invoked from network); 17 Mar 2003 12:39:22 -0000 Message-ID: <20030317123923.10405.qmail@web12806.mail.yahoo.com> Date: Mon, 17 Mar 2003 04:39:23 -0800 (PST) From: Davanum Srinivas Reply-To: dims@yahoo.com Subject: Re: bug in Service.java To: axis-dev@ws.apache.org In-Reply-To: <1047904271.1099.11.camel@p85.ryd.student.liu.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Please log a bug report in Bugzilla (http://nagoya.apache.org/bugzilla) Thanks, dims --- Daniel Elenius 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