Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 95156 invoked by uid 500); 17 Mar 2003 12:31:29 -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 95145 invoked from network); 17 Mar 2003 12:31:29 -0000 Subject: bug in Service.java From: Daniel Elenius To: axis-dev@ws.apache.org Content-Type: text/plain Organization: Message-Id: <1047904271.1099.11.camel@p85.ryd.student.liu.se> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 17 Mar 2003 13:31:12 +0100 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.6 required=5.0 tests=FROM_ENDS_IN_NUMS,LIU_FROM_MATCHES_LIUSTUDENT, SPAM_PHRASE_00_01 version=2.41-liu_1.3 X-Spam-Level: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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) ); } }