Back to index

nordugrid-arc-nox  1.1.0~rc6
test_cache_check.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include <map>
00006 #include <iostream>
00007 #include <signal.h>
00008 
00009 #include <arc/ArcConfig.h>
00010 #include <arc/Logger.h>
00011 #include <arc/message/SOAPEnvelope.h>
00012 #include <arc/message/PayloadSOAP.h>
00013 #include <arc/message/MCC.h>
00014 #include <arc/message/MCCLoader.h>
00015 #include <arc/URL.h>
00016 #include <arc/client/ClientInterface.h>
00017 
00018 int main(void) {
00019 
00020   Arc::Logger logger(Arc::Logger::rootLogger, "Test");
00021   Arc::LogStream logcerr(std::cerr);
00022   Arc::Logger::rootLogger.addDestination(logcerr);
00023   logger.msg(Arc::INFO, "Creating client side chain");
00024 
00025   std::string id;
00026   std::string url("https://localhost:60000/arex");
00027   Arc::NS ns;
00028   Arc::MCCConfig cfg;
00029 
00030   cfg.AddProxy("/home/roczei/.globus/proxy.pem");
00031   //cfg.AddCADir("/Users/roczei/arc1/etc/certificates");
00032 
00033   Arc::ClientSOAP client(cfg, url, 60);
00034 
00035 
00036     std::string faultstring;
00037 
00038     Arc::PayloadSOAP request(ns);
00039     Arc::XMLNode req = request.NewChild("CacheCheck").NewChild("TheseFilesNeedToCheck");
00040 
00041     req.NewChild("FileURL") = "http://knowarc1.grid.niif.hu/storage/kiir";
00042 
00043     req.NewChild("FileURL") = "http://knowarc1.grid.niif.hu/storage/Makefile";
00044 
00045     req.NewChild("FileURL") = "http://knowarc1.grid.niif.hu/storage/rossz_file";
00046 
00047 
00048     Arc::PayloadSOAP* response;
00049 
00050     Arc::MCC_Status status = client.process(&request, &response);
00051 
00052     if (!status) {
00053            std::cerr << "Request failed" << std::endl;
00054     }
00055 
00056     std::string str;
00057     response->GetDoc(str, true);
00058     std::cout << str << std::endl;
00059 
00060    return 0;  
00061 };
00062