/**
   * @param inSharepointClientContext The Context is passed so that necessary information can be
   *     used to create the instance of current class Web Service endpoint is set to the default
   *     SharePoint URL stored in SharePointClientContext.
   * @throws SharepointException
   */
  public WebsWS(final SharepointClientContext inSharepointClientContext)
      throws SharepointException {

    if (inSharepointClientContext != null) {
      sharepointClientContext = inSharepointClientContext;
      endpoint = Util.encodeURL(sharepointClientContext.getSiteURL()) + SPConstants.WEBSENDPOINT;
      LOGGER.log(Level.CONFIG, "Endpoint set to: " + endpoint);
      final WebsLocator loc = new WebsLocator();
      loc.setWebsSoapEndpointAddress(endpoint);
      final Webs service = loc;

      try {
        stub = (WebsSoap_BindingStub) service.getWebsSoap();
      } catch (final ServiceException e) {
        LOGGER.log(Level.WARNING, e.getMessage(), e);
        throw new SharepointException("Unable to create webs stub");
      }

      final String strDomain = inSharepointClientContext.getDomain();
      String strUser = inSharepointClientContext.getUsername();
      final String strPassword = inSharepointClientContext.getPassword();

      strUser = Util.getUserNameWithDomain(strUser, strDomain);
      stub.setUsername(strUser);
      stub.setPassword(strPassword);
      // The web service time-out value
      stub.setTimeout(sharepointClientContext.getWebServiceTimeOut());
      LOGGER.fine(
          "Set time-out of : " + sharepointClientContext.getWebServiceTimeOut() + " milliseconds");
    }
  }