axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gobe Hobona <gehob...@yahoo.com>
Subject WSDL2Java and convertToNMTOKENS
Date Tue, 15 May 2007 17:50:50 GMT
Hi all,

When generating stubs using WSDL2Java one of the generated classes calls the following method:

org.apache.axis2.databinding.utils.ConverterUtil.convertToNMTokens()

However, the name should be convertToNMTOKENS...in uppercase.

The generated method is below

This causes the generates stubs to fail compilation.

I edited the method call to "TOKENS" and it worked fine but this should not be necessary.

Is this a bug?

Gobe

////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////

    public static RangeType parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
            RangeType object = new RangeType();
            int event;
            java.lang.String nillableValue = null;
            java.lang.String prefix ="";
            java.lang.String namespaceuri ="";
            try {
                
                while (!reader.isStartElement() && !reader.isEndElement())
                    reader.next();
                
                if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){
                  java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
                        "type");
                  if (fullTypeName!=null){
                    java.lang.String nsPrefix = null;
                    if (fullTypeName.indexOf(":") > -1){
                        nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":"));
                    }
                    nsPrefix = nsPrefix==null?"":nsPrefix;
                    java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1);
                    
                            if (!"RangeType".equals(type)){
                                //find namespace for the prefix
                                java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
                                return (RangeType)uk.ac.ncl.sawgeo.grid.processingservice_instance.ExtensionMapper.getTypeObject(
                                     nsUri,type,reader);
                              }
                        
                  }
                }
                
                
                // Note all attributes that were handled. Used to differ normal attributes
                // from anyAttributes.
                java.util.Vector handledAttributes = new java.util.Vector();
                
                 
                    // handle attribute "rangeClosure"
                    java.lang.String tempAttribrangeClosure =
                      reader.getAttributeValue("http://www.opengeospatial.net/ows","rangeClosure");
                   if (tempAttribrangeClosure!=null){
                         java.lang.String content = tempAttribrangeClosure;
                        
                                                 object.setRangeClosure(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToNMTokens(tempAttribrangeClosure));
                                            
                    } else {
                       
                               throw new RuntimeException("Required attribute rangeClosure
is missing");
                           
                    }
                    handledAttributes.add("rangeClosure");
                    
                    
                    reader.next();
                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement())
reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.opengeospatial.net/ows","MinimumValue").equals(reader.getName())){
                                
                                        object.setMinimumValue(net.opengeospatial.www.ows.ValueType.Factory.parse(reader));
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement())
reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.opengeospatial.net/ows","MaximumValue").equals(reader.getName())){
                                
                                        object.setMaximumValue(net.opengeospatial.www.ows.ValueType.Factory.parse(reader));
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement())
reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.opengeospatial.net/ows","Spacing").equals(reader.getName())){
                                
                                        object.setSpacing(net.opengeospatial.www.ows.ValueType.Factory.parse(reader));
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                  
                            while (!reader.isStartElement() && !reader.isEndElement())
                                reader.next();
                            if (reader.isStartElement())
                                // A start element we are not expecting indicates a trailing
invalid property
                                throw new java.lang.RuntimeException("Unexpected subelement
" + reader.getLocalName());
                        

            } catch (javax.xml.stream.XMLStreamException e) {
                throw new java.lang.Exception(e);
            }
            return object;
        }


       
____________________________________________________________________________________You snooze,
you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
Mime
View raw message