code: @SuppressWarnings("unchecked")
      private static <T> T getHighLevelElementByServiceImplBean(String portLink, Adaptable containerToAdapt, Class<T> clazz, LinkType linkType) throws UnableToAdaptException {
          if (null == portLink) {
              return null;
          }
          if (PortComponent.class.isAssignableFrom(clazz)
              || WebserviceDescription.class.isAssignableFrom(clazz)) {
              Webservices wsXml = containerToAdapt.adapt(Webservices.class);
              if (null == wsXml) {
                  return null;
              }
              for (WebserviceDescription wsDes : wsXml.getWebServiceDescriptions()) {
                  if (wsDes.getPortComponents().size() == 0) {
                      continue;
                  }
                  for (PortComponent portCmpt : wsDes.getPortComponents()) {
                      ServiceImplBean servImplBean = portCmpt.getServiceImplBean();
  
                      String serviceLink = LinkType.SERVLET == linkType ? servImplBean.getServletLink() : servImplBean.getEJBLink();
  
                      if (serviceLink == null) {
                          continue;
                      } else if (serviceLink.equals(portLink)) {
                          if (PortComponent.class.isAssignableFrom(clazz)) {
                              return (T) portCmpt;
                          } else {
                              return (T) wsDes;
                          }
                      }
                  }
              }
              return null;
          }
          return null;
      }
docs: For internal usage. Can only process the PortComponent.class and WebserviceDescription.class.
  
  @param portLink
  @param containerToAdapt
  @param clazz
  @return
  @throws UnableToAdaptException