scheu       02/05/28 08:03:49

  Modified:    java/src/org/apache/axis/wsdl/fromJava Emitter.java
  Log:
  Fix for defect http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8791
  
  To ensure that the overloaded messages are correctly represented in the
  wsdl, the input/output elements must have unique names.
  
  This is simple to do since the generated messages have unique names.
  The fix is to give the input/output elements the same name as the corresponding
  message (in both the portType and the binding).
  
  Revision  Changes    Path
  1.35      +21 -18    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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Emitter.java      16 May 2002 17:45:00 -0000      1.34
  +++ Emitter.java      28 May 2002 15:03:49 -0000      1.35
  @@ -623,7 +623,8 @@
                   }
               }
   
  -            writeMessages(def, oper, messageOper);
  +            writeMessages(def, oper, messageOper, 
  +                          bindingOper);
               portType.addOperation(oper);
           }
   
  @@ -634,27 +635,29 @@
   
       /** Create a Message
        *
  -     * @param def
  -     * @param oper
  +     * @param Definition, the WSDL definition
  +     * @param Operation, the wsdl operation
  +     * @param OperationDesc, the Operation Description
  +     * @param BindingOperation, corresponding Binding Operation
        * @throws Exception
        */
       private void writeMessages(Definition def,
                                  Operation oper,
  -                               OperationDesc desc)
  +                               OperationDesc desc,
  +                               BindingOperation bindingOper)
               throws Exception{
           Input input = def.createInput();
   
           Message msg = writeRequestMessage(def, desc);
           input.setMessage(msg);
   
  +        // Give the input element a name that matches the
  +        // message.  This is necessary for overloading.
  +        // The msg QName is unique.
  +        String name = msg.getQName().getLocalPart();
  +        input.setName(name);
  +        bindingOper.getBindingInput().setName(name);
   
  -        // Iff this method is overloaded, then give the input
  -        // stanzas a name.
  -//        if (method.isOverloaded()) {
  -//            String name = msg.getQName().getLocalPart();
  -//            input.setName(name);
  -//            bindingOper.getBindingInput().setName(name);
  -//        }
           oper.setInput(input);
   
           def.addMessage(msg);
  @@ -663,13 +666,13 @@
           Output output = def.createOutput();
           output.setMessage(msg);
   
  -        // Iff this method is overloaded, then give the output
  -        // stanzas a name.
  -//        if (method.isOverloaded()) {
  -//            String name = msg.getQName().getLocalPart();
  -//            output.setName(name);
  -//            bindingOper.getBindingOutput().setName(name);
  -//        }
  +        // Give the output element a name that matches the
  +        // message.  This is necessary for overloading.
  +        // The message QName is unique.
  +        name = msg.getQName().getLocalPart();
  +        output.setName(name);
  +        bindingOper.getBindingOutput().setName(name);
  +
           oper.setOutput(output);
   
           def.addMessage(msg);
  
  
  


Reply via email to