axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject cvs commit: xml-axis/java/test/arrays ArrayTest.wsdl Main.java PersonalInfoBookSOAPBindingImpl.java
Date Tue, 04 Dec 2001 23:53:03 GMT
scheu       01/12/04 15:53:03

  Modified:    java/test/arrays ArrayTest.wsdl Main.java
                        PersonalInfoBookSOAPBindingImpl.java
  Log:
  There were some questions on the chat concerning
      - returning of xsd:int
      - returning of an array of xsd:int
  
  JAX-RPC indicates that xsd:int maps to a java int.
  An array of xsd:int maps to int[]
  
  I changed the ArrayTest to verify compliance with JAX-RPC
     (added getIDFromName which returns an array of xsd:int &
      added getID2FromName which returns an xsd:int)
  
  The test verifies that that Stub properly returns int and int[]
     - for the int[] return, the Stub uses the JavaUtils.convert fix that I added today.
     - for the int return, the Stub invokes Integer.getValue() on the object returned by the
Call object.
  
  So the Stub complies with JAX-RPC.
  
  ---------------------------------------------------------
  Now as far as what the Call object should be returning in these cases...that is a separate
  question.  Perhaps the Call object should return int[] (not ArrayList) for the first case.
  For the second case maybe it should return an IntHolder (to avoid confusion with Integer).
  But this is all a separate discussion.
  
  Enjoy!
  
  Revision  Changes    Path
  1.7       +62 -0     xml-axis/java/test/arrays/ArrayTest.wsdl
  
  Index: ArrayTest.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/arrays/ArrayTest.wsdl,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ArrayTest.wsdl	2001/12/04 22:11:47	1.6
  +++ ArrayTest.wsdl	2001/12/04 23:53:03	1.7
  @@ -32,6 +32,16 @@
             </xsd:restriction>
           </xsd:complexContent>
         </xsd:complexType>
  +
  +      <xsd:complexType name="intArray">
  +        <xsd:complexContent>
  +          <xsd:restriction base="soapenc:Array">
  +            <xsd:sequence>
  +              <xsd:element name="alias" type="xsd:int" maxOccurs="unbounded"/>
  +            </xsd:sequence>
  +          </xsd:restriction>
  +        </xsd:complexContent>
  +      </xsd:complexType>
   <!--
         <xsd:complexType name="foodArray">
               <xsd:sequence>
  @@ -52,6 +62,8 @@
               <xsd:element name="hobbies" type="typens:hobbyArray"/>
               <!-- Style 3: Array defined using derivation of soapenc:Array -->
               <xsd:element name="pets" type="typens:petArray"/>
  +            <xsd:element name="id"   type="typens:intArray"/>
  +            <xsd:element name="id2"  type="xsd:int"/>
               <!-- Microsoft 1 (not JAX-RPC): Array defined using sequence of single unbounded
element -->
               <!-- <xsd:element name="foods" type="typens:foodArray"/> -->
               <!-- Microsoft 2 (not JAX-RPC): Array defined using single unbounded element
