axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/providers/java WSIFPort_Java.java
Date Fri, 23 Aug 2002 14:13:00 GMT
whitlock    2002/08/23 07:13:00

  Modified:    java/src/org/apache/wsif/providers/ejb
                        WSIFOperation_EJB.java
               java/src/org/apache/wsif/providers/java WSIFPort_Java.java
  Log:
  Remove exception from mainline code and police encoding and style better
  
  Revision  Changes    Path
  1.13      +15 -11    xml-axis-wsif/java/src/org/apache/wsif/providers/ejb/WSIFOperation_EJB.java
  
  Index: WSIFOperation_EJB.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/ejb/WSIFOperation_EJB.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WSIFOperation_EJB.java	20 Aug 2002 11:52:07 -0000	1.12
  +++ WSIFOperation_EJB.java	23 Aug 2002 14:12:59 -0000	1.13
  @@ -428,23 +428,27 @@
   
           // Get the TypeMappings from the binding
           Iterator bindingIterator =
  -            this
  -                .fieldPortModel
  -                .getBinding()
  -                .getExtensibilityElements()
  -                .iterator();
  +            fieldPortModel.getBinding().getExtensibilityElements().iterator();
  +
  +        // Choose the first typeMap that has encoding=Java and style=Java. 
  +        // Ignore any other typeMap's that have other encodings and styles.
           while (bindingIterator.hasNext()) {
  -            try {
  -                typeMapping = (TypeMapping) bindingIterator.next();
  -                if (typeMapping.getEncoding().equals("Java"))
  +            Object next = bindingIterator.next();
  +            if (next instanceof TypeMapping) {
  +                typeMapping = (TypeMapping) next;
  +                if ("Java".equals(typeMapping.getEncoding()) &&
  +                    "Java".equals(typeMapping.getStyle()))
                       break;
  -            } catch (ClassCastException exn) {
  -                Trc.exception(exn);
  +                typeMapping = null;
               }
           }
   
           if (typeMapping == null) {
  -            throw new WSIFException("Definition does not contain TypeMapping");
  +            QName bindingName = fieldPortModel.getBinding().getQName();
  +            throw new WSIFException(
  +                "Binding "
  +                    + (bindingName == null ? "<null>" : bindingName.toString())
  +                    + " does not contain a typeMap with encoding=Java and style=Java");
           }
   
           // Build the hashmap 
  
  
  
  1.7       +11 -2     xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFPort_Java.java
  
  Index: WSIFPort_Java.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFPort_Java.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WSIFPort_Java.java	31 Jul 2002 16:56:47 -0000	1.6
  +++ WSIFPort_Java.java	23 Aug 2002 14:12:59 -0000	1.7
  @@ -248,17 +248,26 @@
           // Get the TypeMappings from the binding
           Iterator bindingIterator =
               this.fieldPortModel.getBinding().getExtensibilityElements().iterator();
  +            
  +        // Choose the first typeMap that has encoding=Java and style=Java. 
  +        // Ignore any other typeMap's that have other encodings and styles.
           while (bindingIterator.hasNext()) {
               Object next = bindingIterator.next();
               if (next instanceof TypeMapping) {
                   typeMapping = (TypeMapping) next;
  -                if (typeMapping.getEncoding().equals("Java"))
  +                if ("Java".equals(typeMapping.getEncoding()) &&
  +                    "Java".equals(typeMapping.getStyle()))
                       break;
  +                typeMapping = null;
               }
           }
   
           if (typeMapping == null) {
  -            throw new WSIFException("Definition does not contain TypeMapping");
  +            QName bindingName = fieldPortModel.getBinding().getQName();
  +            throw new WSIFException(
  +                "Binding "
  +                    + (bindingName == null ? "<null>" : bindingName.toString())
  +                    + " does not contain a typeMap with encoding=Java and style=Java");
           }
   
           // Build the hashmap 
  
  
  

Mime
View raw message