Back to index

nordugrid-arc-nox  1.1.0~rc6
test_service.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include <iostream>
00006 #include <signal.h>
00007 #include <unistd.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/MCCLoader.h>
00014 
00015 #ifdef WIN32
00016 #include <arc/win32.h>
00017 #endif
00018 
00019 int main(void) {
00020   signal(SIGTTOU,SIG_IGN);
00021   signal(SIGTTIN,SIG_IGN);
00022   Arc::Logger logger(Arc::Logger::rootLogger, "Test");
00023   Arc::LogStream logcerr(std::cerr);
00024   Arc::Logger::rootLogger.addDestination(logcerr);
00025   // Load service chain
00026   logger.msg(Arc::INFO, "Creating service side chain");
00027   Arc::Config service_config("service.xml");
00028   if(!service_config) {
00029     logger.msg(Arc::ERROR, "Failed to load service configuration");
00030     return -1;
00031   };
00032   Arc::MCCLoader service_loader(service_config);
00033   logger.msg(Arc::INFO, "Service side MCCs are loaded");
00034   logger.msg(Arc::INFO, "Service is waiting for requests");
00035   for(;;) {
00036    sleep(10);
00037   }
00038   return 0;
00039 }