-->
  @@ -86,6 +98,22 @@
       <part name="pets" type="typens:petArray"/>
     </message>
   
  +  <message name="GetIDFromNameRequest">
  +    <part name="name" type="xsd:string"/>
  +  </message>
  +
  +  <message name="GetIDFromNameResponse">
  +    <part name="id" type="typens:intArray"/>
  +  </message>
  +
  +  <message name="GetID2FromNameRequest">
  +    <part name="name" type="xsd:string"/>
  +  </message>
  +
  +  <message name="GetID2FromNameResponse">
  +    <part name="id" type="xsd:int"/>
  +  </message>
  +
     <!-- port type declns -->
     <portType name="PersonalInfoBook">
       <operation name="addEntry">
  @@ -99,6 +127,14 @@
         <input message="tns:GetPetsFromNameRequest"/>
         <output message="tns:GetPetsFromNameResponse"/>
       </operation>
  +    <operation name="getIDFromName">
  +      <input message="tns:GetIDFromNameRequest"/>
  +      <output message="tns:GetIDFromNameResponse"/>
  +    </operation>
  +    <operation name="getID2FromName">
  +      <input message="tns:GetID2FromNameRequest"/>
  +      <output message="tns:GetID2FromNameResponse"/>
  +    </operation>
     </portType>
   
     <!-- binding declns -->
  @@ -132,6 +168,32 @@
         </output>
       </operation>
       <operation name="getPetsFromName">
  +      <soap:operation soapAction=""/>
  +      <input>
  +        <soap:body use="encoded"
  +                   namespace="urn:ArrayTest"
  +                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  +      </input>
  +      <output>
  +        <soap:body use="encoded"
  +                   namespace="urn:ArrayTest"
  +                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  +      </output>
  +    </operation>
  +    <operation name="getIDFromName">
  +      <soap:operation soapAction=""/>
  +      <input>
  +        <soap:body use="encoded"
  +                   namespace="urn:ArrayTest"
  +                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  +      </input>
  +      <output>
  +        <soap:body use="encoded"
  +                   namespace="urn:ArrayTest"
  +                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  +      </output>
  +    </operation>
  +    <operation name="getID2FromName">
         <soap:operation soapAction=""/>
         <input>
           <soap:body use="encoded"
  
  
  
  1.7       +16 -1     xml-axis/java/test/arrays/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/arrays/Main.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Main.java	2001/12/04 22:11:47	1.6
  +++ Main.java	2001/12/04 23:53:03	1.7
  @@ -75,10 +75,12 @@
       static String[] movies = new String[] { "Star Trek", "A.I." };
       static String[] hobbies= new String[] { "programming", "reading about programming"
};
       static String[] pets   = new String[] { "Byte", "Nibbles" };
  +    static int[]    id     = new int[]    { 0, 0, 7 };
  +    static int id2         = 123;
       static String[] foods  = new String[] { "Cheeze Whiz", "Jolt Cola" };
       static String[] games  = new String[] { "Doom", "Axis & Allies" };
       static byte[]   nickName = new byte[] { 'g', 'e', 'e', 'k' };
  -    static PersonalInfo pi = new PersonalInfo(name,movies,hobbies,pets,
  +    static PersonalInfo pi = new PersonalInfo(name,movies,hobbies,pets, id, id2,
                                                 //foods,games,
                                                 nickName);
       
  @@ -104,6 +106,15 @@
               System.err.print(" \"" + (String) pets[i] + "\"");
           System.err.println("");
   
  +        System.err.print ("\tId=");
  +        for(int i=0; i<id.length; i++)
  +            System.err.print(" \"" + id[i] + "\"");
  +        System.err.println("");
  +
  +        System.err.print ("\tId2="+id2);
  +        System.err.println("");
  +
  +
           /*
           Object[] foods =pi.getFoods();
           System.err.print ("\tFavorite Foods=");
  @@ -133,6 +144,10 @@
   
           // Get just the pets to test return of an array.
           pets = pib.getPetsFromName (name);
  +        // Get just the id to test return of an int array.
  +        id = pib.getIDFromName (name);
  +        // Get just id2 to test return of int.
  +        id2 = pib.getID2FromName (name);
           System.err.println (">> Response is:");
           printPersonalInfo (resp);
           pib.addEntry (name, pi);
  
  
  
  1.3       +6 -0      xml-axis/java/test/arrays/PersonalInfoBookSOAPBindingImpl.java
  
  Index: PersonalInfoBookSOAPBindingImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/arrays/PersonalInfoBookSOAPBindingImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PersonalInfoBookSOAPBindingImpl.java	2001/12/04 22:11:47	1.2
  +++ PersonalInfoBookSOAPBindingImpl.java	2001/12/04 23:53:03	1.3
  @@ -19,4 +19,10 @@
       public String[] getPetsFromName(java.lang.String name) throws java.rmi.RemoteException
{
           return ((test.arrays.PersonalInfo) table.get(name)).getPets();
       }
  +    public int[] getIDFromName(java.lang.String name) throws java.rmi.RemoteException {
  +        return ((test.arrays.PersonalInfo) table.get(name)).getId();
  +    }
  +    public int getID2FromName(java.lang.String name) throws java.rmi.RemoteException {
  +        return ((test.arrays.PersonalInfo) table.get(name)).getId2();
  +    }
   }
  
  
  

Mime
View raw message