axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject RE: cvs commit: xml-axis/java/src/org/apache/axis/client Service. java
Date Fri, 10 Jan 2003 04:24:43 GMT

Discovered this while playing with James' WSDL - new Service("file.wsdl", qname) wasn't working.
 I think this fix does about the right thing, but please feel free to comment if I've missed
something.

--G

> -----Original Message-----
> From: gdaniels@apache.org [mailto:gdaniels@apache.org]
> Sent: Thursday, January 09, 2003 11:23 PM
> To: xml-axis-cvs@apache.org
> Subject: cvs commit: xml-axis/java/src/org/apache/axis/client
> Service.java
> 
> 
> gdaniels    2003/01/09 20:22:37
> 
>   Modified:    java/src/org/apache/axis/client Service.java
>   Log:
>   The Service(String wsdlLocation) constructor wasn't working
>   with filenames.  Since we already do all the work to handle this
>   case in XmlUtils, replace the URL member variable with a String,
>   and let that code do its job.  The getWSDLDocumentLocation()
>   method may want a somewhat better implementation....
>   
>   Revision  Changes    Path
>   1.84      +10 -10    
> xml-axis/java/src/org/apache/axis/client/Service.java
>   
>   Index: Service.java
>   ===================================================================
>   RCS file: 
> /home/cvs/xml-axis/java/src/org/apache/axis/client/Service.java,v
>   retrieving revision 1.83
>   retrieving revision 1.84
>   diff -u -r1.83 -r1.84
>   --- Service.java	17 Dec 2002 00:01:35 -0000	1.83
>   +++ Service.java	10 Jan 2003 04:22:37 -0000	1.84
>   @@ -108,7 +108,7 @@
>        private transient EngineConfiguration config = null;
>    
>        private QName               serviceName     = null ;
>   -    private URL                 wsdlLocation    = null ;
>   +    private String              wsdlLocation    = null ;
>        private javax.wsdl.Service  wsdlService     = null ;
>        private boolean             maintainSession = false ;
>        private HandlerRegistryImpl registry = new 
> HandlerRegistryImpl();
>   @@ -180,7 +180,7 @@
>        public Service(URL wsdlDoc, QName serviceName) throws 
> ServiceException {
>            this.serviceName = serviceName;
>            engine = getAxisClient();
>   -        this.wsdlLocation = wsdlDoc;
>   +        wsdlLocation = wsdlDoc.toString();
>            Parser parser = null ;
>    
>            if ( cachingWSDL &&
>   @@ -226,22 +226,18 @@
>        public Service(String wsdlLocation, QName serviceName)
>                               throws ServiceException {
>            this.serviceName = serviceName;
>   +        this.wsdlLocation = wsdlLocation;
>            engine = getAxisClient();
>   -        try {
>   -            this.wsdlLocation = new URL(wsdlLocation);
>   -        }
>   -        catch (MalformedURLException mue) {
>   -        }
>            // Start by reading in the WSDL using Parser
>            Parser parser = null ;
>            if ( cachingWSDL &&
>   -             (parser = (Parser) 
> cachedWSDL.get(this.wsdlLocation.toString())) != null ) {
>   +             (parser = (Parser) 
> cachedWSDL.get(wsdlLocation)) != null ) {
>              initService( parser, serviceName );
>            }
>            else {
>                Document doc = null;
>                try {
>   -                doc = 
> XMLUtils.newDocument(this.wsdlLocation.toString());
>   +                doc = XMLUtils.newDocument(wsdlLocation);
>                } catch (Exception exp ) {
>                    throw new ServiceException(
>                       Messages.getMessage("wsdlError00", "" + 
> "", "\n" + exp) );
>   @@ -593,7 +589,11 @@
>         * @return URL URL pointing to the WSDL doc
>         */
>        public URL getWSDLDocumentLocation() {
>   -        return wsdlLocation ;
>   +        try {
>   +            return new URL(wsdlLocation);
>   +        } catch (MalformedURLException e) {
>   +            return null;
>   +        }
>        }
>    
>        /**
>   
>   
>   
> 

Mime
View raw message