scheu       02/04/24 10:48:57

  Modified:    java/src/org/apache/axis/deployment/wsdd WSDDService.java
  Log:
  Small defect in the WSDDService reported by Greg Truty (IBM).
  
  The loop in makeNewInstance can cause duplicate OperationDesc objects to
  be added to the ServiceDesc.
  
  The fix is to add the OperationDesc to the ServiceDesc when the
  WSDDOperation is added to the WSDDService.  This is done exclusively
  in the WSDDService.addOperation method:
  
      /**
       * Add a WSDDOperation to the Service.
       * @param mapping.
       **/
      public void addOperation(WSDDOperation operation) {
          operations.add(operation);
          desc.addOperationDesc(operation.getOperationDesc());
      }
  
  The operations loop in makeNewInstance is removed.  The code in the constructor
  which adds WSDDOperations now uses the addOperation method.
  
  Cheers.
  
  Revision  Changes    Path
  1.60      +1 -7      
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.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- WSDDService.java  23 Apr 2002 22:33:20 -0000      1.59
  +++ WSDDService.java  24 Apr 2002 17:48:57 -0000      1.60
  @@ -144,7 +144,7 @@
           for (int i = 0; i < operationElements.length; i++) {
               WSDDOperation operation = new WSDDOperation(operationElements[i],
                                                           desc);
  -            operations.add(operation);
  +            addOperation(operation);
           }
   
           Element [] typeMappingElements = getChildElements(e, "typeMapping");
  @@ -394,12 +394,6 @@
                   wrapper.setOption("fault-" + flow.getQName().getLocalPart(),
                                     faultHandler);
               }
  -        }
  -
  -        for (Iterator i = operations.iterator(); i.hasNext();) {
  -            OperationDesc operationDesc =
  -                    ((WSDDOperation) i.next()).getOperationDesc();
  -            desc.addOperationDesc(operationDesc);
           }
   
           service.setServiceDescription(desc);
  
  
  


Reply via email to