src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
/**
     * This method attempts to find anonymous types in the parameter list of 
     * web-service methods to determine if the type should be exposed.
     * @param wsContext
     */
This method attempts to find anonymous types in the parameter list of
web-service methods to determine if the type should be exposed.
@param wsContext
This method attempts to find anonymous types in the parameter list of web - service methods to determine if the type should be exposed . @param wsContext
private void exposeMessagePartsThatAreAnonymousTypes(WebServiceContext wsContext)
    {
        Collection types = c_symbolTable.getTypeIndex().values();
        Iterator typeIterator = types.iterator();   
        while(typeIterator.hasNext())
        {
            Object highLevelType = typeIterator.next();
            if(!(highLevelType instanceof BaseType))
            {
                DefinedType type = (DefinedType)highLevelType;
                if(type.getQName().getLocalPart().toString().startsWith(">"))
                {
                    if(c_veryVerbose)
                        System.out.println( "EXPOSE2: Checking whether to expose anon type "+type.getQName().getLocalPart());
                    ArrayList methods = wsContext.getServiceInfo().getMethods();
                    for(int i=0; i<methods.size(); i++)
                    {
                          MethodInfo method = (MethodInfo)methods.get(i);
                          Collection faultTypes = method.getFaultType();
                          Iterator faultIterator = faultTypes.iterator();
                          while(faultIterator.hasNext())
                          {
                              FaultInfo faultType = (FaultInfo)faultIterator.next();
                              Collection parameterTypes = faultType.getParams();
                              Iterator paramIterator = parameterTypes.iterator();
                              while(paramIterator.hasNext())
                              {
                                  ParameterInfo parameterInfo =(ParameterInfo)paramIterator.next();
                                  Type parameterType = parameterInfo.getType();
                                  if(c_veryVerbose)
                                      System.out.println( "EXPOSE2: Exposing fault type "+parameterType.getName());
                                  externalizeTypeAndUpdateTypeMap(wsContext, parameterType);
                              }                              
                          }
                          Collection inputParameterTypes = method.getInputParameterTypes();
                          Iterator paramIterator = inputParameterTypes.iterator();
                          while(paramIterator.hasNext())
                          {
                              ParameterInfo parameterInfo =(ParameterInfo)paramIterator.next();
                              Type parameterType = parameterInfo.getType();
                              if(parameterType.getName().equals(type.getQName()))
                              {
                                  if(c_veryVerbose)
                                      System.out.println( "EXPOSE2: Matches input parm, exposing anon type "+parameterType.getName());
                                  externalizeTypeAndUpdateTypeMap(wsContext, parameterType);
                              }
                          }
                          Collection outputParameterTypes = method.getOutputParameterTypes();
                          paramIterator = outputParameterTypes.iterator();
                          while(paramIterator.hasNext())
                          {
                              ParameterInfo parameterInfo =(ParameterInfo)paramIterator.next();
                              Type parameterType = parameterInfo.getType();
                              if(parameterType.getName().equals(type.getQName()))
                              {
                                  if(c_veryVerbose)
                                      System.out.println( "EXPOSE2: Matches output parm, exposing anon type "+parameterType.getName());                             
                                  externalizeTypeAndUpdateTypeMap(wsContext, parameterType);
                              }
                          }
                    }
                }
            }
        }
    }
private void exposeMessagePartsThatAreAnonymousTypes ( WebServiceContext wsContext ) { Collection types = c_symbolTable . getTypeIndex ( ) . values ( ) ; Iterator typeIterator = types . iterator ( ) ; while ( typeIterator . hasNext ( ) ) { Object highLevelType = typeIterator . next ( ) ; if ( ! ( highLevelType instanceof BaseType ) ) { DefinedType type = ( DefinedType ) highLevelType ; if ( type . getQName ( ) . getLocalPart ( ) . toString ( ) . startsWith ( ">" ) ) { if ( c_veryVerbose ) System . out . println ( "EXPOSE2: Checking whether to expose anon type " + type . getQName ( ) . getLocalPart ( ) ) ; ArrayList methods = wsContext . getServiceInfo ( ) . getMethods ( ) ; for ( int i = 0 ; i < methods . size ( ) ; i ++ ) { MethodInfo method = ( MethodInfo ) methods . get ( i ) ; Collection faultTypes = method . getFaultType ( ) ; Iterator faultIterator = faultTypes . iterator ( ) ; while ( faultIterator . hasNext ( ) ) { FaultInfo faultType = ( FaultInfo ) faultIterator . next ( ) ; Collection parameterTypes = faultType . getParams ( ) ; Iterator paramIterator = parameterTypes . iterator ( ) ; while ( paramIterator . hasNext ( ) ) { ParameterInfo parameterInfo = ( ParameterInfo ) paramIterator . next ( ) ; Type parameterType = parameterInfo . getType ( ) ; if ( c_veryVerbose ) System . out . println ( "EXPOSE2: Exposing fault type " + parameterType . getName ( ) ) ; externalizeTypeAndUpdateTypeMap ( wsContext , parameterType ) ; } } Collection inputParameterTypes = method . getInputParameterTypes ( ) ; Iterator paramIterator = inputParameterTypes . iterator ( ) ; while ( paramIterator . hasNext ( ) ) { ParameterInfo parameterInfo = ( ParameterInfo ) paramIterator . next ( ) ; Type parameterType = parameterInfo . getType ( ) ; if ( parameterType . getName ( ) . equals ( type . getQName ( ) ) ) { if ( c_veryVerbose ) System . out . println ( "EXPOSE2: Matches input parm, exposing anon type " + parameterType . getName ( ) ) ; externalizeTypeAndUpdateTypeMap ( wsContext , parameterType ) ; } } Collection outputParameterTypes = method . getOutputParameterTypes ( ) ; paramIterator = outputParameterTypes . iterator ( ) ; while ( paramIterator . hasNext ( ) ) { ParameterInfo parameterInfo = ( ParameterInfo ) paramIterator . next ( ) ; Type parameterType = parameterInfo . getType ( ) ; if ( parameterType . getName ( ) . equals ( type . getQName ( ) ) ) { if ( c_veryVerbose ) System . out . println ( "EXPOSE2: Matches output parm, exposing anon type " + parameterType . getName ( ) ) ; externalizeTypeAndUpdateTypeMap ( wsContext , parameterType ) ; } } } } } } }
This method attempts to find anonymous types in the parameter list of
 web-service methods to determine if the type should be exposed.
This method attempts to find anonymous types in the parameter list of web - service methods to determine if the type should be exposed .
// get the main types // this is an "inner" type that will not be exposed // however, it needs to be if it is referenced in a message part. // check all the messages // Check for faults that need to be externalized // Check input parameters // Check output parameters