axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/fromJava Emitter.java
Date Wed, 17 Jul 2002 20:27:29 GMT
gdaniels    2002/07/17 13:27:29

  Modified:    java/src/org/apache/axis/deployment/wsdd WSDDService.java
                        WSDDConstants.java
               java/test/functional TestElementSample.java
               java/src/org/apache/axis/transport/http
                        SimpleAxisWorker.java AxisServlet.java
               java/src/org/apache/axis/description ServiceDesc.java
               java/src/org/apache/axis/client Service.java
               java/src/org/apache/axis/providers/java JavaProvider.java
               java/src/org/apache/axis/wsdl/fromJava Emitter.java
  Log:
  1) Add ability to specify endpoint URL for a service in WSDD.
     Works like this:
  
      <service name="Foo">
         <endpointURL>http://firewall/axis/services/Foo</endpointURL>
         ...
      </service>
  
  2) Don't both setting the WSDL URL properties to the same value as the
     TRANS_URL property in the AxisServlet + SimpleAxisServer, since they
     default to using that anyway.
  
  3) "searchParents" arg was never used in loadServiceDescByIntrospection,
     remove it.
  
  4) QName simplification in client.Service
  
  5) Various bits of cleanup
  
  Revision  Changes    Path
  1.76      +13 -0     xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java
  
  Index: WSDDService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- WSDDService.java	10 Jul 2002 19:32:13 -0000	1.75
  +++ WSDDService.java	17 Jul 2002 20:27:27 -0000	1.76
  @@ -187,6 +187,12 @@
               desc.setWSDLFile(fileName);
           }
   
  +        Element urlElem = getChildElement(e, ELEM_WSDD_ENDPOINTURL);
  +        if (urlElem != null) {
  +            String endpointURL = XMLUtils.getChildCharacterData(urlElem);
  +            desc.setEndpointURL(endpointURL);
  +        }
  +
           String providerStr = e.getAttribute(ATTR_PROVIDER);
           if (providerStr != null && !providerStr.equals("")) {
               providerQName = XMLUtils.getQNameFromString(providerStr, e);
  @@ -518,6 +524,13 @@
           for (int i=0; i < namespaces.size(); i++ ) {
               context.startElement(QNAME_NAMESPACE, null);
               context.writeString((String)namespaces.get(i));
  +            context.endElement();
  +        }
  +
  +        String endpointURL = desc.getEndpointURL();
  +        if (endpointURL != null) {
  +            context.startElement(QNAME_ENDPOINTURL, null);
  +            context.writeSafeString(endpointURL);
               context.endElement();
           }
   
  
  
  
  1.20      +3 -1      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDConstants.java
  
  Index: WSDDConstants.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDConstants.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- WSDDConstants.java	11 Jun 2002 14:53:52 -0000	1.19
  +++ WSDDConstants.java	17 Jul 2002 20:27:28 -0000	1.20
  @@ -127,6 +127,7 @@
       public static final String ELEM_WSDD_ELEMENTMAPPING = "elementMapping";
       public static final String ELEM_WSDD_WSDLFILE = "wsdlFile";
       public static final String ELEM_WSDD_NAMESPACE = "namespace";
  +    public static final String ELEM_WSDD_ENDPOINTURL = "endpointURL";
   
       public static final QName QNAME_PARAM = new QName(URI_WSDD, ELEM_WSDD_PARAM);
       public static final QName QNAME_DOC = new QName(URI_WSDD, ELEM_WSDD_DOC);
  @@ -146,7 +147,8 @@
       public static final QName QNAME_ELEMENTMAPPING = new QName(URI_WSDD, ELEM_WSDD_ELEMENTMAPPING);
       public static final QName QNAME_WSDLFILE = new QName(URI_WSDD, ELEM_WSDD_WSDLFILE);
       public static final QName QNAME_NAMESPACE = new QName(URI_WSDD, ELEM_WSDD_NAMESPACE);
  -    
  +    public static final QName QNAME_ENDPOINTURL = new QName(URI_WSDD, ELEM_WSDD_ENDPOINTURL);
  +
       public static final String ATTR_LANG_SPEC_TYPE = "languageSpecificType";
       public static final String ATTR_QNAME = "qname";
       public static final String ATTR_NAME = "name";
  
  
  
  1.11      +0 -1      xml-axis/java/test/functional/TestElementSample.java
  
  Index: TestElementSample.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/functional/TestElementSample.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestElementSample.java	3 Jul 2002 18:47:07 -0000	1.10
  +++ TestElementSample.java	17 Jul 2002 20:27:28 -0000	1.11
  @@ -56,7 +56,6 @@
   package test.functional;
   
   import junit.framework.TestCase;
  -import org.apache.axis.AxisFault;
   import org.apache.axis.client.AdminClient;
   
   import org.apache.axis.components.logger.LogFactory;
  
  
  
  1.11      +1 -6      xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisWorker.java
  
  Index: SimpleAxisWorker.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisWorker.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SimpleAxisWorker.java	11 Jul 2002 15:57:54 -0000	1.10
  +++ SimpleAxisWorker.java	17 Jul 2002 20:27:28 -0000	1.11
  @@ -282,17 +282,12 @@
                   // This works for 99% of the uses of SimpleAxisServer,
                   // but is very stupid
                   String hostname = InetAddress.getLocalHost().getHostAddress();
  +                //hostname="localhost";
                   // !!! Fix string concatenation
                   String url = "http://" + hostname + ":" +
                           server.getServerSocket().getLocalPort() + "/" +
                           fileName.toString();
                   msgContext.setProperty(MessageContext.TRANS_URL, url);
  -
  -                msgContext.setProperty(MessageContext.WSDLGEN_INTFNAMESPACE,
  -                     System.getProperty(MessageContext.WSDLGEN_INTFNAMESPACE,url));
  -
  -                msgContext.setProperty(MessageContext.WSDLGEN_SERV_LOC_URL,
  -                      System.getProperty(MessageContext.WSDLGEN_SERV_LOC_URL,url));
   
                   String filePart = fileName.toString();
                   if (filePart.startsWith("axis/services/")) {
  
  
  
  1.126     +0 -11     xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- AxisServlet.java	11 Jul 2002 12:46:35 -0000	1.125
  +++ AxisServlet.java	17 Jul 2002 20:27:28 -0000	1.126
  @@ -65,8 +65,6 @@
   import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.description.OperationDesc;
   import org.apache.axis.configuration.ServletEngineConfigurationFactory;
  -import org.apache.axis.message.SOAPEnvelope;
  -import org.apache.axis.message.SOAPFault;
   import org.apache.axis.security.servlet.ServletSecurityProvider;
   import org.apache.axis.server.AxisServer;
   import org.apache.axis.utils.Admin;
  @@ -78,7 +76,6 @@
   
   import org.w3c.dom.Document;
   
  -import javax.servlet.ServletConfig;
   import javax.servlet.ServletContext;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServlet;
  @@ -324,14 +321,6 @@
                       String url = HttpUtils.getRequestURL(req).toString();
   
                       msgContext.setProperty(MessageContext.TRANS_URL, url);
  -
  -
  -                    msgContext.setProperty(MessageContext.WSDLGEN_INTFNAMESPACE,
  -                      getOption(servletContext, MessageContext.WSDLGEN_INTFNAMESPACE,url));
  -
  -                    msgContext.setProperty(MessageContext.WSDLGEN_SERV_LOC_URL,
  -                      getOption(servletContext, MessageContext.WSDLGEN_SERV_LOC_URL,url));
  -
   
                       boolean wsdlRequested = false;
                       boolean listRequested = false;
  
  
  
  1.40      +21 -6     xml-axis/java/src/org/apache/axis/description/ServiceDesc.java
  
  Index: ServiceDesc.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- ServiceDesc.java	12 Jul 2002 16:21:39 -0000	1.39
  +++ ServiceDesc.java	17 Jul 2002 20:27:28 -0000	1.40
  @@ -119,6 +119,13 @@
        */
       private String wsdlFileName = null;
   
  +    /**
  +     * An endpoint URL which someone has specified for this service.  If
  +     * this is set, WSDL generation will pick it up instead of defaulting
  +     * to the transport URL.
  +     */
  +    private String endpointURL = null;
  +
       /** Place to store user-extensible service-related properties */
       private HashMap properties = null;
   
  @@ -549,7 +556,7 @@
        */
       public void loadServiceDescByIntrospection()
       {
  -        loadServiceDescByIntrospection(implClass, true);
  +        loadServiceDescByIntrospection(implClass);
   
           // Setting this to null means there is nothing more to do, and it
           // avoids future string compares.
  @@ -560,19 +567,19 @@
        * Fill in a service description by introspecting the implementation
        * class.
        */    
  -    public void loadServiceDescByIntrospection(Class implClass, boolean searchParents)
{
  +    public void loadServiceDescByIntrospection(Class implClass) {
           if (introspectionComplete || implClass == null) {
               return;
           }
   
  -        loadServiceDescByIntrospectionRecursive(implClass, searchParents);
  +        loadServiceDescByIntrospectionRecursive(implClass);
           introspectionComplete = true;
       }
   
       /**
        * Recursive helper class for loadServiceDescByIntrospection
        */
  -    private void loadServiceDescByIntrospectionRecursive(Class implClass, boolean searchParents)
  +    private void loadServiceDescByIntrospectionRecursive(Class implClass)
       {
           if (Skeleton.class.equals(implClass)) {
               return;
  @@ -592,7 +599,7 @@
                   Class superClass = superClasses[i];
                   if (stopClasses == null ||
                           !stopClasses.contains(superClass.getName())) {
  -                    loadServiceDescByIntrospectionRecursive(superClass, true);
  +                    loadServiceDescByIntrospectionRecursive(superClass);
                   }
               }
           } else {
  @@ -602,7 +609,7 @@
                       !superClass.getName().startsWith("javax.") &&
                       (stopClasses == null ||
                           !stopClasses.contains(superClass.getName()))) {
  -                loadServiceDescByIntrospectionRecursive(superClass, true);
  +                loadServiceDescByIntrospectionRecursive(superClass);
               }
           }
       }
  @@ -922,5 +929,13 @@
               return null;
   
           return properties.get(name);
  +    }
  +
  +    public String getEndpointURL() {
  +        return endpointURL;
  +    }
  +
  +    public void setEndpointURL(String endpointURL) {
  +        this.endpointURL = endpointURL;
       }
   }
  
  
  
  1.65      +1 -6      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.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- Service.java	8 Jul 2002 16:37:37 -0000	1.64
  +++ Service.java	17 Jul 2002 20:27:28 -0000	1.65
  @@ -274,12 +274,7 @@
           try {
               this.wsdlDefinition = def ;
   
  -            // grrr!  Too many flavors of QName
  -            String ns = serviceName.getNamespaceURI();
  -            String lp = serviceName.getLocalPart();
  -            QName  qn = new QName( ns, lp );
  -
  -            this.wsdlService    = def.getService( qn );
  +            this.wsdlService    = def.getService( serviceName );
               if ( this.wsdlService == null )
                   throw new ServiceException(
                           JavaUtils.getMessage("noService00", "" + serviceName));
  
  
  
  1.67      +8 -5      xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- JavaProvider.java	3 Jul 2002 17:50:34 -0000	1.66
  +++ JavaProvider.java	17 Jul 2002 20:27:28 -0000	1.67
  @@ -57,7 +57,6 @@
   
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.AxisServiceConfig;
   import org.apache.axis.Handler;
   import org.apache.axis.Message;
  @@ -72,14 +71,13 @@
   import org.apache.axis.enum.Style;
   import org.apache.axis.enum.Scope;
   import org.apache.axis.Constants;
  +import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.handlers.soap.SOAPService;
  -import org.apache.axis.deployment.wsdd.WSDDConstants;
   
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
   
   import org.w3c.dom.Document;
  -import org.apache.axis.deployment.wsdd.WSDDService;
   
   import javax.xml.rpc.server.ServiceLifecycle;
   import javax.xml.rpc.holders.IntHolder;
  @@ -325,6 +323,7 @@
           /***************************************************************/
           String serviceName = msgContext.getTargetService();
           SOAPService service = msgContext.getService();
  +        ServiceDesc serviceDesc = service.getInitializedServiceDesc(msgContext);
   
           /* Now get the service (RPC) specific info  */
           /********************************************/
  @@ -353,7 +352,11 @@
               }
               String locationUrl = 
                       msgContext.getStrProp(MessageContext.WSDLGEN_SERV_LOC_URL);
  -            
  +
  +            if (locationUrl == null) {
  +                locationUrl = serviceDesc.getEndpointURL();
  +            }
  +
               if (locationUrl == null) {
                   locationUrl = url;
               } else {
  @@ -406,7 +409,7 @@
               emitter.setIntfNamespace(targetNamespace);
   
               emitter.setLocationUrl(locationUrl);
  -            emitter.setServiceDesc(msgContext.getService().getInitializedServiceDesc(msgContext));
  +            emitter.setServiceDesc(serviceDesc);
               emitter.setTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                      getTypeMapping(Constants.URI_DEFAULT_SOAP_ENC));
               emitter.setDefaultTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
  
  
  
  1.50      +0 -1      xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- Emitter.java	16 Jul 2002 18:32:46 -0000	1.49
  +++ Emitter.java	17 Jul 2002 20:27:28 -0000	1.50
  @@ -67,7 +67,6 @@
   
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
  -import org.apache.axis.wsdl.toJava.Utils;
   import org.apache.axis.description.OperationDesc;
   import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.description.ParameterDesc;
  
  
  

Mime
View raw message