From: Jiří Škrábal Date: Wed, 20 Oct 2004 08:56:36 +0000 (+0000) Subject: - function GetVersion added X-Git-Tag: glite-deployment_D_20041021~15 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=c8ce3c56f12d7ac4a44c116e3904b5dae6a43beb;p=jra1mw.git - function GetVersion added --- diff --git a/org.glite.lb.server/Makefile b/org.glite.lb.server/Makefile index 6c0018d..3354d89 100644 --- a/org.glite.lb.server/Makefile +++ b/org.glite.lb.server/Makefile @@ -49,8 +49,10 @@ DEBUG:=-g -O0 -Wall # -I/usr/include/libxml2 \ # -DNO_VOMS -DNO_GACL to be removed when voms/gridsite are available -CFLAGS:= -DNO_VOMS -DNO_GACL ${WS_CFLAGS} \ - ${DEBUG} -I${stagedir}/include -I${top_srcdir}/src -I. \ +CFLAGS:= -DNO_VOMS -DNO_GACL \ + ${WS_CFLAGS} ${DEBUG} \ + -DVERSION=\"${version}\" \ + -I${stagedir}/include -I${top_srcdir}/src -I. \ -I${expat_prefix}/include \ -I${ares_prefix}/include \ -I${gsoap_prefix}/include \ @@ -161,7 +163,10 @@ test_soap_conv: test_soap_conv.cpp ${WS_CLIENT_OBJS} ${CXX} -c ${CFLAGS} ${TEST_INC} $< ${LINKXX} -o $@ test_soap_conv.o ${WS_CLIENT_OBJS} ${WS_CLIENT_LIBS} ${COMMON_LIB} ${TEST_LIBS} -examples: ws_jobstat ws_query_ex +examples: ws_getversion ws_jobstat ws_query_ex + +ws_getversion: ws_getversion.o ${WS_CLIENT_OBJS} + ${LINK} -o $@ ws_getversion.o ${WS_CLIENT_OBJS} ${WS_CLIENT_LIBS} ${EXT_LIBS} ws_jobstat: ws_jobstat.o ${WS_CLIENT_OBJS} ${LINK} -o $@ ws_jobstat.o ${WS_CLIENT_OBJS} ${WS_CLIENT_LIBS} ${EXT_LIBS} diff --git a/org.glite.lb.server/examples/ws_getversion.c b/org.glite.lb.server/examples/ws_getversion.c new file mode 100644 index 0000000..89bea11 --- /dev/null +++ b/org.glite.lb.server/examples/ws_getversion.c @@ -0,0 +1,60 @@ +#include +#include + +#include "glite/lb/consumer.h" + +#include "ws_plugin.h" +#include "bk_ws_H.h" + +static struct option opts[] = { + {"help", 0, NULL, 'h'}, + {"server", 1, NULL, 'm'}, +}; + +static void usage(char *me) +{ + fprintf(stderr,"usage: %s [option]\n" + "\t-h, --help Shows this screen.\n" + "\t-m, --server BK server address:port.\n" + , me); +} + +static void printstat(edg_wll_JobStat stat, int level); + +int main(int argc,char** argv) +{ + edg_wll_Context ctx; + struct soap *mydlo = soap_new(); + struct edgwll2__GetVersionResponse out; + int opt, err; + char *server = "http://localhost:8999/", + *name = NULL; + + + name = strrchr(argv[0],'/'); + if (name) name++; else name = argv[0]; + + while ((opt = getopt_long(argc, argv, "hm:", opts, NULL)) != EOF) switch (opt) + { + case 'h': usage(name); return 0; + case 'm': server = strdup(optarg); break; + case '?': usage(name); return 1; + } + + edg_wll_InitContext(&ctx); + + if ( soap_register_plugin_arg(mydlo, edg_wll_ws_plugin, (void *)ctx) ) + { + soap_print_fault(mydlo, stderr); + return 1; + } + + switch (err = soap_call_edgwll2__GetVersion(mydlo, server, "", &out)) + { + case SOAP_OK: printf("Server version: %s\n", out.version); break; + case SOAP_FAULT: + default: printf("???\n"); + } + + return 0; +} diff --git a/org.glite.lb.server/project/LB.wsdl b/org.glite.lb.server/project/LB.wsdl index 33e39d1..4313f00 100644 --- a/org.glite.lb.server/project/LB.wsdl +++ b/org.glite.lb.server/project/LB.wsdl @@ -198,6 +198,11 @@ + + + + + @@ -225,6 +230,19 @@ + + Query the version of LB servere + +Input: no input + +Output: Version of LB server + +Faults: GenericLBFault + + + + + Retrieve state of a single job. @@ -280,6 +298,18 @@ Faults: GenericLBFault + + + + + + + + + + + + diff --git a/org.glite.lb.server/src/ws_query.c b/org.glite.lb.server/src/ws_query.c index 60dd118..b37a9f2 100644 --- a/org.glite.lb.server/src/ws_query.c +++ b/org.glite.lb.server/src/ws_query.c @@ -12,6 +12,15 @@ #include "ws_typeref.h" +int edgwll2__GetVersion( + struct soap *soap, + struct edgwll2__GetVersionResponse *out) +{ + out->version = strdup(VERSION); + + return SOAP_OK; +} + int edgwll2__JobStatus( struct soap *soap, char *jobid,