Package org.fao.geonet.utils

Examples of org.fao.geonet.utils.XmlRequest.execute()


        if (params.useAccount) {
            req.setCredentials(params.username, params.password);
        }

        xml = req.execute();

    //-----------------------------------------------------------------------
    //--- remove old metadata
    for (String uuid : localUuids.getUUIDs())
    {
View Full Code Here


    if (params.useAccount)
      req.setCredentials(params.username, params.password);
    CswServer server = null;
    try{
        Element capabil = req.execute();
   
            if(log.isDebugEnabled())
                log.debug("Capabilities:\n"+Xml.getString(capabil));
           
        if (capabil.getName().equals("ExceptionReport"))
View Full Code Here

      req.setAddress(servletName +"/srv/en/"+ Geonet.Service.XML_LOGIN);
      req.addParam("username", params.username);
      req.addParam("password", params.password);

      Element response = req.execute();

      if (!response.getName().equals("ok"))
        throw new UserNotFoundEx(params.username);
    }
View Full Code Here

    {
      log.info("Searching on : "+ name +"/"+ s.siteId);

      req.setAddress(servletName +"/srv/en/"+ Geonet.Service.XML_SEARCH);

      Element searchResult = req.execute(s.createRequest());

            if(log.isDebugEnabled()) log.debug("Obtained:\n"+Xml.getString(searchResult));

      //--- site alignment
      HarvestResult ar = aligner.align(searchResult, s.siteId);
View Full Code Here

      XmlRequest req = context.getBean(GeonetHttpRequestFactory.class).createXmlRequest();
      req.setUrl(new URL(url));
      req.setMethod(XmlRequest.Method.GET);
      Lib.net.setupProxy(context, req);

      xml = req.execute();
    } catch (SSLHandshakeException e) {
      throw new BadServerCertificateEx(
        "Most likely cause: The thredds catalog "+url+" does not have a "+
        "valid certificate. If you feel this is because the server may be "+
        "using a test certificate rather than a certificate from a well "+
View Full Code Here

        req.setCredentials(params.username, params.password);
                req.setPreemptiveBasicAuth(true);
        req.setAddress(params.getServletPath()+"/srv/eng/xml.info");
                req.addParam("type", "me");

        Element response = req.execute();
        if(!response.getName().equals("info") || response.getChild("me") == null) {
          pre29Login(req);
        } else if(!"true".equals(response.getChild("me").getAttributeValue("authenticated"))) {
                    log.warning("Authentication failed for user: " + params.username);
                    throw new UserNotFoundEx(params.username);
View Full Code Here

    req.setAddress(params.getServletPath() +"/srv/en/"+ Geonet.Service.XML_INFO);
    req.clearParams();
    req.addParam("type", "sources");
    req.addParam("type", "groups");

    Element remoteInfo = req.execute();

    if (!remoteInfo.getName().equals("info"))
      throw new BadServerResponseEx(remoteInfo);

    //--- perform all searches
View Full Code Here

        Element elem = list.get(i);
        req.addParam(elem.getName(), elem.getText());
      }
    }

    Element result = req.execute();
    return result;
  }

  //--------------------------------------------------------------------------
View Full Code Here

    req.setAddress(params.getServletPath() +"/srv/en/"+ Geonet.Service.XML_METADATA_RATE);
    req.clearParams();
    req.addParam("uuid",   uuid);
    req.addParam("rating", rating);

    Element response = req.execute();

    if (!response.getName().equals(Params.RATING))
      throw new BadServerResponseEx(response);

    return Integer.parseInt(response.getText());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.