tomj        2002/09/24 13:19:57

  Modified:    java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
  Added:       java/test/wsdl/wrapped_inout WrappedInOutTestCase.java
                        WrappedInOutSoapImpl.java wrapped_inout.wsdl
                        build.xml
  Log:
  Fix bug 12833 - Axis clients fail to extract the value of output (only)
  parameters when they are last in the parameter list
  
  The special case logic I added to prevent functions like
     void echo(StringHolder inout)
  and instead make signatures like
     String echo (String in)
  was doing very bad things.  Remove it and put the code in a better place
  that will not affect processing of functions with more than 1 parameter.
  
  Add a test case which has .NET WSDL for a large number of in/out/inout
  and return values, and include the test case noted in the bug for good measure.
  
  Revision  Changes    Path
  1.1                  xml-axis/java/test/wsdl/wrapped_inout/WrappedInOutTestCase.java
  
  Index: WrappedInOutTestCase.java
  ===================================================================
  /**
   * WrappedInOutTestCase.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package test.wsdl.wrapped_inout;
  
  public class WrappedInOutTestCase extends junit.framework.TestCase {
      public WrappedInOutTestCase(java.lang.String name) {
          super(name);
      }
      public void test1WrappedInOutEchoString() throws Exception {
          test.wsdl.wrapped_inout.WrappedInOutInterface binding;
          try {
              binding = new 
test.wsdl.wrapped_inout.WrappedInOutLocator().getWrappedInOut();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          java.lang.String expected = new String("This is a test");
          java.lang.String value = null;
          value = binding.echoString(expected);
          assertEquals(value, expected);
      }
  
      public void test2WrappedInOutEchoStringIO() throws Exception {
          test.wsdl.wrapped_inout.WrappedInOutInterface binding;
          try {
              binding = new 
test.wsdl.wrapped_inout.WrappedInOutLocator().getWrappedInOut();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          java.lang.String expected = new String("This is a test");
          java.lang.String value = null;
          value = binding.echoStringIO(expected);
          assertEquals(value, expected);
      }
  
      public void test3WrappedInOutEchoStringIOret() throws Exception {
          test.wsdl.wrapped_inout.WrappedInOutInterface binding;
          try {
              binding = new 
test.wsdl.wrapped_inout.WrappedInOutLocator().getWrappedInOut();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          java.lang.String value = null;
          javax.xml.rpc.holders.StringHolder ioarg = new 
javax.xml.rpc.holders.StringHolder("in1");
          value = binding.echoStringIOret(ioarg);
          assertEquals(value, "return");
          assertNotNull(ioarg);
          assertEquals(ioarg.value, "out1");
      }
  
      public void test4WrappedInOutEchoStringInIO() throws Exception {
          test.wsdl.wrapped_inout.WrappedInOutInterface binding;
          try {
              binding = new 
test.wsdl.wrapped_inout.WrappedInOutLocator().getWrappedInOut();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          javax.xml.rpc.holders.StringHolder holder = new 
javax.xml.rpc.holders.StringHolder("in2");
          binding.echoStringInIO("in1", holder);
          assertNotNull(holder);
          assertEquals(holder.value, "in1");
      }
  
      public void test5WrappedInOutEchoStringBig() throws Exception {
          test.wsdl.wrapped_inout.WrappedInOutInterface binding;
          try {
              binding = new 
test.wsdl.wrapped_inout.WrappedInOutLocator().getWrappedInOut();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          java.lang.String value = null;
          javax.xml.rpc.holders.StringHolder ioarg1 = new 
javax.xml.rpc.holders.StringHolder("ioarg1");
          javax.xml.rpc.holders.StringHolder ioarg2 = new 
javax.xml.rpc.holders.StringHolder("ioarg2");
          value = binding.echoStringBig("firstin1", ioarg1, ioarg2);
          assertNotNull(value);
          assertEquals(value, "firstin1");
          assertEquals(ioarg1.value, "out1");
          assertEquals(ioarg2.value, "out2");
      }
  
      public void test6WrappedInOutHelloInOut() throws Exception {
          test.wsdl.wrapped_inout.WrappedInOutInterface binding;
          try {
              binding = new 
test.wsdl.wrapped_inout.WrappedInOutLocator().getWrappedInOut();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          javax.xml.rpc.holders.StringHolder ioarg1 = new 
javax.xml.rpc.holders.StringHolder("ioarg1");
          javax.xml.rpc.holders.StringHolder ioarg2 = new 
javax.xml.rpc.holders.StringHolder("ioarg2");
          javax.xml.rpc.holders.StringHolder ioarg3 = new 
javax.xml.rpc.holders.StringHolder("ioarg3");
          javax.xml.rpc.holders.StringHolder ioarg4 = new 
javax.xml.rpc.holders.StringHolder("ioarg4");
          binding.helloInOut(ioarg1, ioarg2, ioarg3, ioarg4, "onlyInput");
          assertEquals(ioarg1.value, "out1");
          assertEquals(ioarg2.value, "out2");
          assertEquals(ioarg3.value, "out3");
          assertEquals(ioarg4.value, "out4");
      }
      
      public void test7WrappedInOutEchoPhone() throws Exception {
          test.wsdl.wrapped_inout.WrappedInOutInterface binding;
          try {
              binding = new 
test.wsdl.wrapped_inout.WrappedInOutLocator().getWrappedInOut();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          test.wsdl.wrapped_inout.Phone value = null;
          test.wsdl.wrapped_inout.Phone in = new test.wsdl.wrapped_inout.Phone();
          in.setAreaCode("503");
          in.setPrefix("281");
          in.setNumber("0816");
          value = binding.echoPhone(in);
          assertNotNull(value);
          assertEquals(value, in);
      }
  
  }
  
  
  
  1.1                  xml-axis/java/test/wsdl/wrapped_inout/WrappedInOutSoapImpl.java
  
  Index: WrappedInOutSoapImpl.java
  ===================================================================
  /**
   * WrappedInOutSoapImpl.java
   *
   * Tests .NET WSDL and functional signatures generated by WSDL2Java
   */
  
  package test.wsdl.wrapped_inout;
  
  public class WrappedInOutSoapImpl implements 
