dims        2002/10/24 11:03:10

  Modified:    java/src/org/apache/axis/client Service.java
  Log:
  Updating DII Implementation to use Parser instead of using WSDL4J
  
  Revision  Changes    Path
  1.79      +28 -32    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.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- Service.java      10 Oct 2002 19:56:44 -0000      1.78
  +++ Service.java      24 Oct 2002 18:03:10 -0000      1.79
  @@ -55,27 +55,24 @@
   
   package org.apache.axis.client ;
   
  -import javax.wsdl.extensions.soap.SOAPAddress;
   import org.apache.axis.AxisEngine;
   import org.apache.axis.EngineConfiguration;
   import org.apache.axis.configuration.EngineConfigurationFactoryFinder;
   import org.apache.axis.utils.ClassUtils;
  -import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.Messages;
   import org.apache.axis.utils.WSDLUtils;
   import org.apache.axis.utils.XMLUtils;
  +import org.apache.axis.wsdl.gen.Parser;
  +import org.apache.axis.wsdl.symbolTable.ServiceEntry;
   import org.w3c.dom.Document;
   
   import javax.naming.Reference;
   import javax.naming.Referenceable;
   import javax.naming.StringRefAddr;
  -
   import javax.wsdl.Binding;
  -import javax.wsdl.Definition;
   import javax.wsdl.Port;
   import javax.wsdl.PortType;
  -import javax.wsdl.factory.WSDLFactory;
  -import javax.wsdl.xml.WSDLReader;
  +import javax.wsdl.extensions.soap.SOAPAddress;
   import javax.xml.namespace.QName;
   import javax.xml.rpc.ServiceException;
   import javax.xml.rpc.encoding.TypeMappingRegistry;
  @@ -88,11 +85,11 @@
   import java.net.URL;
   import java.rmi.Remote;
   import java.util.HashMap;
  +import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
   import java.util.Vector;
  -import java.util.Hashtable;
   
   /**
    * Axis' JAXRPC Dynamic Invoation Interface implementation of the Service
  @@ -113,10 +110,10 @@
   
       private QName               serviceName     = null ;
       private URL                 wsdlLocation    = null ;
  -    private Definition          wsdlDefinition  = null ;
       private javax.wsdl.Service  wsdlService     = null ;
       private boolean             maintainSession = false ;
       private HandlerRegistryImpl registry = new HandlerRegistryImpl();
  +    private Parser              wsdlParser      = null;
   
       /**
        * Thread local storage used for storing the last call object
  @@ -131,14 +128,14 @@
       private Hashtable transportImpls = new Hashtable();
   
       
  -    Definition getWSDLDefinition() {
  -        return( wsdlDefinition );
  -    }
  -
  -    javax.wsdl.Service getWSDLService() {
  +    protected javax.wsdl.Service getWSDLService() {
           return( wsdlService );
       }
   
  +    protected Parser getWSDLParser() {
  +        return( wsdlParser );
  +    }
  +    
       protected AxisClient getAxisClient()
       {
           return new AxisClient(config);
  @@ -185,11 +182,11 @@
           this.serviceName = serviceName;
           engine = getAxisClient();
           this.wsdlLocation = wsdlDoc;
  -        Definition def = null ;
  +        Parser parser = null ;
   
           if ( cachingWSDL &&
  -             (def = (Definition) cachedWSDL.get(this.wsdlLocation.toString())) != 
null ){
  -          initService( def, serviceName );
  +             (parser = (Parser) cachedWSDL.get(this.wsdlLocation.toString())) != 
null ){
  +          initService( parser, serviceName );
           }
           else {
               Document doc = null;
  @@ -223,11 +220,11 @@
           }
           catch (MalformedURLException mue) {
           }
  -        // Start by reading in the WSDL using WSDL4J
  -        Definition def = null ;
  +        // Start by reading in the WSDL using Parser
  +        Parser parser = null ;
           if ( cachingWSDL &&
  -             (def = (Definition) cachedWSDL.get(this.wsdlLocation.toString())) != 
null ) {
  -          initService( def, serviceName );
  +             (parser = (Parser) cachedWSDL.get(this.wsdlLocation.toString())) != 
null ) {
  +          initService( parser, serviceName );
           }
           else {
               Document doc = null;
  @@ -274,16 +271,14 @@
       private void initService(Document doc, QName serviceName)
               throws ServiceException {
           try {
  -            // Start by reading in the WSDL using WSDL4J
  -            WSDLReader           reader = WSDLFactory.newInstance()
  -                                                     .newWSDLReader();
  -            reader.setFeature("javax.wsdl.verbose", false);
  -            Definition           def    = reader.readWSDL( null, doc );
  +            // 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(), def );
  +              cachedWSDL.put( this.wsdlLocation.toString(), parser );
   
  -            initService( def, serviceName );
  +            initService( parser, serviceName );
           }
           catch( Exception exp ) {
               throw new ServiceException(
  @@ -291,12 +286,13 @@
           }
       }
   
  -    private void initService(Definition def, QName serviceName)
  +    private void initService(Parser parser, QName serviceName)
               throws ServiceException {
           try {
  -            this.wsdlDefinition = def ;
  -
  -            this.wsdlService    = def.getService( serviceName );
  +            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));
  @@ -450,7 +446,7 @@
   
           // We can't prefill information if WSDL is not specified,
           // So just return the call that we just created.
  -        if ( wsdlDefinition == null )
  +        if ( wsdlParser == null )
               return call;
   
           Port port = wsdlService.getPort( portName.getLocalPart() );
  
  
  


Reply via email to