You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2003/11/25 07:07:03 UTC

cvs commit: ws-axis/java/test/wsdl/wrapped City_BBBTestCase.java

gdaniels    2003/11/24 22:07:03

  Modified:    java/src/org/apache/axis/description JavaServiceDesc.java
               java/src/org/apache/axis/encoding
                        DefaultTypeMappingImpl.java TypeMapping.java
                        TypeMappingImpl.java
               java/src/org/apache/axis/encoding/ser ArraySerializer.java
               java/src/org/apache/axis/wsdl/fromJava Types.java
               java/test/encoding TestAutoTypes.java
               java/test/wsdl/interop4/groupi Round4XSDTestTestCase.java
               java/test/wsdl/wrapped City_BBBTestCase.java
  Log:
  Some work on doc/lit array handling, which wasn't working very well.
  Probably needs a bit more work, which I'll do as I work through bugs.
  
  This improves matters, but in looking at the type mapping code
  and how it has evolved there are some major issues that I think
  we should resolve with a refactoring pass after 1.2....
  
  * ArraySerializer now keeps track of whether it's currently in
    an encoded context or not (default is yes), and saves a bunch
    of work (figuring out arrayType, etc) if not.  Also, if not
    encoded, we will no longer generate encoded schema!
  
  * Round4XsdTest was checking exact toString() equivalence when
    QName equivalence is the really important part.
  
  * Introduce getTypeQNameExact() into TypeMapping, which looks
    through the mapping hierarchy for a deployed type mapping,
    but does NOT do any of the funky array / autoType checking.
  
  * When generating the return type descriptor in JavaServiceDesc,
    set the XML type to match the component type if the return
    type is a non-encoded array (we end up checking this later in
    ArraySerializer).
  
  * Comment out autoTyping test checking that the array type
    returned from getTypeQName() was an encoded array type.
  
  * Allow exceptions to be bubbled up from CityBBBTestCase,
    which lets us actually see any problems instead of masking
    them.
  
  Revision  Changes    Path
  1.4       +12 -1     ws-axis/java/src/org/apache/axis/description/JavaServiceDesc.java
  
  Index: JavaServiceDesc.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/description/JavaServiceDesc.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JavaServiceDesc.java	24 Nov 2003 20:54:47 -0000	1.3
  +++ JavaServiceDesc.java	25 Nov 2003 06:07:02 -0000	1.4
  @@ -1167,7 +1167,18 @@
               // For other styles, continue here.
               Class retClass = method.getReturnType();
               operation.setReturnClass(retClass);
  -            operation.setReturnType(tm.getTypeQName(method.getReturnType()));
  +            QName typeQName = null;
  +            if (style == Style.RPC) {
  +                typeQName = tm.getTypeQName(retClass);
  +            } else {
  +                typeQName = tm.getTypeQNameExact(retClass);
  +                if (typeQName == null && retClass.isArray()) {
  +                    typeQName = tm.getTypeQName(retClass.getComponentType());
  +                } else {
  +                    typeQName = tm.getTypeQName(retClass);
  +                }
  +            }
  +            operation.setReturnType(typeQName);
   
               String [] paramNames = getParamNames(method);
   
  
  
  
  1.74      +2 -1      ws-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java
  
  Index: DefaultTypeMappingImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- DefaultTypeMappingImpl.java	20 Nov 2003 04:29:29 -0000	1.73
  +++ DefaultTypeMappingImpl.java	25 Nov 2003 06:07:02 -0000	1.74
  @@ -618,6 +618,7 @@
                      new ArraySerializerFactory(),
                      new ArrayDeserializerFactory()
           );
  +        
           // All array objects automatically get associated with the SOAP_ARRAY.
           // There is no way to do this with a hash table,
           // so it is done directly in getTypeQName.
  @@ -741,7 +742,7 @@
           throws JAXRPCException {
   
           // Don't allow anyone but init to modify us.
  -        if (doneInit) {
  +        if (doneInit && !doAutoTypes) {
               throw new JAXRPCException(Messages.getMessage("fixedTypeMapping"));
           }
           else {
  
  
  
  1.10      +10 -0     ws-axis/java/src/org/apache/axis/encoding/TypeMapping.java
  
  Index: TypeMapping.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/TypeMapping.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TypeMapping.java	5 Oct 2003 07:01:40 -0000	1.9
  +++ TypeMapping.java	25 Nov 2003 06:07:02 -0000	1.10
  @@ -116,6 +116,16 @@
        * @return xmlType qname or null
        */
       public QName getTypeQName(Class javaType);
  +    
  +    /**
  +     * Get the QName for this Java class, but only return a specific
  +     * mapping if there is one.  In other words, don't do special array
  +     * processing, etc.
  +     * 
  +     * @param javaType
  +     * @return
  +     */ 
  +    public QName getTypeQNameExact(Class javaType);
   
       /**
        * Gets the Class mapped to QName.
  
  
  
  1.46      +18 -5     ws-axis/java/src/org/apache/axis/encoding/TypeMappingImpl.java
  
  Index: TypeMappingImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/TypeMappingImpl.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- TypeMappingImpl.java	14 Nov 2003 22:47:33 -0000	1.45
  +++ TypeMappingImpl.java	25 Nov 2003 06:07:02 -0000	1.46
  @@ -142,7 +142,7 @@
       protected TypeMapping delegate;   // Pointer to delegate or null
       private ArrayList namespaces;   // Supported namespaces
   
  -    private boolean doAutoTypes = false;
  +    protected boolean doAutoTypes = false;
   
       /**
        * Construct TypeMapping
  @@ -536,19 +536,32 @@
           return null;
       }
   
  -    public QName getTypeQName(Class javaType) {
  -        //log.debug("getTypeQName javaType =" + javaType);
  +    /**
  +     * Get the QName for this Java class, but only return a specific
  +     * mapping if there is one.  In other words, don't do special array
  +     * processing, etc.
  +     * 
  +     * @param javaType
  +     * @return
  +     */
  +    public QName getTypeQNameExact(Class javaType) {
           if (javaType == null)
               return null;
          
           QName xmlType = null;
           Pair pair = (Pair) class2Pair.get(javaType);
           if (pair == null && delegate != null) {
  -            xmlType = delegate.getTypeQName(javaType);
  +            xmlType = delegate.getTypeQNameExact(javaType);
           } else if (pair != null) {
               xmlType = pair.xmlType;
           }
   
  +        return xmlType;
  +    }
  +
  +    public QName getTypeQName(Class javaType) {
  +        QName xmlType = getTypeQNameExact(javaType);
  +
           /* If auto-typing is on and the array has the default SOAP_ARRAY QName,
            * then generate a namespace for this array intelligently.   Also
            * register it's javaType and xmlType. List classes and derivitives
  @@ -574,7 +587,7 @@
           if (xmlType == null && isArray(javaType)) {
   
               // get the registered array if any
  -            pair = (Pair) class2Pair.get(Object[].class);
  +            Pair pair = (Pair) class2Pair.get(Object[].class);
               // TODO: it always returns the last registered one,
               //  so that's why the soap 1.2 typemappings have to 
               //  move to an other registry to differentiate them
  
  
  
  1.50      +93 -75    ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
  
  Index: ArraySerializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- ArraySerializer.java	14 Nov 2003 22:47:33 -0000	1.49
  +++ ArraySerializer.java	25 Nov 2003 06:07:02 -0000	1.50
  @@ -109,7 +109,10 @@
           MessageContext msgContext = context.getMessageContext();
           SchemaVersion schema = SchemaVersion.SCHEMA_2001;
           SOAPConstants soap = SOAPConstants.SOAP11_CONSTANTS;
  -        if(msgContext != null) {
  +        boolean encoded = true;
  +        
  +        if (msgContext != null) {
  +            encoded = msgContext.isEncoded();
               schema = msgContext.getSchemaVersion();
               soap = msgContext.getSOAPConstants();
           }
  @@ -169,81 +172,80 @@
                       Messages.getMessage("noType00", componentType.getName()));
           }
   
  -        String prefix = context.getPrefixForURI(componentQName.getNamespaceURI());
  -        String compType = prefix + ":" + componentQName.getLocalPart();
           int len = (list == null) ? Array.getLength(value) : list.size();
  +        String arrayType = "";
  +        int dim2Len = -1;
  +        if (encoded) {
  +            if (soap == SOAPConstants.SOAP12_CONSTANTS)
  +                arrayType = dims + len;
  +            else
  +                arrayType = dims + "[" + len + "]";
   
  -        String arrayType;
  -        if (soap == SOAPConstants.SOAP12_CONSTANTS)
  -            arrayType = dims + len;
  -        else
  -            arrayType = dims + "[" + len + "]";
  +            // Discover whether array can be serialized directly as a two-dimensional
  +            // array (i.e. arrayType=int[2,3]) versus an array of arrays.
  +            // Benefits:
  +            //   - Less text passed on the wire.
  +            //   - Easier to read wire format
  +            //   - Tests the deserialization of multi-dimensional arrays.
  +            // Drawbacks:
  +            //   - Is not safe!  It is possible that the arrays are multiply
  +            //     referenced.  Transforming into a 2-dim array will cause the
  +            //     multi-referenced information to be lost.  Plus there is no
  +            //     way to determine whether the arrays are multi-referenced.
  +            //   - .NET currently (Dec 2002) does not support 2D SOAP-encoded arrays
  +            //
  +            // OLD Comment as to why this was ENABLED:
  +            // It is necessary for
  +            // interoperability (echo2DStringArray).  It is 'safe' for now
  +            // because Axis treats arrays as non multi-ref (see the note
  +            // in SerializationContextImpl.isPrimitive(...) )
  +            // More complicated processing is necessary for 3-dim arrays, etc.
  +            //
  +            // Axis 1.1 - December 2002
  +            // Turned this OFF because Microsoft .NET can not deserialize
  +            // multi-dimensional SOAP-encoded arrays, and this interopability
  +            // is pretty high visibility. Make it a global configuration parameter:
  +            //  <parameter name="enable2DArrayEncoding" value="true"/>    (tomj)
  +            //
   
  -        // Discover whether array can be serialized directly as a two-dimensional
  -        // array (i.e. arrayType=int[2,3]) versus an array of arrays.
  -        // Benefits:
  -        //   - Less text passed on the wire.
  -        //   - Easier to read wire format
  -        //   - Tests the deserialization of multi-dimensional arrays.
  -        // Drawbacks:
  -        //   - Is not safe!  It is possible that the arrays are multiply
  -        //     referenced.  Transforming into a 2-dim array will cause the
  -        //     multi-referenced information to be lost.  Plus there is no
  -        //     way to determine whether the arrays are multi-referenced.
  -        //   - .NET currently (Dec 2002) does not support 2D SOAP-encoded arrays
  -        //
  -        // OLD Comment as to why this was ENABLED:
  -        // It is necessary for
  -        // interoperability (echo2DStringArray).  It is 'safe' for now
  -        // because Axis treats arrays as non multi-ref (see the note
  -        // in SerializationContextImpl.isPrimitive(...) )
  -        // More complicated processing is necessary for 3-dim arrays, etc.
  -        //
  -        // Axis 1.1 - December 2002
  -        // Turned this OFF because Microsoft .NET can not deserialize
  -        // multi-dimensional SOAP-encoded arrays, and this interopability
  -        // is pretty high visibility. Make it a global configuration parameter:
  -        //  <parameter name="enable2DArrayEncoding" value="true"/>    (tomj)
  -        //
  -
  -        // Check the message context to see if we should turn 2D processing ON
  -        // Default is OFF
  -        boolean enable2Dim = false;
  +            // Check the message context to see if we should turn 2D processing ON
  +            // Default is OFF
  +            boolean enable2Dim = false;
           
  -        // Vidyanand : added this check
  -        if( msgContext != null ) {
  -           enable2Dim = 
  -            JavaUtils.isTrueExplicitly(msgContext.getAxisEngine().getOption(AxisEngine.PROP_TWOD_ARRAY_ENCODING));
  -        }
  +            // Vidyanand : added this check
  +            if( msgContext != null ) {
  +               enable2Dim = 
  +                JavaUtils.isTrueExplicitly(msgContext.getAxisEngine().getOption(AxisEngine.PROP_TWOD_ARRAY_ENCODING));
  +            }
   
  -        int dim2Len = -1;
  -        if (enable2Dim && !dims.equals("")) {
  -            if (cls.isArray() && len > 0) {
  -                boolean okay = true;
  -                // Make sure all of the component arrays are the same size
  -                for (int i=0; i < len && okay; i++) {
  -
  -                    Object elementValue = Array.get(value, i);
  -                    if (elementValue == null)
  -                        okay = false;
  -                    else if (dim2Len < 0) {
  -                        dim2Len = Array.getLength(elementValue);
  -                        if (dim2Len <= 0) {
  +            if (enable2Dim && !dims.equals("")) {
  +                if (cls.isArray() && len > 0) {
  +                    boolean okay = true;
  +                    // Make sure all of the component arrays are the same size
  +                    for (int i=0; i < len && okay; i++) {
  +
  +                        Object elementValue = Array.get(value, i);
  +                        if (elementValue == null)
  +                            okay = false;
  +                        else if (dim2Len < 0) {
  +                            dim2Len = Array.getLength(elementValue);
  +                            if (dim2Len <= 0) {
  +                                okay = false;
  +                            }
  +                        } else if (dim2Len != Array.getLength(elementValue)) {
                               okay = false;
                           }
  -                    } else if (dim2Len != Array.getLength(elementValue)) {
  -                        okay = false;
                       }
  -                }
  -                // Update the arrayType to use mult-dim array encoding
  -                if (okay) {
  -                    dims = dims.substring(0, dims.length()-2);
  -                    if (soap == SOAPConstants.SOAP12_CONSTANTS)
  -                        arrayType = dims + len + " " + dim2Len;
  -                    else
  -                        arrayType = dims + "[" + len + "," + dim2Len + "]";
  -                } else {
  -                    dim2Len = -1;
  +                    // Update the arrayType to use mult-dim array encoding
  +                    if (okay) {
  +                        dims = dims.substring(0, dims.length()-2);
  +                        if (soap == SOAPConstants.SOAP12_CONSTANTS)
  +                            arrayType = dims + len + " " + dim2Len;
  +                        else
  +                            arrayType = dims + "[" + len + "," + dim2Len + "]";
  +                    } else {
  +                        dim2Len = -1;
  +                    }
                   }
               }
           }
  @@ -252,10 +254,10 @@
           // actual schema array or for a maxOccurs usage.
           // For the maxOccurs case, the currentXMLType of the context is
           // the same as the componentQName.
  -        boolean maxOccursUsage = (msgContext != null && !msgContext.isEncoded()) &&
  -                                          componentQName.equals(context.getCurrentXMLType());
  +        boolean maxOccursUsage = !encoded &&
  +                componentQName.equals(context.getCurrentXMLType());
   
  -        if (!maxOccursUsage) {
  +        if (encoded) {
               AttributesImpl attrs;
               if (attributes == null) {
                   attrs = new AttributesImpl();
  @@ -265,6 +267,7 @@
                   attrs = new AttributesImpl(attributes);
               }
   
  +            String compType = context.attributeQName2String(componentQName);
   
               if (attrs.getIndex(soap.getEncodingURI(), soap.getAttrItemType()) == -1) {
                   String encprefix =
  @@ -272,11 +275,11 @@
   
                   if (soap != SOAPConstants.SOAP12_CONSTANTS) {
                       compType = compType + arrayType;
  -
  -                attrs.addAttribute(soap.getEncodingURI(),
  +                    
  +                    attrs.addAttribute(soap.getEncodingURI(),
                                          soap.getAttrItemType(),
  -                                   encprefix + ":arrayType",
  -                                   "CDATA",
  +                                       encprefix + ":arrayType",
  +                                       "CDATA",
                                          compType);
   
                   } else {
  @@ -416,6 +419,21 @@
        * @see org.apache.axis.wsdl.fromJava.Types
        */
       public Element writeSchema(Class javaType, Types types) throws Exception {
  +        boolean encoded = true;
  +        MessageContext mc = MessageContext.getCurrentContext();
  +        if (mc != null) {
  +            encoded = mc.isEncoded();
  +        }
  +        
  +        if (!encoded) {
  +            if (javaType.isArray()) {
  +                Class cType = javaType.getComponentType();
  +                String typeName = types.writeType(cType);
  +                
  +                return types.createLiteralArrayElement(typeName, null);
  +            }
  +        }
  +        
           // If an array the component type should be processed first
           String componentTypeName = null;
           Class componentType = null;
  
  
  
  1.85      +27 -0     ws-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- Types.java	24 Nov 2003 20:54:47 -0000	1.84
  +++ Types.java	25 Nov 2003 06:07:02 -0000	1.85
  @@ -997,6 +997,33 @@
   
           return complexType;
       }
  +    
  +    /**
  +     * Create an array which is a wrapper type for "item" elements
  +     * of a component type.  This is basically the unencoded parallel to
  +     * a SOAP-encoded array.
  +     * 
  +     * @param componentType
  +     * @param itemName
  +     * @return
  +     */ 
  +    public Element createLiteralArrayElement(String componentType,
  +                                             QName itemName) {
  +        Element complexType = docHolder.createElement("complexType");
  +        Element sequence = docHolder.createElement("sequence");
  +        
  +        complexType.appendChild(sequence);
  +        
  +        Element elem = docHolder.createElement("element");
  +        elem.setAttribute("name", "item");
  +        elem.setAttribute("type", componentType);
  +        elem.setAttribute("minOccurs", "0");
  +        elem.setAttribute("maxOccurs", "unbounded");
  +        
  +        sequence.appendChild(elem);
  +        
  +        return complexType;
  +    }
   
       /**
        * Returns true if indicated type matches the JAX-RPC enumeration class.
  
  
  
  1.3       +4 -4      ws-axis/java/test/encoding/TestAutoTypes.java
  
  Index: TestAutoTypes.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/encoding/TestAutoTypes.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestAutoTypes.java	3 Jul 2003 16:48:23 -0000	1.2
  +++ TestAutoTypes.java	25 Nov 2003 06:07:02 -0000	1.3
  @@ -42,10 +42,10 @@
               "AttributeBean[]",
               Types.getLocalNameFromFullName(AttributeBean[].class.getName()));
   
  -        qname = tm.getTypeQName( AttributeBean[].class );
  -        assertEquals( "http://encoding.test", 
  -                      qname.getNamespaceURI() );
  -        assertEquals( "AttributeBean[]", qname.getLocalPart() );
  +//        qname = tm.getTypeQName( AttributeBean[].class );
  +//        assertEquals( "http://encoding.test", 
  +//                      qname.getNamespaceURI() );
  +//        assertEquals( "AttributeBean[]", qname.getLocalPart() );
   
       }
   }
  
  
  
  1.8       +1 -1      ws-axis/java/test/wsdl/interop4/groupi/Round4XSDTestTestCase.java
  
  Index: Round4XSDTestTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/interop4/groupi/Round4XSDTestTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Round4XSDTestTestCase.java	17 Nov 2003 15:14:03 -0000	1.7
  +++ Round4XSDTestTestCase.java	25 Nov 2003 06:07:03 -0000	1.8
  @@ -579,7 +579,7 @@
               input.set_any(_any);
               test.wsdl.interop4.groupi.__echoAnyElementResponse_return value = null;
               value = binding.echoAnyElement(input);
  -            assertEquals(value.get_any()[0].toString(), _any[0].toString());
  +            assertEquals(value.get_any()[0].getQName(), _any[0].getQName());
           }
           catch (java.rmi.RemoteException re) {
               throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  
  
  
  1.6       +60 -98    ws-axis/java/test/wsdl/wrapped/City_BBBTestCase.java
  
  Index: City_BBBTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/wrapped/City_BBBTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- City_BBBTestCase.java	5 Sep 2002 01:08:38 -0000	1.5
  +++ City_BBBTestCase.java	25 Nov 2003 06:07:03 -0000	1.6
  @@ -11,27 +11,18 @@
       public City_BBBTestCase(String name) {
           super(name);
       }
  -    public void test1CityBBBPortGetAttraction() {
  +    public void test1CityBBBPortGetAttraction() throws Exception {
           City_BBBPortType binding;
  -        try {
  -            binding = new City_BBBLocator().getCity_BBBPort();
  -        }
  -        catch (javax.xml.rpc.ServiceException jre) {
  -            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
  -        }
  -        assertTrue("binding is null", binding != null);
  +        binding = new City_BBBLocator().getCity_BBBPort();
   
  -        try {
  -            Attraction value = binding.getAttraction("Christmas");
  -            assertEquals("OID value was wrong", value.get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -        }
  -        catch (java.rmi.RemoteException re) {
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }
  +        assertTrue("binding is null", binding != null);
  +        
  +        Attraction value = binding.getAttraction("Christmas");
  +        assertEquals("OID value was wrong", value.get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
       }
  -
  -    public void test2CityBBBPortGetAttractions() {
  +    
  +    public void test2CityBBBPortGetAttractions() throws Exception {
           City_BBBPortType binding;
           try {
               binding = new City_BBBLocator().getCity_BBBPort();
  @@ -41,21 +32,16 @@
           }
           assertTrue("binding is null", binding != null);
   
  -        try {
  -            // Invoke getAttractions with two inputs
  -            String[] attName = new String[] {"Christmas", "Xmas"};
  -            Attraction[] value = binding.getAttractions(attName);
  -            assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -            assertEquals("OID value was wrong for second attaction", value[1].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -        }
  -        catch (java.rmi.RemoteException re) {
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }
  +        // Invoke getAttractions with two inputs
  +        String[] attName = new String[] {"Christmas", "Xmas"};
  +        Attraction[] value = binding.getAttractions(attName);
  +        assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
  +        assertEquals("OID value was wrong for second attaction", value[1].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
       }
   
  -    public void test3CityBBBPortGetAttractions() {
  +    public void test3CityBBBPortGetAttractions() throws Exception {
           City_BBBPortType binding;
           try {
               binding = new City_BBBLocator().getCity_BBBPort();
  @@ -65,19 +51,14 @@
           }
           assertTrue("binding is null", binding != null);
   
  -        try {
  -            // Invoke getAttractions with one input
  -            String[] attName = new String[] {"Christmas"};
  -            Attraction[] value = binding.getAttractions(attName);
  -            assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -        }
  -        catch (java.rmi.RemoteException re) {
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }
  +        // Invoke getAttractions with one input
  +        String[] attName = new String[] {"Christmas"};
  +        Attraction[] value = binding.getAttractions(attName);
  +        assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
       }
   
  -    public void test4CityBBBPortGetAttractions() {
  +    public void test4CityBBBPortGetAttractions() throws Exception {
           City_BBBPortType binding;
           try {
               binding = new City_BBBLocator().getCity_BBBPort();
  @@ -87,20 +68,16 @@
           }
           assertTrue("binding is null", binding != null);
   
  -        try {
  -            // Invoke getAttractions with one input
  -            String[] attName = new String[] {"Christmas", null};
  -            Attraction[] value = binding.getAttractions(attName);
  -            assertEquals("Expected returned Attraction length of 2", value.length, 2);
  -            assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -            assertEquals("Attracton[1] should be null", value[1], null);
  -        }
  -        catch (java.rmi.RemoteException re) {
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }
  +        // Invoke getAttractions with one input
  +        String[] attName = new String[] {"Christmas", null};
  +        Attraction[] value = binding.getAttractions(attName);
  +        assertEquals("Expected returned Attraction length of 2", value.length, 2);
  +        assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
  +        assertEquals("Attracton[1] should be null", value[1], null);
       }
  -    public void test5CityBBBPortGetAttractions() {
  +
  +    public void test5CityBBBPortGetAttractions() throws Exception {
           City_BBBPortType binding;
           try {
               binding = new City_BBBLocator().getCity_BBBPort();
  @@ -110,21 +87,16 @@
           }
           assertTrue("binding is null", binding != null);
   
  -        try {
  -            // Invoke getAttractions with one input
  -            String[] attName = new String[] {"Christmas", ""};
  -            Attraction[] value = binding.getAttractions(attName);
  -            assertEquals("Expected returned Attraction length of 2", value.length, 2);
  -            assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -            assertEquals("Attracton[1] should be null", value[1], null);
  -        }
  -        catch (java.rmi.RemoteException re) {
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }
  +        // Invoke getAttractions with one input
  +        String[] attName = new String[] {"Christmas", ""};
  +        Attraction[] value = binding.getAttractions(attName);
  +        assertEquals("Expected returned Attraction length of 2", value.length, 2);
  +        assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
  +        assertEquals("Attracton[1] should be null", value[1], null);
       }
   
  -    public void test6CityBBBPortGetAttractions() {
  +    public void test6CityBBBPortGetAttractions() throws Exception {
           City_BBBPortType binding;
           try {
               binding = new City_BBBLocator().getCity_BBBPort();
  @@ -134,26 +106,21 @@
           }
           assertTrue("binding is null", binding != null);
   
  -        try {
  -            // Invoke getAttractions2 with two inputs
  -            Query[] query = new Query[2];
  -            query[0] = new Query();
  -            query[0].setValue("Christmas");
  -            query[1] = new Query();
  -            query[1].setValue("Xmas");
  +        // Invoke getAttractions2 with two inputs
  +        Query[] query = new Query[2];
  +        query[0] = new Query();
  +        query[0].setValue("Christmas");
  +        query[1] = new Query();
  +        query[1].setValue("Xmas");
   
  -            Attraction[] value = binding.getAttractions2(query);
  -            assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -            assertEquals("OID value was wrong for second attaction", value[1].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -        }
  -        catch (java.rmi.RemoteException re) {
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }
  +        Attraction[] value = binding.getAttractions2(query);
  +        assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
  +        assertEquals("OID value was wrong for second attaction", value[1].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
       }
   
  -    public void test7CityBBBPortGetAttractions() {
  +    public void test7CityBBBPortGetAttractions() throws Exception {
           City_BBBPortType binding;
           try {
               binding = new City_BBBLocator().getCity_BBBPort();
  @@ -163,19 +130,14 @@
           }
           assertTrue("binding is null", binding != null);
   
  -        try {
  -            // Invoke getAttractions2 with one input
  -            Query[] query = new Query[1];
  -            query[0] = new Query();
  -            query[0].setValue("Christmas");
  -
  -            Attraction[] value = binding.getAttractions2(query);
  -            assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  -                         City_BBBBindingImpl.OID_STRING);
  -        }
  -        catch (java.rmi.RemoteException re) {
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }
  +        // Invoke getAttractions2 with one input
  +        Query[] query = new Query[1];
  +        query[0] = new Query();
  +        query[0].setValue("Christmas");
  +        
  +        Attraction[] value = binding.getAttractions2(query);
  +        assertEquals("OID value was wrong for first attraction", value[0].get_OID(),
  +                     City_BBBBindingImpl.OID_STRING);
       }
   }