private ClientConfig createClientConfig(CodeGenContext codeGenCtx) {

    InputOptions inputOptions = codeGenCtx.getInputOptions();

    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setGroup(inputOptions.getClientCfgGroupName());
    // put serviceNametag in cc.xml only if pre 2.4 consumer
    if (codeGenCtx.getInputOptions().isServiceNameRequired())
      clientConfig.setServiceName(codeGenCtx.getServiceQName().toString());
    String svcInterfaceName =
        CodeGenUtil.toQualifiedClassName(codeGenCtx.getServiceInterfaceClassName());
    clientConfig.setServiceInterfaceClassName(svcInterfaceName);
    if (inputOptions.getSvcCodeGenDefType() == null) {
      clientConfig.setServiceLocation(inputOptions.getServiceLocation());
      clientConfig.setWsdlLocation(inputOptions.getWSDLLocation());
    } else {
      ServiceCodeGenDefType svcCodeGenDef = inputOptions.getSvcCodeGenDefType();
      clientConfig.setServiceLocation(svcCodeGenDef.getServiceInfo().getServiceLocation());
      clientConfig.setWsdlLocation(svcCodeGenDef.getServiceInfo().getWsdlLocation());
    }

    ClientGroupConfig clientGrpCfg = createClientGroupConfig(codeGenCtx);
    clientConfig.setClientInstanceConfig(clientGrpCfg);

    return clientConfig;
  }
  public void generate(CodeGenContext codeGenCtx) throws CodeGenFailedException {

    ClientConfigList clientCfgList = null;

    InputOptions inputOptions = codeGenCtx.getInputOptions();
    ServiceCodeGenDefType svcCodeGenDef = inputOptions.getSvcCodeGenDefType();
    // If config info is specified in XML
    if (svcCodeGenDef != null
        && svcCodeGenDef.getConfigInfo() != null
        && svcCodeGenDef.getConfigInfo().getClientCfg() != null) {
      ConfigType configType = svcCodeGenDef.getConfigInfo();
      clientCfgList = configType.getClientCfg();
    } else {
      clientCfgList = createClientConfigList(codeGenCtx);
    }

    generateClientConfigXml(codeGenCtx, clientCfgList);
  }