private void createStubs()

in src/org/jetbrains/tfsIntegration/core/TfsBeansHolder.java [100:153]


  private void createStubs(Credentials authorizedCredentials, @Nullable ProgressIndicator pi)
    throws RemoteException, HostNotApplicableException {
    LOG.assertTrue(!ApplicationManager.getApplication().isDispatchThread());

    String piText = pi != null ? pi.getText() : null;

    if (pi != null) {
      pi.setText(TFSBundle.message("loading.services"));
    }

    final ConfigurationContext configContext = WebServiceHelper.getStubConfigurationContext();

    RegistrationStub registrationStub =
      new RegistrationStub(configContext, TfsUtil.appendPath(myServerUri, TFSConstants.REGISTRATION_ASMX));
    WebServiceHelper.setupStub(registrationStub, authorizedCredentials, myServerUri);
    final GetRegistrationEntries getRegistrationEntriesParam = new GetRegistrationEntries();
    ArrayOfFrameworkRegistrationEntry registrationEntries =
      registrationStub.getRegistrationEntries(getRegistrationEntriesParam).getGetRegistrationEntriesResult();

    String isccProvider =
      findServicePath(registrationEntries, TFSConstants.VERSION_CONTROL_ENTRY_TYPE, TFSConstants.ISCC_PROVIDER_SERVICE_NAME);
    if (isccProvider == null) {
      throw new HostNotApplicableException(null);
    }
    String isccProvider4 =
      findServicePath(registrationEntries, TFSConstants.VERSION_CONTROL_ENTRY_TYPE, TFSConstants.ISCC_PROVIDER_4_SERVICE_NAME,
                      TFSConstants.ISCC_PROVIDER_SERVICE_NAME);
    if (isccProvider4 == null) {
      throw new HostNotApplicableException(null);
    }
    String download = findServicePath(registrationEntries, TFSConstants.VERSION_CONTROL_ENTRY_TYPE, TFSConstants.DOWNLOAD_SERVICE_NAME);
    if (download == null) {
      throw new HostNotApplicableException(null);
    }
    String upload = findServicePath(registrationEntries, TFSConstants.VERSION_CONTROL_ENTRY_TYPE, TFSConstants.UPLOAD_SERVICE_NAME);
    if (upload == null) {
      throw new HostNotApplicableException(null);
    }
    String workItemService =
      findServicePath(registrationEntries, TFSConstants.WORK_ITEM_TRACKING_ENTRY_TYPE, TFSConstants.WORKITEM_SERVICE_NAME);
    if (workItemService == null) {
      throw new HostNotApplicableException(null);
    }
    String groupSecurityService =
      findServicePath(registrationEntries, TFSConstants.VSTFS_ENTRY_TYPE, TFSConstants.GROUP_SECURITY_SERVICE_NAME);
    if (groupSecurityService == null) {
      throw new HostNotApplicableException(null);
    }
    doCreateStubs(configContext, isccProvider, isccProvider4, download, upload, workItemService, groupSecurityService);

    if (pi != null) {
      pi.setText(piText);
    }
  }