If you know the URL of the server and the name of the layer to which you want to connect, you can use the model decoder to create a WMS model:

static ILcdModel createWMSModelFromString(ILcyLucyEnv aLucyEnv) throws IOException {
  String serverName = "https://sampleservices.luciad.com/wms";
  String layerName = "92c09725-a9c5-46fb-bffd-d9e23b4abbf2";
  //The source name passed to the model decoder should include the server
  //and the layer name
  String sourceName = serverName + "?data=" + layerName;

  //Create a composite model decoder based on the decoders registered on the back-end
  TLcyCompositeModelDecoder modelDecoder = new TLcyCompositeModelDecoder(aLucyEnv);
  if (modelDecoder.canDecodeSource(sourceName)) {
    return modelDecoder.decode(sourceName);
  }
  return null;
}

or use an ILcdDataSource:

static ILcdModel createWMSModelFromDataSource(ILcyLucyEnv aLucyEnv) throws IOException {
  String serverName = "https://sampleservices.luciad.com/wms";
  String layerName = "92c09725-a9c5-46fb-bffd-d9e23b4abbf2";
  //Create data source
  TLcdWMSDataSource dataSource = TLcdWMSDataSource.newBuilder()
                                                  .uri(serverName)
                                                  .addLayer(layerName)
                                                  .build();

  //Create a composite model decoder based on the decoders registered on the back-end
  TLcyCompositeModelDecoder modelDecoder = new TLcyCompositeModelDecoder(aLucyEnv);
  if (modelDecoder.canDecodeSource(dataSource)) {
    return modelDecoder.decodeSource(dataSource);
  }
  return null;
}