code: public void addSchema(String version, TypesType typesType, MessageInfo recMessageInfo)
      {
          String name = this.fixName(recMessageInfo.getField(MessageInfo.DESCRIPTION).toString());
          
          Import importel = schemaFactory.createImport();
          typesType.getAny().add(importel);
          String code = recMessageInfo.getField(MessageInfo.CODE).toString();
          if (code == null)
              code = name;
          String namespace = ((PropertiesField)recMessageInfo.getField(MessageInfo.MESSAGE_PROPERTIES)).getProperty(MessageInfo.NAMESPACE);
          String element = ((PropertiesField)recMessageInfo.getField(MessageInfo.MESSAGE_PROPERTIES)).getProperty(MessageInfo.ELEMENT);
          String schemaLocation = ((PropertiesField)recMessageInfo.getField(MessageInfo.MESSAGE_PROPERTIES)).getProperty(MessageInfo.SCHEMA_LOCATION);
          
          if (namespace == null)
              namespace = this.getMessageControl().getNamespaceFromVersion(version);
          if (element == null)
              if (code != null)
                  element = code;
          if (schemaLocation == null)
              if (code != null)
                  schemaLocation = code + ".xsd";
          schemaLocation = this.getMessageControl().getSchemaLocation(version, schemaLocation);
          if (namespace != null)
              importel.setNamespace(namespace);
          importel.setSchemaLocation(schemaLocation);
      }
docs: AddSchema Method.