test.wsdl.wrapped_inout.WrappedInOutInterface{
      public java.lang.String echoString(java.lang.String inarg) throws 
java.rmi.RemoteException {
          return inarg;
      }
  
      public java.lang.String echoStringIO(java.lang.String ioarg) throws 
java.rmi.RemoteException {
          return ioarg;
      }
  
      public java.lang.String echoStringIOret(javax.xml.rpc.holders.StringHolder 
ioarg) throws java.rmi.RemoteException {
          if (!ioarg.value.equals("in1")) {
              throw new java.rmi.RemoteException("Input argument didn't match expected 
'in1', got: " + ioarg.value);
          }
          ioarg.value = "out1";
          return "return";
      }
  
      public void echoStringInIO(java.lang.String inarg, 
javax.xml.rpc.holders.StringHolder ioarg) throws java.rmi.RemoteException {
          ioarg.value = inarg;    
      }
  
      public java.lang.String echoStringBig(java.lang.String inarg, 
javax.xml.rpc.holders.StringHolder ioarg1, javax.xml.rpc.holders.StringHolder ioarg2) 
throws java.rmi.RemoteException {
          ioarg1.value = "out1";
          ioarg2.value = "out2";
          return inarg;
      }
  
      public void helloInOut(javax.xml.rpc.holders.StringHolder inout1, 
javax.xml.rpc.holders.StringHolder inout2, javax.xml.rpc.holders.StringHolder inout3, 
javax.xml.rpc.holders.StringHolder inout4, java.lang.String inonly) throws 
java.rmi.RemoteException {
          inout1.value = "out1";
          inout2.value = "out2";
          inout3.value = "out3";
          inout4.value = "out4";
          if (!inonly.equals("onlyInput")) {
              throw new java.rmi.RemoteException("Input argument didn't match expected 
'onlyInput', got: " + inonly);
          }
      }
  
      public test.wsdl.wrapped_inout.Phone echoPhone(test.wsdl.wrapped_inout.Phone 
input) throws java.rmi.RemoteException {
          return input;
      }
  
  }
  
  
  
  1.1                  xml-axis/java/test/wsdl/wrapped_inout/wrapped_inout.wsdl
  
  Index: wrapped_inout.wsdl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; 
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
      xmlns:s="http://www.w3.org/2001/XMLSchema"; 
      xmlns:s0="http://tempuri.org/"; 
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
      xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"; 
      xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
      targetNamespace="http://tempuri.org/"; 
      xmlns="http://schemas.xmlsoap.org/wsdl/";>
    <types>
      <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/";>
        <s:element name="echoString">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="inarg" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="echoStringResult" 
type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringIO">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="ioarg" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringIOResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="ioarg" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringIOret">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="ioarg" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringIOretResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="echoStringIOretResult" 
type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="ioarg" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringInIO">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="inarg" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="ioarg" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringInIOResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="ioarg" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringBig">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="inarg" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="ioarg1" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="ioarg2" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoStringBigResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="echoStringBigResult" 
type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="ioarg1" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="ioarg2" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="HelloInOut">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="inout1" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="inout2" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="inout3" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="inout4" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="inonly" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="HelloInOutResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="inout1" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="inout2" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="inout3" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="inout4" type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="echoPhone">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="input" type="s0:Phone" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:complexType name="Phone">
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="areaCode" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="prefix" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="number" type="s:string" />
          </s:sequence>
        </s:complexType>
        <s:element name="echoPhoneResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="input" type="s0:Phone" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="string" nillable="true" type="s:string" />
      </s:schema>
    </types>
    <message name="echoStringSoapIn">
      <part name="parameters" element="s0:echoString" />
    </message>
    <message name="echoStringSoapOut">
      <part name="parameters" element="s0:echoStringResponse" />
    </message>
    <message name="echoStringIOSoapIn">
      <part name="parameters" element="s0:echoStringIO" />
    </message>
    <message name="echoStringIOSoapOut">
      <part name="parameters" element="s0:echoStringIOResponse" />
    </message>
    <message name="echoStringIOretSoapIn">
      <part name="parameters" element="s0:echoStringIOret" />
    </message>
    <message name="echoStringIOretSoapOut">
      <part name="parameters" element="s0:echoStringIOretResponse" />
    </message>
    <message name="echoStringInIOSoapIn">
      <part name="parameters" element="s0:echoStringInIO" />
    </message>
    <message name="echoStringInIOSoapOut">
      <part name="parameters" element="s0:echoStringInIOResponse" />
    </message>
    <message name="echoStringBigSoapIn">
      <part name="parameters" element="s0:echoStringBig" />
    </message>
    <message name="echoStringBigSoapOut">
      <part name="parameters" element="s0:echoStringBigResponse" />
    </message>
    <message name="HelloInOutSoapIn">
      <part name="parameters" element="s0:HelloInOut" />
    </message>
    <message name="HelloInOutSoapOut">
      <part name="parameters" element="s0:HelloInOutResponse" />
    </message>
    <message name="echoPhoneSoapIn">
      <part name="parameters" element="s0:echoPhone" />
    </message>
    <message name="echoPhoneSoapOut">
      <part name="parameters" element="s0:echoPhoneResponse" />
    </message>
    <portType name="WrappedInOutInterface">
      <operation name="echoString">
        <input message="s0:echoStringSoapIn" />
        <output message="s0:echoStringSoapOut" />
      </operation>
      <operation name="echoStringIO">
        <input message="s0:echoStringIOSoapIn" />
        <output message="s0:echoStringIOSoapOut" />
      </operation>
      <operation name="echoStringIOret">
        <input message="s0:echoStringIOretSoapIn" />
        <output message="s0:echoStringIOretSoapOut" />
      </operation>
      <operation name="echoStringInIO">
        <input message="s0:echoStringInIOSoapIn" />
        <output message="s0:echoStringInIOSoapOut" />
      </operation>
      <operation name="echoStringBig">
        <input message="s0:echoStringBigSoapIn" />
        <output message="s0:echoStringBigSoapOut" />
      </operation>
      <operation name="HelloInOut">
        <input message="s0:HelloInOutSoapIn" />
        <output message="s0:HelloInOutSoapOut" />
      </operation>
      <operation name="echoPhone">
        <input message="s0:echoPhoneSoapIn" />
        <output message="s0:echoPhoneSoapOut" />
      </operation>
    </portType>
    <binding name="WrappedInOutSoap" type="s0:WrappedInOutInterface">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document" 
/>
      <operation name="echoString">
        <soap:operation soapAction="http://tempuri.org/echoString"; style="document" />
        <input>
          <soap:body use="literal" />
        </input>
        <output>
          <soap:body use="literal" />
        </output>
      </operation>
      <operation name="echoStringIO">
        <soap:operation soapAction="http://tempuri.org/echoStringIO"; style="document" 
/>
        <input>
          <soap:body use="literal" />
        </input>
        <output>
          <soap:body use="literal" />
        </output>
      </operation>
      <operation name="echoStringIOret">
        <soap:operation soapAction="http://tempuri.org/echoStringIOret"; 
style="document" />
        <input>
          <soap:body use="literal" />
        </input>
        <output>
          <soap:body use="literal" />
        </output>
      </operation>
      <operation name="echoStringInIO">
        <soap:operation soapAction="http://tempuri.org/echoStringInIO"; 
style="document" />
        <input>
          <soap:body use="literal" />
        </input>
        <output>
          <soap:body use="literal" />
        </output>
      </operation>
      <operation name="echoStringBig">
        <soap:operation soapAction="http://tempuri.org/echoStringBig"; style="document" 
/>
        <input>
          <soap:body use="literal" />
        </input>
        <output>
          <soap:body use="literal" />
        </output>
      </operation>
      <operation name="HelloInOut">
        <soap:operation soapAction="http://tempuri.org/HelloInOut"; style="document" />
        <input>
          <soap:body use="literal" />
        </input>
        <output>
          <soap:body use="literal" />
        </output>
      </operation>
      <operation name="echoPhone">
        <soap:operation soapAction="http://tempuri.org/echoPhone"; style="document" />
        <input>
          <soap:body use="literal" />
        </input>
        <output>
          <soap:body use="literal" />
        </output>
      </operation>
    </binding>
    <service name="WrappedInOut">
      <port name="WrappedInOut" binding="s0:WrappedInOutSoap">
        <soap:address location="http://localhost:8080/axis/services/WrappedInOut"; />
      </port>
    </service>
  </definitions>
  
  
  1.1                  xml-axis/java/test/wsdl/wrapped_inout/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0" ?>
  <!DOCTYPE project [
          <!ENTITY properties SYSTEM "file:../../../xmls/properties.xml">
          <!ENTITY paths  SYSTEM "file:../../../xmls/path_refs.xml">
          <!ENTITY taskdefs SYSTEM "file:../../../xmls/taskdefs.xml">
          <!ENTITY taskdefs_post_compile SYSTEM 
"file:../../../xmls/taskdefs_post_compile.xml">
          <!ENTITY targets SYSTEM "file:../../../xmls/targets.xml">
  ]>
  
  <!-- ===================================================================
  <description>
     Test/Sample Component file for Axis
  
  Notes:
     This is a build file for use with the Jakarta Ant build tool.
  
  Prerequisites:
  
     jakarta-ant from http://jakarta.apache.org
  
  Build Instructions:
     To compile
          ant compile
     To execute
          ant run
  
  Author:
    Matt Seibert [EMAIL PROTECTED]
  
  Copyright:
    Copyright (c) 2002-2003 Apache Software Foundation.
  </description>
  ==================================================================== -->
  
  <project default="compile">
  
  <property name="axis.home" location="../../.." />
  <property name="componentName" value="test/wsdl/wrapped_inout" />
          &properties;
          &paths;
          &taskdefs;
          &taskdefs_post_compile;
          &targets;
  
  <target name="clean">
      <echo message="Removing ${build.dir}/classes/${componentName} and 
${build.dir}/work/${componentName}" />
      <delete dir="${build.dir}/classes/${componentName}"/>
      <delete dir="${build.dir}/work/${componentName}"/>
  </target>
  
  <target name="copy" depends="setenv"/>
  
  <target name="compile" depends="copy">
    <echo message="Compiling test.wsdl.wrapped_inout"/>
      <!-- Wrapped Sample Test -->
      <wsdl2java url="${axis.home}/test/wsdl/wrapped_inout/wrapped_inout.wsdl"
                 output="${axis.home}/build/work"
                 serverSide="yes"
                 skeletonDeploy="no"
                 testcase="no">
          <mapping namespace="http://tempuri.org/"; package="test.wsdl.wrapped_inout"/>
      </wsdl2java>
  
      <copy todir="${build.dir}/work/test/wsdl/wrapped_inout" overwrite="yes">
        <fileset dir="${axis.home}/test/wsdl/wrapped_inout">
          <include name="*TestCase.java"/>
          <include name="*Impl.java"/>
        </fileset>
      </copy>
  
      <javac srcdir="${build.dir}/work" destdir="${build.dest}" fork="${javac.fork}"
             debug="${debug}">
        <classpath refid="classpath" />
        <include name="test/wsdl/wrapped_inout/*.java" />
      </javac>
  
  </target>
  
  <target name="run" >
    <antcall target="execute-Component" />
  </target>
  
  </project>
  
  
  
  1.40      +24 -26    
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.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- SymbolTable.java  24 Sep 2002 16:03:38 -0000      1.39
  +++ SymbolTable.java  24 Sep 2002 20:19:57 -0000      1.40
  @@ -1080,14 +1080,25 @@
               }
           }
   
  -        // Get the mode info about those parts that aren't in the
  -        // parameterOrder list. Since they're not in the parameterOrder list,
  -        // the order is, first all in (and inout) parameters, then all out
  -        // parameters, in the order they appear in the messages.
  -        for (int i = 0; i < inputs.size(); i++) {
  -            Parameter p = (Parameter)inputs.get(i);
  -            int outdex = getPartIndex(p.getName(), outputs);
  -            addInishParm(inputs, outputs, i, outdex, parameters, false);
  +        // Some special case logic for JAX-RPC, but also to make things
  +        // nicer for the user.
  +        // If we have a single input and output with the same name
  +        //   instead of: void echo(StringHolder inout)
  +        //   Do this:  string echo(string in)
  +        if (wrapped && inputs.size() == 1 && outputs.size() == 1 &&
  +        
((Parameter)inputs.get(0)).getName().equals(((Parameter)outputs.get(0)).getName())) {
  +            // add the input and make sure its a IN not an INOUT
  +            addInishParm(inputs, null, 0, -1, parameters, false);
  +        } else {
  +            // Get the mode info about those parts that aren't in the
  +            // parameterOrder list. Since they're not in the parameterOrder list,
  +            // the order is, first all in (and inout) parameters, then all out
  +            // parameters, in the order they appear in the messages.
  +            for (int i = 0; i < inputs.size(); i++) {
  +                Parameter p = (Parameter)inputs.get(i);
  +                int outdex = getPartIndex(p.getName(), outputs);
  +                addInishParm(inputs, outputs, i, outdex, parameters, false);
  +            }
           }
   
           // Now that the remaining in and inout parameters are collected,
  @@ -1110,7 +1121,7 @@
           }
           parameters.faults = operation.getFaults();
   
  -        // before we add return the paramters, 
  +        // before we return the paramters, 
           // make sure we dont have a duplicate name
           Vector used = new Vector(parameters.list.size());
           Iterator i = parameters.list.iterator();
  @@ -1169,26 +1180,13 @@
   
           // 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.
  -        
  +        // then it's an inout parameter.        
            if (outdex >= 0) {
               Parameter outParam = (Parameter)outputs.get(outdex);
               if (p.getType().equals(outParam.getType())) {
  -                
  -                // Some special case logic for JAX-RPC, but also to make things
  -                // nicer for the user.
  -                // If we have a single output, always make it the return value
  -                //   instead of: void echo(StringHolder inout)
  -                //   Do this:  string echo(string in)
  -                if (wrapped && outputs.size() == 1) {
  -                    ++parameters.inputs;
  -                } else {
  -                    outputs.remove(outdex);
  -                    p.setMode(Parameter.INOUT);
  -                    ++parameters.inouts;
  -                }
  +                outputs.remove(outdex);
  +                p.setMode(Parameter.INOUT);
  +                ++parameters.inouts;
               } else {
                   // If we're here, we have both an input and an output
                   // part with the same name but different types.... guess
  
  
  


Reply via email to