axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@us.ibm.com
Subject Re: cvs commit: xml-axis/java/src/org/apache/axis/utils axisNLS.properties
Date Fri, 02 Aug 2002 16:33:24 GMT
Is this legal WSDL?  The JAX-RPC spec says that if a PART name is the same,
then it becomes an inout parameter.  It says nothing about the elements of
a wrapped complexType.  Here is my comment from version 1.13, where I added
the "&& !wrapped" item to the if check:

"If we have

<message name="in"><part name="in" element="e"/></message>
<message name="out"><part name="out" element="e"/></message>

where e contains a string named a.  Note that the input and output
messages both refer to the same element.  Because the unwrapped list
of parameters are named the same for input and output, we used to say
we had an inout parameter and generate the following:

public void e(StringHolder a);

but inoutness is determined by part name, not parameter name, so we
should generate:

public String e(String a);

This is a TCK issue."

I said this is a TCK issue, but I just ran the TCK with your commit and it
worked (they DID change the doc/lit tests for us, so I think the issue is
now just masked).  I don't have a strong feeling about this, so no -1, but
it feels wrong to me.  I question the legality of the WSDL in the bugzilla.

Russell Butek
butek@us.ibm.com


tomj@apache.org on 08/02/2002 11:05:57 AM

Please respond to axis-dev@xml.apache.org

To:    xml-axis-cvs@apache.org
cc:
Subject:    cvs commit: xml-axis/java/src/org/apache/axis/utils axisNLS.
       properties



tomj        2002/08/02 09:05:57

  Modified:    java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
               java/test/wsdl/import3/MultiImpIncl/wsdl MultiImp.wsdl
               java/src/org/apache/axis/utils axisNLS.properties
  Log:
  Fix bug 11376 -
   WSDL2Java generates invalid stubs when a method has an in/out parameter
    http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11376

  The logic for defining InOut paramters was getting skipped if the WSDL
  was
  wrapped (i.e. from .NET).  Turn this back on.

  In addition, throw an error if we encounter two parts with the same name
  but
  different types.  This is illegal so we shouldn't let it slide.

  Fix one of our test cases which had this bad WSDL in it.

  Revision  Changes    Path
  1.19      +8 -5      xml-
  axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java

  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/xml-
  axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SymbolTable.java  2 Aug 2002 12:55:33 -0000     1.18
  +++ SymbolTable.java  2 Aug 2002 16:05:57 -0000     1.19
  @@ -1114,7 +1114,7 @@
                                 int index,
                                 int outdex,
                                 Parameters parameters,
  -                              boolean trimInput) {
  +                              boolean trimInput) throws IOException {
           Parameter p = (Parameter)inputs.get(index);
           // If this is an element, we want the XML to reflect the element
           name
           // not the part name.
  @@ -1131,9 +1131,7 @@
           // At this point we know the name and type of the parameter, and
           that it's at least an
           // in parameter.  Now check to see whether it's also in the
           outputs Vector.  If it is,
           // then it's an inout parameter.
  -        // Don't bother doing this if the parameters are wrapped since
  their
  -        // names won't be the part names.
  -        if (outdex >= 0 && !wrapped) {
  +        if (outdex >= 0) {
               Parameter outParam = (Parameter)outputs.get(outdex);
               if (p.getType().equals(outParam.getType())) {
                   outputs.remove(outdex);
  @@ -1143,7 +1141,12 @@
                   // If we're here, we have both an input and an output
                   // part with the same name but different types.... guess
                   // it's not really an inout....
  -                ++parameters.inputs;  // Is this OK??
  +                throw new IOException(JavaUtils.
  getMessage("differentTypes00",
  +                     new String[] { p.getName(),
  +                                    p.getType().getQName().toString(),
  +                                    outParam.getType().getQName().
  toString()
  +                                   }
  +                ));
               }
           } else {
               ++parameters.inputs;



  1.2       +2 -2      xml-
  axis/java/test/wsdl/import3/MultiImpIncl/wsdl/MultiImp.wsdl

  Index: MultiImp.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-
  axis/java/test/wsdl/import3/MultiImpIncl/wsdl/MultiImp.wsdl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultiImp.wsdl     26 Jul 2002 15:48:27 -0000    1.1
  +++ MultiImp.wsdl     2 Aug 2002 16:05:57 -0000     1.2
  @@ -17,12 +17,12 @@

     <message name="DataRequestMessage">
       <part name="header" element="ses:Session"/>
  -    <part name="body" element="cmp:DataRequest"/>
  +    <part name="bodyin" element="cmp:DataRequest"/>
     </message>

     <message name="DataResponseMessage">
       <part name="header" element="ses:Session"/>
  -    <part name="body" element="cmp:DataRequestResponse"/>
  +    <part name="bodyout" element="cmp:DataRequestResponse"/>
     </message>

     <portType name="multiImpInclDataPortType">



  1.33      +1 -0      xml-axis/java/src/org/apache/axis/utils/axisNLS.
  properties

  Index: axisNLS.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/axisNLS.
  properties,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- axisNLS.properties      1 Aug 2002 22:13:09 -0000     1.32
  +++ axisNLS.properties      2 Aug 2002 16:05:57 -0000     1.33
  @@ -953,4 +953,5 @@
   wrongNamespace00=The XML Schema type ''{0}'' is not valid in the Schema
   version ''{1}''.

   onlyOneBodyFor12=Only one body allowed for SOAP 1.2 RPC
  +differentTypes00=Error: The input and output parameter have the same
  name, ''{0}'', but are defined with type ''{1}'' and also with type
  ''{2}''.





Mime
View raw message