axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl Emitter.java
Date Sat, 27 Oct 2001 19:51:16 GMT
butek       01/10/27 12:51:16

  Modified:    java/src/org/apache/axis/wsdl Emitter.java
  Log:
  Implement portType/service name clash resolution according to JAX-RPC.  If
  portType and service both share the name "X", then portType name becomes
  "X_Port" and service name becomes "X_Service".
  
  Revision  Changes    Path
  1.87      +26 -0     xml-axis/java/src/org/apache/axis/wsdl/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/Emitter.java,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- Emitter.java	2001/10/26 18:19:01	1.86
  +++ Emitter.java	2001/10/27 19:51:16	1.87
  @@ -231,6 +231,10 @@
               // Collect information about ports and operations
               wsdlAttr = new WsdlAttributes(def, new HashMap());
   
  +            // PortTypes and Services can share the same name.  If they do in this Definition,
  +            // force their names to be suffixed with _PortType and _Service, respectively.
  +            resolvePortTypeServiceNameClashes();
  +
               // Output interfaces for portTypes - fill in the portTypesInfo HashMap
               writePortTypes(portTypesInfo);
   
  @@ -422,6 +426,28 @@
           }
           return types;
       } // getNestedTypes
  +
  +    /**
  +     * PortTypes and Services can share the same name.  If they do in this Definition,
  +     * force their names to be suffixed with _PortType and _Service, respectively.  These
names
  +     * are placed back in the QName of the PortType and Service objects themselves.
  +     */
  +    private void resolvePortTypeServiceNameClashes() {
  +        Map portTypes = def.getPortTypes();
  +        Map services  = def.getServices();
  +        Iterator pti = portTypes.keySet().iterator();
  +        while (pti.hasNext()) {
  +            QName ptName = (QName) pti.next();
  +            Iterator si = services.keySet().iterator();
  +            while (si.hasNext()) {
  +                QName sName = (QName) si.next();
  +                if (ptName.equals(sName)) {
  +                    ptName.setLocalPart(ptName.getLocalPart() + "_Port");
  +                    sName.setLocalPart(sName.getLocalPart() + "_Service");
  +                }
  +            }
  +        }
  +    } // resolvePortTypeServiceNameClashes
   
       /**
        * Generate the bindings for all port types, and fill in the portTypesInfo HashMap.
  
  
  

Mime
View raw message