code: public static FedoraAPIA getStub(String protocol,
                                           String host,
                                           int port,
                                           String username,
                                           String password)
              throws MalformedURLException, ServiceException {
          if (!"http".equalsIgnoreCase(protocol)
                  && !"https".equalsIgnoreCase(protocol)) {
              throw new javax.xml.rpc.ServiceException("The protocol" + " "
                      + protocol + " is not supported by this service.");
          }
  
          Map<String, Object> props = new HashMap<String, Object>();
          props.put("mtom-enabled", Boolean.FALSE);
  
          org.apache.cxf.jaxws.JaxWsProxyFactoryBean clientFactory =
                  new org.apache.cxf.jaxws.JaxWsProxyFactoryBean();
          clientFactory.setAddress(protocol + "://" + host + ":" + port
                  + "/fedora/services/access");
          clientFactory.setServiceClass(FedoraAPIA.class);
          clientFactory.setUsername(username);
          clientFactory.setPassword(password);
          clientFactory.setProperties(props);
  //        LoggingInInterceptor log1 = new LoggingInInterceptor(new PrintWriter(System.out));
  //        LoggingOutInterceptor log2 = new LoggingOutInterceptor(new PrintWriter(System.out));
  //        clientFactory.getInInterceptors().add(log1);
  //        clientFactory.getInInterceptors().add(log2);
          PrintStream syserr = System.err;
          System.setErr(System.out);
          FedoraAPIA service = (FedoraAPIA) clientFactory.create();
          System.setErr(syserr);
          syserr = null;
  
          if (Administrator.INSTANCE == null) {
              // if running without Administrator, don't wrap it with the statusbar stuff
              return service;
          } else {
              return new APIAStubWrapper(service);
          }
      }
docs: Method to rewrite the default API-A base URL (specified in the service
  locator class FedoraAPIAServiceLocator). In this case we allow the
  protocol, host, and port parts of the service URL to be replaced. A SOAP
  stub will be returned with the desired service endpoint URL.
  
  @param protocol
  @param host
  @param port
  @param username
  @param password
  @return FedoraAPIA SOAP stub
  @throws MalformedURLException
  @throws ServiceException