Added error propaggation from sever to client.
Warning cleanup.
More slaves as default (feeds no + 2).
GLOBUS_CFLAGS:=-I${globus_prefix}/include/${nothrflavour}
-DEBUG:=-W -Wall -Wno-unused-parameter -Wno-unused-function -g -O0
+DEBUG:=-W -Wall -g -O0
CPPFLAGS:=-DDEBUG -D_GNU_SOURCE -I. -I${top_srcdir}/interface -I${top_srcdir}/src -I${gsoap_prefix}/include -I${gsoap_prefix} -I${stagedir}/include ${GLOBUS_CFLAGS} -I${mysql_prefix}/include -I${mysql_prefix}/include/mysql -I${gsoap_prefix}/include
-CFLAGS:=${DEBUG}
+CFLAGS:=${DEBUG} ${CFLAGS}
LDFLAGS:=-L${stagedir}/lib
dotless_soap_ver:=${shell echo ${gsoap_version} | tr -d . }
MANS8:=glite-jp-indexd.8
MANS:=${MANS1} ${MANS8}
HTMLS:=glite-jpis-client.html glite-jp-indexd.html
-is_prefix:=jpis_
-is_client_prefix:=jpis_client_
-ps_prefix:=jpps_
+ws_prefix:=jp_
+is_prefix:=${ws_prefix}
+ps_prefix:=${ws_prefix}
-SRCS:= conf.c bones_server.c soap_ops.c soap_ps_calls.c \
- ws_ps_typeref.c ws_is_typeref.c db_ops.c context.c common_server.c \
- ${is_prefix}ServerLib.c \
- ${ps_prefix}ClientLib.c ${ps_prefix}C.c
+SRCS:= conf.c bones_server.c soap_ops.c soap_ps_calls.c common.c \
+ ${is_prefix}Server.c ${ps_prefix}Client.c ${ws_prefix}C.c \
+ ws_ps_typeref.c ws_is_typeref.c db_ops.c context.c common_server.c
-EXA_TEST_SRCS:=jpis-test.c ${is_prefix}C.c ${is_prefix}Client.c context.c db_ops.c conf.c ws_is_typeref.c
+EXA_TEST_SRCS:=jpis-test.c ${is_prefix}Client.c ${is_prefix}C.c context.c db_ops.c conf.c ws_is_typeref.c
EXA_DB_SRCS:=jpis-db-internal.c db_ops.c conf.c context.c ws_is_typeref.c
-EXA_CLIENT_SRCS:=jpis-client.c common.c \
- ${is_client_prefix}C.c ${is_client_prefix}Client.c
-# ${is_prefix}C.c
+EXA_CLIENT_SRCS:=jpis-client.c ${is_prefix}Client.c ${is_prefix}C.c common.c
OBJS:=${SRCS:.c=.o}
EXA_TEST_OBJS:=${EXA_TEST_SRCS:.c=.o}
compile: ${daemon} ${examples}
${daemon}: ${OBJS}
- ${LINK} -o $@ -export-dynamic ${OBJS} ${BONESLIB} ${TRIOLIB} ${COMMONLIB} ${GSOAPLIB} ${GLOBUS_LIBS} ${SRVCOMMONLIB}
+ ${LINK} -o $@ -export-dynamic ${OBJS} ${BONESLIB} ${TRIOLIB} ${COMMONLIB} ${GSOAPLIB} ${SRVCOMMONLIB}
glite-jpis-test: ${EXA_TEST_OBJS}
- ${LINK} -o $@ $+ ${GSOAPLIB} ${GLOBUS_LIBS} ${COMMONLIB} ${TRIOLIB} ${SRVCOMMONLIB}
+ ${LINK} -o $@ $+ ${GSOAPLIB} ${COMMONLIB} ${TRIOLIB} ${SRVCOMMONLIB}
jpis-db-internal: ${EXA_DB_OBJS}
- ${LINK} -o $@ $+ ${COMMONLIB} ${SRVCOMMONLIB} ${GLOBUS_LIBS}
+ ${LINK} -o $@ $+ ${COMMONLIB} ${SRVCOMMONLIB}
glite-jpis-client: ${EXA_CLIENT_OBJS}
- ${LINK} -o $@ $+ ${GSOAPLIB}
+ ${LINK} -o $@ $+ ${GSOAPLIB} ${COMMONLIB} ${TRIOLIB}
-JobProvenanceIS.xh: JobProvenanceIS.wsdl JobProvenanceTypes.wsdl typemap.dat
- cp ${stagedir}/interface/JobProvenanceTypes.wsdl .
- ${gsoap_bin_prefix}/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o $@ $<
- rm -f JobProvenanceTypes.wsdl
+${ws_prefix}Client.c ${ws_prefix}Server.c \
+${ws_prefix}C.c ${ws_prefix}H.h ${ws_prefix}Stub.h: JobProvenance.xh
+ ${gsoap_bin_prefix}/soapcpp2 -n -w -c -p ${ws_prefix} $<
-JobProvenancePS.xh: %.xh: %.wsdl JobProvenanceTypes.wsdl typemap.dat
- cp ${stagedir}/interface/JobProvenanceTypes.wsdl .
+JobProvenance.xh: jpdev.wsdl
+ cp ${stagedir}/interface/JobProvenanceTypes.wsdl .
${gsoap_bin_prefix}/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o $@ $<
rm -f JobProvenanceTypes.wsdl
-#JobProvenanceISClient.xh: typemap.dat JobProvenanceISClient.xsd JobProvenanceIS.wsdl
-# cp ${stagedir}/interface/JobProvenance{Types.xsd,Types.wsdl,IS.wsdl} .
-# ${gsoap_bin_prefix}/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o $@ JobProvenanceIS.wsdl ${top_srcdir}/src/JobProvenanceISClient.xsd
-# rm -f JobProvenance{Types.xsd,Types.wsdl,IS.wsdl}
-
-${is_prefix}ClientLib.c ${is_prefix}Client.c \
-${is_prefix}Server.c ${is_prefix}ServerLib.c \
-${is_prefix}C.c ${is_prefix}H.h ${is_prefix}Stub.h: JobProvenanceIS.xh
- ${gsoap_bin_prefix}/soapcpp2 -n -w -c -p ${is_prefix} $<
-
-# JobProvenanceISClient.xh should be used,
-# for now (gsoap-2.7.0) used direct JobProvenanceIS.xh
-${is_client_prefix}ClientLib.c ${is_client_prefix}Client.c \
-${is_client_prefix}Server.c ${is_client_prefix}ServerLib.c \
-${is_client_prefix}C.c ${is_client_prefix}H.h ${is_client_prefix}Stub.h: JobProvenanceIS.xh
- ${gsoap_bin_prefix}/soapcpp2 -n -w -c -p ${is_client_prefix} $<
-
-${ps_prefix}Client.c ${ps_prefix}ClientLib.c \
-${ps_prefix}C.c ${ps_prefix}H.h ${ps_prefix}Stub.h: JobProvenancePS.xh
- ${gsoap_bin_prefix}/soapcpp2 -n -w -c -p ${ps_prefix} $<
-
-
-#env_C.c env_Server.c:
-# touch env.xh
-# cp ${stagedir}/interface/JobProvenanceTypes.wsdl .
-# ${gsoap_prefix}/bin/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o env.xh JobProvenanceTypes.wsdl
-# rm -f JobProvenanceTypes.wsdl
-# ${gsoap_prefix}/bin/soapcpp2 -w -c -p env_ env.xh
-
check:
# ../test/run-test.sh
context.h: conf.h
db_ops.o: db_ops.c conf.h context.h db_ops.h
context.o: context.c conf.h context.h
-soap_ps_calls.o: soap_ps_calls.c jpps_H.h jpps_.nsmap soap_version.h conf.h db_ops.h ws_ps_typeref.h context.h
-soap_ops.o: soap_ops.c jpis_H.h jpis_.nsmap soap_version.h db_ops.h ws_ps_typeref.h ws_is_typeref.h context.h
+soap_ps_calls.o: soap_ps_calls.c ${ps_prefix}H.h ${ps_prefix}.nsmap soap_version.h conf.h db_ops.h ws_ps_typeref.h context.h
+soap_ops.o: soap_ops.c jp_H.h ${is_prefix}.nsmap soap_version.h db_ops.h ws_ps_typeref.h ws_is_typeref.h context.h
ws_ps_typeref.o: ws_ps_typeref.c ${ps_prefix}H.h ws_typemap.h ws_ps_typeref.h soap_version.h
ws_is_typeref.o: ws_is_typeref.c ${is_prefix}H.h ws_typemap.h ws_is_typeref.h soap_version.h
comon_server.o: common_server.c common_server.h
-jpis-client.o: jpis-client.c ${is_client_prefix}H.h soap_version.h
-jpis-test.o: jpis-client.c ${is_client_prefix}H.h soap_version.h
+jpis-client.o: jpis-client.c ${is_prefix}H.h soap_version.h
+jpis-test.o: jpis-client.c ${is_prefix}H.h soap_version.h
conf.o: conf.c ${is_prefix}H.h soap_version.h
+${ws_prefix}C.o: ${ws_prefix}C.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -Wno-unused-parameter $<
+
%.1: %.sgml
docbook2man $<
#include <glite/security/glite_gsplugin.h>
#include <glite/security/glite_gscompat.h>
-#include "jpis_client_.nsmap"
+#include "jp_.nsmap"
#include "common.h"
#define dprintf(FMT, ARGS...) fprintf(stderr, FMT, ##ARGS);
#include <glite/jp/ws_fault.c>
-/* 'jpisclient' as future namespace */
-#define _jpisclient__QueryJobs _jpelem__QueryJobs
-#define _jpisclient__QueryJobsResponse _jpelem__QueryJobsResponse
-#define soap_default__jpisclient__QueryJobs soap_default__jpelem__QueryJobs
-#define soap_get__jpisclient__QueryJobs soap_get__jpelem__QueryJobs
-#define soap_put__jpisclient__QueryJobs soap_put__jpelem__QueryJobs
-#define soap_put__jpisclient__QueryJobsResponse soap_put__jpelem__QueryJobsResponse
-#define soap_serialize__jpisclient__QueryJobs soap_serialize__jpelem__QueryJobs
-#define soap_serialize__jpisclient__QueryJobsResponse soap_serialize__jpelem__QueryJobsResponse
-
#define DEFAULT_JPIS "http://localhost:8902"
#define USE_GMT 1
-/* namespaces[] not used here but needed to prevent linker to complain... */
-SOAP_NMAC struct Namespace namespaces[] = {
- {NULL, NULL, NULL, NULL},
-};
-
static struct option opts[] = {
{"index-server",required_argument, NULL, 'i'},
{"example-file",required_argument, NULL, 'e'},
/*
* fill the query soap structure with some example data
*/
-static void query_example_fill(struct soap *soap, struct _jpisclient__QueryJobs *in) {
+static void query_example_fill(struct soap *soap, struct _jpelem__QueryJobs *in) {
struct jptype__indexQuery *cond;
struct jptype__indexQueryRecord *rec;
/*
* read the XML query
*/
-static int query_recv(struct soap *soap, int fd, struct _jpisclient__QueryJobs *qj) {
+static int query_recv(struct soap *soap, int fd, struct _jpelem__QueryJobs *qj) {
int i;
memset(qj, 0, sizeof(*qj));
soap->recvfd = fd;
soap_begin_recv(soap);
- soap_default__jpisclient__QueryJobs(soap, qj);
- if (!soap_get__jpisclient__QueryJobs(soap, qj, "QueryJobs", NULL)) {
+ soap_default__jpelem__QueryJobs(soap, qj);
+ if (!soap_get__jpelem__QueryJobs(soap, qj, "jpelem:QueryJobs", NULL)) {
soap_end_recv(soap);
soap_end(soap);
return EINVAL;
/*
* print info from the query soap structure
*/
-static void query_print(FILE *out, const struct _jpisclient__QueryJobs *in) {
+static void query_print(FILE *out, const struct _jpelem__QueryJobs *in) {
struct jptype__indexQuery *cond;
struct jptype__indexQueryRecord *rec;
int i, j, k;
/*
* dump the XML query
*/
-static int query_dump(struct soap *soap, int fd, struct _jpisclient__QueryJobs *qj) {
+static int query_dump(struct soap *soap, int fd, struct _jpelem__QueryJobs *qj) {
int retval;
soap->sendfd = fd;
soap_begin_send(soap);
- soap_serialize__jpisclient__QueryJobs(soap, qj);
- retval = soap_put__jpisclient__QueryJobs(soap, qj, "jpisclient:QueryJobs", NULL);
+ soap_serialize__jpelem__QueryJobs(soap, qj);
+ retval = soap_put__jpelem__QueryJobs(soap, qj, "jpelem:QueryJobs", NULL);
soap_end_send(soap);
write(fd, "\n", strlen("\n"));
}
-static int query_format(struct soap *soap, format_t format, FILE *f, struct _jpisclient__QueryJobs *qj) {
+static int query_format(struct soap *soap, format_t format, FILE *f, struct _jpelem__QueryJobs *qj) {
switch (format) {
case FORMAT_XML:
case FORMAT_STRIPPEDXML:
* dump the XML query with the example data
*/
static int query_example_dump(struct soap *soap, int fd) {
- struct _jpisclient__QueryJobs qj;
+ struct _jpelem__QueryJobs qj;
int retval;
memset(&qj, 0, sizeof(qj));
/*
* dump the data returned from JP IS
*/
-static int queryresult_dump(struct soap *soap, int fd, const struct _jpisclient__QueryJobsResponse *qjr) {
+static int queryresult_dump(struct soap *soap, int fd, const struct _jpelem__QueryJobsResponse *qjr) {
int retval;
soap->sendfd = fd;
soap_begin_send(soap);
- soap_serialize__jpisclient__QueryJobsResponse(soap, qjr);
- retval = soap_put__jpisclient__QueryJobsResponse(soap, qjr, "jpisclient:QueryJobsResponse", NULL);
+ soap_serialize__jpelem__QueryJobsResponse(soap, qjr);
+ retval = soap_put__jpelem__QueryJobsResponse(soap, qjr, "QueryJobsResponse", NULL);
soap_end_send(soap);
write(fd, "\n", strlen("\n"));
int main(int argc, char * const argv[]) {
struct soap soap, soap_comm;
- struct _jpisclient__QueryJobs qj;
+ struct _jpelem__QueryJobs qj;
char *server, *example_file, *query_file, *test_file;
const char *prog_name;
int retval, opt, example_fd, query_fd, test_fd;
- struct Namespace *namespaces;
- int i;
format_t format = FORMAT_XML;
prog_name = server = NULL;
retval = 1;
soap_init(&soap);
-
- /*
- * Following code is needed, when we can't combine more XSD/WSDL files
- * for using both as client. We direct use structures only from
- * JobProvenanceIS.wsdl, just retyped to jpisclient namespace.
- *
- * So manually add jpisclient to the namespaces.
- */
- for (i = 0; jpis_client__namespaces[i].id; i++)
- if (strcmp(jpis_client__namespaces[i].id, "jpisclient") == 0) break;
- if (jpis_client__namespaces[i].id) {
- /*
- * namespaces hack isn't needed (used two schemas and
- * gsoap 2.7.6b)
- */
- namespaces = NULL;
- soap_set_namespaces(&soap, jpis_client__namespaces);
- } else {
- /* perform namespaces hack */
- namespaces = calloc(i + 2, sizeof(struct Namespace));
- memcpy(namespaces, jpis_client__namespaces, sizeof(jpis_client__namespaces));
- namespaces[i].id = "jpisclient";
- namespaces[i].ns = "http://glite.org/xsd/types/jpisclient";
- soap_set_namespaces(&soap, namespaces);
- }
+ soap_set_namespaces(&soap, jp__namespaces);
/*
* Soap with registered plugin can't be used for reading XML.
* For communications with JP IS glite_gsplugin needs to be registered yet.
*/
soap_init(&soap_comm);
- soap_set_namespaces(&soap_comm, jpis_client__namespaces);
+ soap_set_namespaces(&soap_comm, jp__namespaces);
soap_register_plugin(&soap_comm, glite_gsplugin);
/* program name */
* Right way would be copy data from client query structure to IS query
* structure. Just ugly retype to client here.
*/
- if (query_recv(&soap, query_fd, (struct _jpisclient__QueryJobs *)&in) != 0) {
+ if (query_recv(&soap, query_fd, (struct _jpelem__QueryJobs *)&in) != 0) {
fprintf(stderr, "query: Error getting query XML\n");
} else {
fprintf(stderr, "query: using JPIS %s\n\n", server);
soap_begin(&soap_comm);
ret = check_fault(&soap_comm, soap_call___jpsrv__QueryJobs(&soap_comm, server, "", &in, &out));
if (ret == 0) {
- queryresult_format(&soap, format, stdout, (struct _jpisclient__QueryJobsResponse *)&out);
- } else goto cleanup;
+ queryresult_format(&soap, format, stdout, (struct _jpelem__QueryJobsResponse *)&out);
+ } else {
+ soap_end(&soap_comm);
+ soap_end(&soap);
+ goto cleanup;
+ }
soap_end(&soap_comm);
}
soap_end(&soap);
free(example_file);
free(query_file);
free(test_file);
- free(namespaces);
return retval;
}
#include <glite/security/glite_gsplugin.h>
#include "glite/jp/strmd5.h"
-#include "jpis_H.h"
-#include "jpis_.nsmap"
+#include "jp_H.h"
+#include "jp_.nsmap"
#include "db_ops.h"
#include "conf.h"
struct soap *soap = soap_new();
soap_init(soap);
- soap_set_namespaces(soap, jpis__namespaces);
+ soap_set_namespaces(soap, jp__namespaces);
soap_register_plugin(soap,glite_gsplugin);
/*---------------------------------------------------------------------------*/
glite_jp_init_context(&ctx);
- glite_jp_get_conf(argc, argv, NULL, &conf);
+ glite_jp_get_conf(argc, argv, &conf);
if (!conf) {
fprintf(stderr, "Can't gather configuration\n");
goto end;
return 0;
}
-
-
-/* XXX: we don't use it */
-SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
<?xml version="1.0" encoding="UTF-8"?>
-<jpisclient:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp" xmlns:jpisclient="http://glite.org/xsd/types/jpisclient">
+<jpelem:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp">
<conditions>
<attr>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</attr>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</attributes>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</attributes>
-</jpisclient:QueryJobs>
+</jpelem:QueryJobs>
<?xml version="1.0" encoding="UTF-8"?>
-<jpisclient:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp" xmlns:jpisclient="http://glite.org/xsd/types/jpisclient">
+<jpelem:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp">
<conditions>
<attr>http://egee.cesnet.cz/en/Schema/LB/Attributes:CE</attr>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</attributes>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:CE</attributes>
-</jpisclient:QueryJobs>
+</jpelem:QueryJobs>
<?xml version="1.0" encoding="UTF-8"?>
-<jpisclient:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp" xmlns:jpisclient="http://glite.org/xsd/types/jpisclient">
+<jpelem:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp">
<conditions>
<attr>http://egee.cesnet.cz/en/Schema/JP/System:jobId</attr>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</attributes>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</attributes>
-</jpisclient:QueryJobs>
+</jpelem:QueryJobs>
<?xml version="1.0" encoding="UTF-8"?>
-<jpisclient:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp" xmlns:jpisclient="http://glite.org/xsd/types/jpisclient">
+<jpelem:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp">
<conditions>
<attr>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</attr>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</attributes>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</attributes>
-</jpisclient:QueryJobs>
+</jpelem:QueryJobs>
<?xml version="1.0" encoding="UTF-8"?>
-<jpisclient:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp" xmlns:jpisclient="http://glite.org/xsd/types/jpisclient">
+<jpelem:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp">
<conditions>
<attr>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</attr>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</attributes>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</attributes>
-</jpisclient:QueryJobs>
+</jpelem:QueryJobs>
<?xml version="1.0" encoding="UTF-8"?>
-<jpisclient:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp" xmlns:jpisclient="http://glite.org/xsd/types/jpisclient">
+<jpelem:QueryJobs xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jptype="http://glite.org/wsdl/types/jp" xmlns:jpsrv="http://glite.org/wsdl/services/jp" xmlns:jpelem="http://glite.org/wsdl/elements/jp">
<conditions>
<attr>http://egee.cesnet.cz/en/Schema/LB/Attributes:CE</attr>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</attributes>
<attributes>http://egee.cesnet.cz/en/Schema/LB/Attributes:CE</attributes>
-</jpisclient:QueryJobs>
+</jpelem:QueryJobs>
#include <glite/jp/context.h>
#include <glite/lb/srvbones.h>
-#include <glite/security/glite_gss.h>
#include <stdsoap2.h>
+#include <glite/security/glite_gss.h>
#include <glite/security/glite_gsplugin.h>
#include "conf.h"
#include "common_server.h"
#include "soap_version.h"
-#include "jpis_H.h"
+#include "jp_H.h"
+#include "jp_.nsmap"
#if GSOAP_VERSION <= 20602
#define soap_call___jpsrv__FeedIndex soap_call___ns1__FeedIndex
#define RECONNECT_TIME 60*20 // when try reconnect to PS in case of error (in sec)
-extern SOAP_NMAC struct Namespace jpis__namespaces[],jpps__namespaces[];
-extern SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
-// namespaces[] not used here, but need to prevent linker to complain...
+extern SOAP_NMAC struct Namespace jp__namespaces[],jpps__namespaces[];
int newconn(int,struct timeval *,void *);
int request(int,struct timeval *,void *);
static int disconn(int,struct timeval *,void *);
int data_init(void **data);
+
static struct glite_srvbones_service stab = {
"JP Index Server", -1, newconn, request, reject, disconn
};
-/*
-typedef struct {
- glite_jpis_context_t ctx;
- glite_jp_is_conf *conf;
- struct soap *soap;
-} slave_data_t;
-*/
-
static time_t cert_mtime;
static char *server_cert, *server_key, *cadir;
static gss_cred_id_t mycred = GSS_C_NO_CREDENTIAL;
static int debug = 1;
static glite_jp_context_t ctx;
-static char *glite_jp_default_namespace;
static glite_jp_is_conf *conf; // Let's make configuration visible to all slaves
int main(int argc, char *argv[])
{
- int one = 1,i;
+ int one = 1, nfeeds;
edg_wll_GssStatus gss_code;
struct sockaddr_in a;
glite_jpis_context_t isctx;
glite_jp_init_context(&ctx);
- if (glite_jp_get_conf(argc, argv, NULL, &conf)) {
+ if (glite_jp_get_conf(argc, argv, &conf)) {
glite_jp_free_context(ctx);
exit(1);
}
return 1;
}
-
-#if GSOAP_VERSION <= 20602
- for (i=0; jpis__namespaces[i].id && strcmp(jpis__namespaces[i].id,"ns1"); i++);
-#else
- for (i=0; jpis__namespaces[i].id && strcmp(jpis__namespaces[i].id,"jpsrv"); i++);
-#endif
- assert(jpis__namespaces[i].id);
- glite_jp_default_namespace = jpis__namespaces[i].ns;
-
stab.conn = socket(PF_INET, SOCK_STREAM, 0);
if (stab.conn < 0) {
perror("socket");
fprintf(stderr,"Server idenity: %s\n",mysubj);
else fputs("WARNING: Running unauthenticated\n",stderr);
- /* XXX: uncomment after testing phase
- for (i=0; conf->PS_list[i]; i++); // count PS we need to contact
- i += USER_QUERY_SLAVES_NUM; // add some slaves for user queries
- if (i > MAX_SLAVES_NUM)
- glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT, MAX_SLAVES_NUM);
- else
- glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT, i);
- */
- /* for dbg - one slave OK */ glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT,1);
+ // XXX: more tests needed
+ if (conf->feeds)
+ for (nfeeds=0; conf->feeds[nfeeds]; nfeeds++);
+ else nfeeds = 0;
+ if (conf->slaves <= 0) {
+ // add some slaves for user queries and PS responses
+ conf->slaves = nfeeds + (USER_QUERY_SLAVES_NUM - 1);
+ if (conf->slaves > MAX_SLAVES_NUM) conf->slaves = MAX_SLAVES_NUM;
+ }
+ //
+ // SUM(PS, feeds(PS) - slaves(PS)) slaves would be blocked
+ // when waited for all PS
+ //
+ // wild guess for slaves(PS) == 1 on all PS:
+ // 1 + SUM(PS, feeds(PS) - 1) slaves is required,
+ // SUM(PS, feeds(PS)) is enough.
+ //
+ if (conf->slaves < nfeeds) {
+ fprintf(stderr, "WARNING: %d slaves can be too low for %d feeds\n", conf->slaves, nfeeds);
+ }
+ glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT, conf->slaves);
+
glite_srvbones_run(data_init,&stab,1 /* XXX: entries in stab */,debug);
glite_jpis_free_db(isctx);
soap_init2(soap,SOAP_IO_KEEPALIVE,SOAP_IO_KEEPALIVE);
soap_set_omode(soap, SOAP_IO_BUFFER); // set buffered response
// buffer set to SOAP_BUFLEN (default = 8k)
- soap_set_namespaces(soap,jpis__namespaces);
+ soap_set_namespaces(soap,jp__namespaces);
soap->user = (void *) private;
glite_gsplugin_init_context(&plugin_ctx);
return ret;
}
-int request(int conn,struct timeval *to,void *data)
+int request(int conn UNUSED,struct timeval *to,void *data)
{
slave_data_t *private = (slave_data_t *)data;
struct soap *soap = private->soap;
if (soap_envelope_begin_in(soap)
|| soap_recv_header(soap)
|| soap_body_begin_in(soap)
- || jpis__serve_request(soap)
+ || jp__serve_request(soap)
#if GSOAP_VERSION >= 20700
|| (soap->fserveloop && soap->fserveloop(soap))
#endif
return 0;
}
-static int disconn(int conn,struct timeval *to,void *data)
+static int disconn(int conn UNUSED,struct timeval *to UNUSED,void *data)
{
slave_data_t *private = (slave_data_t *)data;
struct soap *soap = private->soap;
#ident "$Header$"
+#include <stdio.h>
#include <string.h>
#include <stdsoap2.h>
+#include <glite/jp/types.h>
+#include <glite/jp/context.h>
+
#include "common.h"
#define WHITE_SPACE_SET "\n\r \t"
soap_dealloc(soap, *soap_str);
*soap_str = s;
}
+
+
+int glite_jpis_stack_error_source(glite_jp_context_t ctx, int code, const char *desc, const char *func, int line) {
+ glite_jp_error_t err;
+ char *source;
+
+ asprintf(&source, "%s:%d", func, line);
+ memset(&err, 0, sizeof err);
+ err.code = code;
+ err.desc = desc;
+ err.source = source;
+ glite_jp_stack_error(ctx, &err);
+ free(source);
+
+ return code;
+}
#ifndef GLITE_JPIS_COMMON_H
#define GLITE_JPIS_COMMON_H
+#include <glite/jp/types.h>
+#include <glite/jp/context.h>
+
void glite_jpis_trim_soap(struct soap *soap, char **soap_str);
+int glite_jpis_stack_error_source(glite_jp_context_t ctx, int code, const char *desc, const char *func, int line);
+
+#define glite_jpis_stack_error(CTX, CODE, DESC) glite_jpis_stack_error_source((CTX), (CODE), (DESC), __FUNCTION__, __LINE__);
+
#endif
#include <glite/jp/ws_fault.c>
-#define SOAP_FMAC3 static
-#define WITH_NOGLOBAL
-#include "jpis_C.c"
-extern SOAP_NMAC struct Namespace jpis__namespaces[];
+extern SOAP_NMAC struct Namespace jp__namespaces[];
-static const char *get_opt_string = "dq:c:k:C:V:nm:p:i:o:x:";
+static const char *get_opt_string = "dq:c:k:C:V:nm:p:i:o:x:s:";
static struct option opts[] = {
{"debug", 0, NULL, 'd'},
{"pidfile", 1, NULL, 'i'},
{"logfile", 1, NULL, 'o'},
{"config", 1, NULL, 'x'},
+ {"slaves", 1, NULL, 's'},
{NULL, 0, NULL, 0}
};
static int read_conf(glite_jp_is_conf *conf, char *conf_file);
+#if 0
static int dump_conf(void);
+#endif
static void usage(char *me)
{
"\t-i, --pidfile\t file to store master pid\n"
"\t-o, --logfile\t file to store logs\n"
"\t-x, --config\t file with server configuration\n"
+ "\t-s, --slaves\t number of slaves for responses\n"
"\n"
,me);
}
-int glite_jp_get_conf(int argc, char **argv, char *config_file, glite_jp_is_conf **configuration)
+int glite_jp_get_conf(int argc, char **argv, glite_jp_is_conf **configuration)
{
char *qt = NULL, *conf_file = NULL;
int opt;
conf = calloc(1, sizeof(*conf));
-
while ((opt = getopt_long(argc,argv,get_opt_string,opts,NULL)) != EOF) switch (opt) {
case 'd': conf->debug = 1; break;
case 'q': qt = optarg; break;
case 'i': conf->pidfile = optarg; break;
case 'o': conf->logfile = optarg; break;
case 'x': conf_file = optarg; break;
+ case 's': conf->slaves = atoi(optarg); if (conf->slaves > 0) break;
default : usage(argv[0]); exit(0); break;
}
return 1;
}
else {
- read_conf(conf, conf_file);
+ if (read_conf(conf, conf_file) != 0) return 1;
}
*configuration = conf;
}
soap_init(&soap);
- soap_set_namespaces(&soap, jpis__namespaces);
+ soap_set_namespaces(&soap, jp__namespaces);
soap_begin(&soap);
soap.recvfd = fd;
conf->feeds[i] = calloc(1, sizeof(*conf->feeds[i]));
conf->feeds[i]->PS_URL=strdup(feed->primaryServer);
- if (glite_jpis_SoapToPrimaryQueryConds(&soap, feed->__sizecondition,
+ if (glite_jpis_SoapToPrimaryQueryConds(feed->__sizecondition,
feed->condition, &conf->feeds[i]->query)) return EINVAL;
conf->feeds[i]->history = feed->history;
return 0;
}
+#if 0
/*
* Just helper function - used only once for first generation
* of XML example configuration (which was then reedited in hand)
struct jptype__primaryQuery *cond;
soap_init(&soap);
- soap_set_namespaces(&soap, jpis__namespaces);
+ soap_set_namespaces(&soap, jp__namespaces);
soap.sendfd = STDOUT_FILENO;
soap_begin_send(&soap);
return retval;
}
-
+#endif
#include <glite/jp/types.h>
+#ifdef __GNUC__
+ #define UNUSED __attribute__((unused))
+#else
+ #define UNUSED
+#endif
+
#define GLITE_JPIS_DEFAULT_PORT_STR "8902"
//#define lprintf
*logfile,
*server_cert,
*server_key;
+ int slaves;
} glite_jp_is_conf;
// read commad line options and configuration file
-int glite_jp_get_conf(int argc, char **argv, char *config_file, glite_jp_is_conf **configuration);
+int glite_jp_get_conf(int argc, char **argv, glite_jp_is_conf **configuration);
void glite_jp_free_conf(glite_jp_is_conf *conf);
void glite_jp_lprintf(const char *source, const char *fmt, ...);
#define COND_MAGIC 0x444E4F43
+
+static int glite_jpis_db_queries_deserialize(glite_jp_query_rec_t ***queries, void *blob, size_t blob_size) UNUSED;
+
+
static int is_indexed(glite_jp_is_conf *conf, const char *attr) {
size_t i;
#include "glite/jp/types.h"
#include "glite/jp/context.h"
-#include "jpis_H.h"
+#include "jp_H.h"
int main() {
struct soap soap;
#include "glite/jp/known_attr.h"
#include "glite/lb/trio.h"
-#include "jpis_H.h"
-#include "jpis_.nsmap"
+#include "jp_H.h"
#include "soap_version.h"
#include "glite/security/glite_gscompat.h"
#include "db_ops.h"
-// XXX: avoid 2 wsdl collisions - work only because ws_ps_typeref.h
-// uses common types from jpis_H.h (awful)
#include "ws_ps_typeref.h"
#include "ws_is_typeref.h"
#include "context.h"
+#include "common.h"
#define INDEXED_STRIDE 2 // how often realloc indexed attr result
// XXX: 2 is only for debugging, replace with e.g. 100
SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__UpdateJobs(
struct soap *soap,
struct _jpelem__UpdateJobs *jpelem__UpdateJobs,
- struct _jpelem__UpdateJobsResponse *jpelem__UpdateJobsResponse)
+ struct _jpelem__UpdateJobsResponse *jpelem__UpdateJobsResponse UNUSED)
{
int ret, ijobs;
const char *feedid;
}
-static char *get_sql_stringvalue(glite_jpis_context_t ctx, struct jptype__stringOrBlob *value) {
+static char *get_sql_stringvalue(struct jptype__stringOrBlob *value) {
if (!value) return NULL;
if (!GSOAP_ISSTRING(value)) return NULL;
return GSOAP_STRING(value);
}
-static int get_sql_indexvalue(char **sql, struct soap *soap, glite_jpis_context_t ctx, struct jptype__indexQuery *condition, struct jptype__stringOrBlob *value) {
+static int get_sql_indexvalue(char **sql, glite_jpis_context_t ctx, struct jptype__indexQuery *condition, struct jptype__stringOrBlob *value) {
glite_jp_attrval_t attr;
*sql = NULL;
attr.size = GSOAP_BLOB(value)->__size;
attr.binary = 1;
} else return 0;
- glite_jpis_SoapToAttrOrig(soap, condition->origin, &(attr.origin));
+ glite_jpis_SoapToAttrOrig(condition->origin, &(attr.origin));
*sql = glite_jp_attrval_to_db_index(ctx->jpctx, &attr, 255);
return 0;
}
-static char *get_sql_or(struct soap *soap, glite_jpis_context_t ctx, struct jptype__indexQuery *condition, const char *attr_md5) {
+static char *get_sql_or(glite_jpis_context_t ctx, struct jptype__indexQuery *condition, const char *attr_md5) {
struct jptype__indexQueryRecord *record;
char *sql, *cond, *s = NULL, *value, *value2;
int j;
/* no additional conditions needed when existing is enough */
} else {
if (strcmp(condition->attr, GLITE_JP_ATTR_JOBID) == 0) {
- value = get_sql_stringvalue(ctx, record->value);
+ value = get_sql_stringvalue(record->value);
if (!value) goto err;
- value2 = get_sql_stringvalue(ctx, record->value2);
+ value2 = get_sql_stringvalue(record->value2);
if (get_sql_cond(&cond, attr_md5, record->op, value, value2) != 0) goto err;
} else {
- get_sql_indexvalue(&value, soap, ctx, condition, record->value);
- get_sql_indexvalue(&value2, soap, ctx, condition, record->value2);
+ get_sql_indexvalue(&value, ctx, condition, record->value);
+ get_sql_indexvalue(&value2, ctx, condition, record->value2);
get_sql_cond(&cond, attr_md5, record->op, value, value2);
free(value);
free(value2);
/* get all jobids matching the query conditions */
-static int get_jobids(struct soap *soap, glite_jpis_context_t ctx, struct _jpelem__QueryJobs *in, char ***jobids, char *** ps_list)
+static int get_jobids(glite_jpis_context_t ctx, struct _jpelem__QueryJobs *in, char ***jobids, char *** ps_list)
{
char *qa = NULL, *qb = NULL, *qor, *attr_md5,
*qwhere = NULL, *query = NULL, *res[2],
/* origin */
if (condition->origin) {
- glite_jpis_SoapToAttrOrig(soap, condition->origin, &orig);
+ glite_jpis_SoapToAttrOrig(condition->origin, &orig);
trio_asprintf(&qb, "attr_%|Ss.origin = %d AND ", attr_md5, orig);
} else
trio_asprintf(&qb, "");
}
/* inside part of the condition: record list (ORs) */
- if ((qor = get_sql_or(soap, ctx, condition, attr_md5)) == NULL) goto err;
+ if ((qor = get_sql_or(ctx, condition, attr_md5)) == NULL) goto err;
if (qor[0]) {
asprintf(&qb, "%s%s(%s)", qa, qa[0] ? " AND " : "", qor);
free(qa);
/* test whether there is any indexed attribudes in the condition */
if ( checkIndexedConditions(ctx, in) ) {
- fprintf(stderr, "No indexed attribute in query\n");
+ glite_jpis_stack_error(ctx->jpctx, EINVAL, "No indexed attribute in query");
+ glite_jp_server_err2fault(ctx->jpctx, soap);
return SOAP_ERR;
}
/* test whether there is known attribudes in the condition */
if ( checkConditions(ctx, in) ) {
- fprintf(stderr, "Unknown attribute in query\n");
+ glite_jpis_stack_error(ctx->jpctx, EINVAL, "Unknown attribute in query");
+ glite_jp_server_err2fault(ctx->jpctx, soap);
return SOAP_ERR;
}
/* get all jobids matching the conditions */
- if ( get_jobids(soap, ctx, in, &jobids, &ps_list) ) {
+ if ( get_jobids(ctx, in, &jobids, &ps_list) ) {
return SOAP_ERR;
}
SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__AddFeed(
- struct soap *soap,
- struct _jpelem__AddFeed *in,
- struct _jpelem__AddFeedResponse *out)
+ struct soap *soap UNUSED,
+ struct _jpelem__AddFeed *in UNUSED,
+ struct _jpelem__AddFeedResponse *out UNUSED)
{
// XXX: test client in examples/jpis-test
// sends to this function some data for testing
SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__GetFeedIDs(
- struct soap *soap,
- struct _jpelem__GetFeedIDs *in,
- struct _jpelem__GetFeedIDsResponse *out)
+ struct soap *soap UNUSED,
+ struct _jpelem__GetFeedIDs *in UNUSED,
+ struct _jpelem__GetFeedIDsResponse *out UNUSED)
{
// XXX: test client in examples/jpis-test
// sends to this function some data for testing
SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__DeleteFeed(
- struct soap *soap,
- struct _jpelem__DeleteFeed *in,
- struct _jpelem__DeleteFeedResponse *out)
+ struct soap *soap UNUSED,
+ struct _jpelem__DeleteFeed *in UNUSED,
+ struct _jpelem__DeleteFeedResponse *out UNUSED)
{
// XXX: test client in examples/jpis-test
// sends to this function some data for testing
SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__ServerConfiguration(
- struct soap *soap,
- struct _jpelem__ServerConfiguration *in,
- struct _jpelem__ServerConfigurationResponse *out)
+ struct soap *soap UNUSED,
+ struct _jpelem__ServerConfiguration *in UNUSED,
+ struct _jpelem__ServerConfigurationResponse *out UNUSED)
{
// empty, just for deserializer generation
puts(__FUNCTION__);
#include "glite/security/glite_gsplugin.h"
#include "glite/security/glite_gscompat.h"
-#include "jpps_H.h"
-#include "jpps_.nsmap"
+#include "jp_H.h"
#include "conf.h"
#include "db_ops.h"
#include "stdsoap2.h"
+extern struct Namespace jp__namespaces[];
+int debug = 0;
+
+
/*------------------*/
/* Helper functions */
/*------------------*/
-int debug = 0;
#define dprintf(FMT, ARGS...) if (debug) fprintf(stderr, FMT, ##ARGS)
#include "glite/jp/ws_fault.c"
#define check_fault(SOAP, ERR) glite_jp_clientCheckFault((SOAP), (ERR), NULL, 0)
if (ctx->conf->server_cert) plugin_ctx->cert_filename = strdup(ctx->conf->server_cert);
soap_init(soap);
- soap_set_namespaces(soap,jpps__namespaces);
+ soap_set_namespaces(soap, jp__namespaces);
soap_set_omode(soap, SOAP_IO_BUFFER); // set buffered response
// buffer set to SOAP_BUFLEN (default = 8k)
soap_register_plugin_arg(soap,glite_gsplugin,plugin_ctx);
return err.code;
}
+
+int __jpsrv__RegisterJob(struct soap* soap UNUSED, struct _jpelem__RegisterJob *jpelem__RegisterJob UNUSED, struct _jpelem__RegisterJobResponse *jpelem__RegisterJobResponse UNUSED) { return 0; }
+int __jpsrv__StartUpload(struct soap* soap UNUSED, struct _jpelem__StartUpload *jpelem__StartUpload UNUSED, struct _jpelem__StartUploadResponse *jpelem__StartUploadResponse UNUSED) { return 0; }
+int __jpsrv__CommitUpload(struct soap* soap UNUSED, struct _jpelem__CommitUpload *jpelem__CommitUpload UNUSED, struct _jpelem__CommitUploadResponse *jpelem__CommitUploadResponse UNUSED) { return 0; }
+int __jpsrv__RecordTag(struct soap* soap UNUSED, struct _jpelem__RecordTag *jpelem__RecordTag UNUSED, struct _jpelem__RecordTagResponse *jpelem__RecordTagResponse UNUSED) { return 0; }
+int __jpsrv__FeedIndex(struct soap* soap UNUSED, struct _jpelem__FeedIndex *jpelem__FeedIndex UNUSED, struct _jpelem__FeedIndexResponse *jpelem__FeedIndexResponse UNUSED) { return 0; }
+int __jpsrv__FeedIndexRefresh(struct soap* soap UNUSED, struct _jpelem__FeedIndexRefresh *jpelem__FeedIndexRefresh UNUSED, struct _jpelem__FeedIndexRefreshResponse *jpelem__FeedIndexRefreshResponse UNUSED) { return 0; }
+int __jpsrv__GetJobFiles(struct soap* soap UNUSED, struct _jpelem__GetJobFiles *jpelem__GetJobFiles UNUSED, struct _jpelem__GetJobFilesResponse *jpelem__GetJobFilesResponse UNUSED) { return 0; }
+int __jpsrv__GetJobAttributes(struct soap* soap UNUSED, struct _jpelem__GetJobAttributes *jpelem__GetJobAttributes UNUSED, struct _jpelem__GetJobAttributesResponse *jpelem__GetJobAttributesResponse UNUSED) { return 0; }
#include <glite/jp/types.h>
#include "soap_version.h"
-#include "jpis_H.h"
+#include "jp_H.h"
#include "ws_typemap.h"
#include <glite/security/glite_gscompat.h>
#include "ws_is_typeref.h"
}
}
-void glite_jpis_SoapToAttrOrig(struct soap *soap, const enum jptype__attrOrig *in, glite_jp_attr_orig_t *out)
+void glite_jpis_SoapToAttrOrig(const enum jptype__attrOrig *in, glite_jp_attr_orig_t *out)
{
assert(out);
- // XXX: shlouldn't be ANY in WSDL??
if (!in) {
*out = GLITE_JP_ATTR_ORIG_ANY;
return;
switch ( *in )
{
-// case NULL: *out = GLITE_JP_ATTR_ORIG_ANY; break;
case SYSTEM: *out = GLITE_JP_ATTR_ORIG_SYSTEM; break;
case USER: *out = GLITE_JP_ATTR_ORIG_USER; break;
case FILE_: *out = GLITE_JP_ATTR_ORIG_FILE; break;
}
static int SoapToQueryRecordVal(
- struct soap *soap,
struct jptype__stringOrBlob *in,
int *binary,
size_t *size,
static int SoapToQueryCond(
- struct soap *soap,
struct jptype__indexQuery *in,
glite_jp_query_rec_t **out)
{
break;
case GLITE_JP_QUERYOP_WITHIN:
- SoapToQueryRecordVal(soap, record->value2, &(qr[i].binary),
+ SoapToQueryRecordVal(record->value2, &(qr[i].binary),
&(qr[i].size2), &(qr[i].value2));
// fall through
default:
- if ( SoapToQueryRecordVal(soap, record->value, &(qr[i].binary),
+ if ( SoapToQueryRecordVal(record->value, &(qr[i].binary),
&(qr[i].size), &(qr[i].value)) ) {
*out = NULL;
return 1;
break;
}
- glite_jpis_SoapToAttrOrig(soap, in->origin, &(qr[i].origin) );
+ glite_jpis_SoapToAttrOrig(in->origin, &(qr[i].origin) );
}
*out = qr;
/**
* Translate JP index query conditions from soap to C query_rec
*
- * \param IN Soap structure
* \param OUT array of glite_jp_query_rec_t query records
*/
int glite_jpis_SoapToQueryConds(
- struct soap *soap,
int size,
struct jptype__indexQuery **in,
glite_jp_query_rec_t ***out)
qr = calloc(size+1, sizeof(*qr));
for (i=0; i<size; i++) {
- if ( SoapToQueryCond(soap, in[i], &(qr[i])) ) {
+ if ( SoapToQueryCond(in[i], &(qr[i])) ) {
*out = NULL;
return 1;
}
static int SoapToPrimaryQueryCond(
- struct soap *soap,
struct jptype__primaryQuery *in,
glite_jp_query_rec_t **out)
{
break;
case GLITE_JP_QUERYOP_WITHIN:
- SoapToQueryRecordVal(soap, in->value2, &(qr[0].binary),
+ SoapToQueryRecordVal(in->value2, &(qr[0].binary),
&(qr[0].size2), &(qr[0].value2));
// fall through
default:
- if ( SoapToQueryRecordVal(soap, in->value, &(qr[0].binary),
+ if ( SoapToQueryRecordVal(in->value, &(qr[0].binary),
&(qr[0].size), &(qr[0].value)) ) {
*out = NULL;
return 1;
break;
}
- glite_jpis_SoapToAttrOrig(soap, in->origin, &(qr[0].origin) );
+ glite_jpis_SoapToAttrOrig(in->origin, &(qr[0].origin) );
return 0;
}
* \param OUT array of glite_jp_query_rec_t query records
*/
int glite_jpis_SoapToPrimaryQueryConds(
- struct soap *soap,
int size,
GLITE_SECURITY_GSOAP_LIST_TYPE(jptype, primaryQuery) in,
glite_jp_query_rec_t ***out)
qr = calloc(size+1, sizeof(*qr));
for (i=0; i<size; i++) {
- if ( SoapToPrimaryQueryCond(soap, GLITE_SECURITY_GSOAP_LIST_GET(in, i), &(qr[i])) ) {
+ if ( SoapToPrimaryQueryCond(GLITE_SECURITY_GSOAP_LIST_GET(in, i), &(qr[i])) ) {
*out = NULL;
free(qr);
return 1;
#ifndef GLITE_JPIS_IS_TYPEREF_H
#define GLITE_JPIS_IS_TYPEREF_H
-#include "jpis_H.h"
+#include "jp_H.h"
void glite_jpis_SoapToQueryOp(const enum jptype__queryOp in, glite_jp_queryop_t *out);
-void glite_jpis_SoapToAttrOrig(struct soap *soap, const enum jptype__attrOrig *in, glite_jp_attr_orig_t *out);
-int glite_jpis_SoapToQueryConds(struct soap *soap, int size, struct jptype__indexQuery **in, glite_jp_query_rec_t ***out);
-int glite_jpis_SoapToPrimaryQueryConds(struct soap *soap, int size, GLITE_SECURITY_GSOAP_LIST_TYPE(jptype, primaryQuery) in, glite_jp_query_rec_t ***out);
+void glite_jpis_SoapToAttrOrig(const enum jptype__attrOrig *in, glite_jp_attr_orig_t *out);
+int glite_jpis_SoapToQueryConds(int size, struct jptype__indexQuery **in, glite_jp_query_rec_t ***out);
+int glite_jpis_SoapToPrimaryQueryConds(int size, GLITE_SECURITY_GSOAP_LIST_TYPE(jptype, primaryQuery) in, glite_jp_query_rec_t ***out);
#endif
#include <glite/jp/types.h>
-#include "jpps_H.h"
+#include "jp_H.h"
#include "ws_typemap.h"
#include "ws_ps_typeref.h"
#include "glite/jp/ws_fault.c"
TIDY:=tidy -i -q --show-warnings no --tidy-mark no --wrap 0
docbookxls:=http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
-WSDL=JobProvenancePS.wsdl JobProvenanceIS.wsdl JobProvenanceTypes.wsdl
+WSDL=JobProvenancePS.wsdl JobProvenanceIS.wsdl JobProvenanceTypes.wsdl
+WSDL_S=jpdev.wsdl
XSD=JobProvenanceTypes.xsd
-all compile: ${WSDL} ${XSD} JobProvenance.html
+all compile: ${WSDL} ${XSD} JobProvenance.html ${WSDL_S}
check:
@echo No unit test required for interface-only module.
stage: ${WSDL}
- $(MAKE) install PREFIX=${stagedir}
+ $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
dist: distsrc distbin
# cd ${top_srcdir}/interface && install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
install -m 644 ${WSDL} ${XSD} ${PREFIX}/${STAGETO}
install -m 644 ${top_srcdir}/src/ws_fault.c ${PREFIX}/include/${globalprefix}/${jpprefix}
+ if [ x${DOSTAGE} = xyes ]; then \
+ install -m 644 ${WSDL_S} ${PREFIX}/${STAGETO}; \
+ fi
clean:
rm -f *.h
-${TIDY} -xml -m doc-html.xml
-${XMLLINT} --valid --noout doc-html.xml
-${TIDY} -asxhtml -m $@
+
+jpdev.xml: jpdev.xml.sh
+ ${top_srcdir}/src/jpdev.sh $< > $@
--- /dev/null
+#!/bin/sh
+
+xmlcut() {
+ echo -e "\t<!-- $1 -->"
+ echo
+ grep "<$2>" $(dirname $0)/JobProvenance$1.xml -A 1000 | grep "</$2>" -B 1000 | grep -v "<$2>\|</$2>"
+}
+
+xmlmerge() {
+ xmlcut PS $1
+ echo
+ xmlcut IS $1
+}
+
+DOC="$(xmlmerge doc)"
+OPERATIONS="$(xmlmerge operations)"
+
+XML_TMPL=$(sed $(dirname $0)/$1 -e 's/"/\\"/g')
+eval "XML_RESULT=\"${XML_TMPL}\""
+echo "$XML_RESULT"
--- /dev/null
+<service name="JobProvenance"
+ ns="http://glite.org/wsdl/services/jp"
+ prefix="jp"
+ typeNs="http://glite.org/wsdl/types/jp"
+ typePrefix="jpt"
+ elemNs="http://glite.org/wsdl/elements/jp"
+ elemPrefix="jpe">
+
+ <version>CVS revision: <![CDATA[ $Header$: ]]></version>
+
+ <import namespace="http://glite.org/wsdl/services/jp" location="JobProvenanceTypes.wsdl"/>
+
+ <doc>
+${DOC}
+ </doc>
+
+ <fault name="genericFault"/>
+
+ <operations>
+${OPERATIONS}
+ </operations>
+</service>
#include <glite/jp/types.h>
#include <glite/security/glite_gscompat.h>
+#ifdef __GNUC__
+ #define UNUSED __attribute__((unused))
+#else
+ #define UNUSED
+#endif
+
#define GSOAP_STRING(CHOICE) GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, string, stringOrBlob, 1)
#define GSOAP_BLOB(CHOICE) GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, blob, stringOrBlob, 1)
#define GSOAP_SETSTRING(CHOICE, VALUE) GLITE_SECURITY_GSOAP_CHOICE_SET(CHOICE, string, jptype, stringOrBlob, 1, VALUE)
#define dprintf(FMT, ARGS...) printf(FMT, ##ARGS)
#endif
-static int glite_jp_clientCheckFault(struct soap *soap, int err, const char *name, int toSyslog) {
+
+static int glite_jp_clientCheckFault(struct soap *soap, int err, const char *name, int toSyslog) UNUSED;
+static struct jptype__genericFault* jp2s_error(struct soap *soap, const glite_jp_error_t *err) UNUSED;
+static void glite_jp_server_err2fault(const glite_jp_context_t ctx,struct soap *soap) UNUSED;
+
+
+static int glite_jp_clientCheckFault(struct soap *soap, int err, const char *name, int toSyslog)
+{
struct SOAP_ENV__Detail *detail;
struct jptype__genericFault *f;
char *reason,indent[200] = " ";
if (soap->version == 2) soap->fault->SOAP_ENV__Detail = detail;
else soap->fault->detail = detail;
}
+
+#undef UNUSED