docs: private Service getServiceInstance(TransientWebServiceRefInfo tInfo, WebServiceRefInfo wsrInfo) throws Exception {
          Class<?> svcSubClass = null;
          Service instance = null;
          if (tInfo.getServiceRefTypeClass() != null && Service.class.getName().equals(tInfo.getServiceRefTypeClassName())) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Creating service instance using generic Service.create(QName)");
              }
              return Service.create(tInfo.getServiceQName());
          }
  
          if (tInfo.getServiceRefTypeClass() != null && Service.class.isAssignableFrom(tInfo.getServiceRefTypeClass())) {
              svcSubClass = tInfo.getServiceRefTypeClass();
          } else {
              svcSubClass = tInfo.getServiceInterfaceClass();
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "Attempting to create instance of service sub-class: " + svcSubClass.getName());
          }
          final Class<?> finalSvcSubClass = svcSubClass;
          Constructor<?> constructor = null;
  
          // first we get the constructor for the service subclass, we will always use
          // the URL, QName constructor because this constructor allow for null arguments
          try {
              final Constructor<?> finalConstructor = (Constructor<?>) AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                  @Override
                  public Object run() throws NoSuchMethodException {
                      return finalSvcSubClass.getDeclaredConstructor(new Class[] { URL.class, QName.class });
                  }
              });
              constructor = finalConstructor;
          } catch (PrivilegedActionException e) {
              if (e.getException() != null) {
                  throw e.getException();
              } else {
                  throw e;
              }
          }
  
          // now we will create the service instance with the constructor that was
          // previously created, it's okay if the URL we try to obtain turns out
          // to be null, a service instance will be created without the use of
          // the WSDL document we supplied
          final URL url = tInfo.getWsdlURL();
  
          //jsr-109:
  //        For co-located clients (where the client and the server are in the same Java EE application unit) with
  //        generated Service class, the location of the final WSDL document is resolved by comparing the Service name
  //        on the @WebServiceClient annotation on the the generated Service to the Service names of all the deployed
  //        port components in the Java EE application unit
  
          // Future plan need to consider:
  //        if it is a co-located clients, need to verify the defined wsdlLocation and make it use the dynamic one
  //        if there is no wsdlLocation defined, need to use the dynamic one
  //        need to consider in the ear level
  //        need to consider virtual host
  
          if (url == null)
          {
              JaxWsModuleMetaData jaxwsModuleMetaData = tInfo.getClientMetaData().getModuleMetaData();
              String applicationName = jaxwsModuleMetaData.getJ2EEName().getApplication();
              String contextRoot = jaxwsModuleMetaData.getContextRoot();
              Map<String, String> appNameURLMap = jaxwsModuleMetaData.getAppNameURLMap();
              Container moduleContainer = jaxwsModuleMetaData.getModuleContainer();
              NonPersistentCache overlayCache;
              try {
                  overlayCache = moduleContainer.adapt(NonPersistentCache.class);
                  JaxWsModuleInfo jaxWsModuleInfo = (JaxWsModuleInfo) overlayCache.getFromCache(JaxWsModuleInfo.class);
                  if (jaxWsModuleInfo != null) {
                      for (EndpointInfo endpointInfo : jaxWsModuleInfo.getEndpointInfos()) {
                          String address = endpointInfo.getAddress(0).substring(1);
                          String serviceName = wsrInfo.getServiceQName().getLocalPart();
                          if (serviceName.equals(address))
                          {
                              String wsdlLocation = null;
                              if ((appNameURLMap != null) && (!appNameURLMap.isEmpty())) {
                                  String applicationURL = appNameURLMap.get(applicationName);
                                  wsdlLocation = applicationURL + "/" + address + "?wsdl";
                              } else {
                                  wsdlLocation = getWsdlUrl() + contextRoot + "/" + address + "?wsdl";
                              }
  
                              final URL newURl = new URL(wsdlLocation);
                              wsrInfo.setWsdlLocation(wsdlLocation);
  
                              try {
                                  final Constructor<?> finalConstructor = constructor;
                                  final QName serviceQName = tInfo.getServiceQName();
                                  instance = (Service) AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                                      @Override
                                      public Object run() throws InstantiationException, IllegalAccessException, InvocationTargetException {
                                          finalConstructor.setAccessible(true);
                                          return finalConstructor.newInstance(new Object[] { newURl, serviceQName });
                                      }
                                  });
                              } catch (PrivilegedActionException e) {
                                  if (e.getException() != null) {
                                      throw e.getException();
                                  } else {
                                      throw e;
                                  }
                              }
                              break;
  
                          }
  
                      }
                  }
              } catch (UnableToAdaptException e) {
  
              }
          }
          if (instance != null)
          {
              return instance;
          }
  
          if (url != null) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Creating Service with WSDL URL: " + url + " and QName: " + tInfo.getServiceQName() + " for class: " + svcSubClass.getName());
              }
          }
          try {
              final Constructor<?> finalConstructor = constructor;
              final QName serviceQName = tInfo.getServiceQName();
              instance = (Service) AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                  @Override
                  public Object run() throws InstantiationException, IllegalAccessException, InvocationTargetException {
                      finalConstructor.setAccessible(true);
                      return finalConstructor.newInstance(new Object[] { url, serviceQName });
                  }
              });
          } catch (PrivilegedActionException e) {
              if (e.getException() != null) {
                  throw e.getException();
              } else {
                  throw e;
              }
          }
  
          return instance;
      }