private static ServiceFactory __get__(Map credentials, Map properties) throws PublicException {
    try {
      ServiceFactory result =
          (ServiceFactory)
              Reflect.createInstance(
                  Parameters.instance()
                      .getString(
                          WebProperties.WEB_SERVICE_FACTORY,
                          PredefinedConstants.PLAIN_WEB_SERVICEFACTORY_CLASS),
                  ServiceFactoryLocator.class.getClassLoader());
      result.setCredentials(credentials);

      Map mergedProps = new HashMap(properties);
      LoginUtils.mergeCredentialProperties(mergedProps, credentials);
      LoginUtils.mergeDefaultCredentials(mergedProps);

      result.setProperties(mergedProps);

      return result;
    } catch (InternalException e) {
      throw new PublicException(
          BpmRuntimeError.EJB_INVALID_SERVICE_FACTORY_CONFIGURATION.raise(e.getMessage()));
    }
  }