code: void launchAddServiceProviderDialog(final String federation) {
          ComboBoxItem securityDomains = new ComboBoxItem("security-domain", "Security Domain");
          securityDomains.setRequired(true);
          securityDomains.setValueMap(this.securityDomains);
  
          DefaultWindow dialog = new DefaultWindow(Console.MESSAGES.newTitle("Service Provider"));
          ResourceDescription resourceDescription = descriptionRegistry.lookup(SERVICE_PROVIDER_TEMPLATE);
          //noinspection Duplicates
          AddResourceDialog addDialog = new AddResourceDialog(securityContext, resourceDescription,
                  new AddResourceDialog.Callback() {
                      @Override
                      public void onAdd(ModelNode payload) {
                          dialog.hide();
  
                          String name = payload.get("name").asString();
                          ResourceAddress address = SERVICE_PROVIDER_TEMPLATE.resolve(statementContext, federation, name);
                          payload.get(OP).set(ADD);
                          payload.get(ADDRESS).set(address);
                          dispatcher.execute(new DMRAction(payload), new SimpleCallback<DMRResponse>() {
                              @Override
                              public void onFailure(Throwable caught) {
                                  super.onFailure(caught);
                                  readServiceProvider(federation);
                              }
  
                              @Override
                              public void onSuccess(DMRResponse dmrResponse) {
                                  Console.info(Console.MESSAGES.successfullyAdded((name)));
                                  readServiceProvider(federation);
                              }
                          });
                      }
  
                      @Override
                      public void onCancel() {
                          dialog.hide();
                      }
                  })
                  .addFactory("security-domain", attributeDescription -> securityDomains)
                  .include();
  
          dialog.setWidth(640);
          dialog.setHeight(480);
          dialog.setWidget(addDialog);
          dialog.setGlassEnabled(true);
          dialog.center();
      }
docs: ------------------------------------------------------ crud service provider