doc: ${MANS} ${HTMLS}
-stage: compile
+stage: compile doc
${MAKE} PREFIX=${stagedir} DOSTAGE=yes install
dist: distsrc distbin
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
-ws_ps_typeref.o: ws_ps_typeref.c jpis_H.h ws_typemap.h ws_ps_typeref.h
-ws_is_typeref.o: ws_is_typeref.c jpis_H.h ws_typemap.h ws_is_typeref.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
conf.o: conf.c ${is_prefix}H.h soap_version.h
%.1: %.sgml
{0, "unknown"}
};
-typedef enum {FORMAT_XML, FORMAT_HR} format_t;
+typedef enum {FORMAT_XML, FORMAT_STRIPPEDXML, FORMAT_HR} format_t;
/*
return EINVAL;
}
soap_end_recv(soap);
- soap_free(soap); /* don't destroy the data we want */
/* strip white-space characters from attributes */
for (i = 0; i < qj->__sizeattributes; i++)
soap_serialize__jpisclient__QueryJobs(soap, qj);
retval = soap_put__jpisclient__QueryJobs(soap, qj, "jpisclient:QueryJobs", NULL);
soap_end_send(soap);
+ write(fd, "\n", strlen("\n"));
return retval;
}
static int query_format(struct soap *soap, format_t format, FILE *f, struct _jpisclient__QueryJobs *qj) {
switch (format) {
- case FORMAT_XML: return query_dump(soap, fileno(f), qj);
+ case FORMAT_XML:
+ case FORMAT_STRIPPEDXML:
+ return query_dump(soap, fileno(f), qj);
case FORMAT_HR: query_print(f, qj); return 0;
default: return EINVAL;
}
soap_serialize__jpisclient__QueryJobsResponse(soap, qjr);
retval = soap_put__jpisclient__QueryJobsResponse(soap, qjr, "jpisclient:QueryJobsResponse", NULL);
soap_end_send(soap);
+ write(fd, "\n", strlen("\n"));
return retval;
}
static int queryresult_format(struct soap *soap, format_t format, FILE *f, const struct _jpelem__QueryJobsResponse *qj) {
switch (format) {
- case FORMAT_XML: return queryresult_dump(soap, fileno(f), qj);
+ case FORMAT_XML:
+ case FORMAT_STRIPPEDXML:
+ return queryresult_dump(soap, fileno(f), qj);
case FORMAT_HR: queryresult_print(f, qj); return 0;
default: return EINVAL;
}
fprintf(stderr, " -q|--query-file IN_FILE.XML\n");
fprintf(stderr, " -t|--test-file IN_FILE.XML\n");
fprintf(stderr, " -e|--example-file OUT_FILE.XML\n");
- fprintf(stderr, " -f|--format xml | human\n");
+ fprintf(stderr, " -f|--format xml | strippedxml | human\n");
}
soap_init(&soap);
-#ifdef SOAP_XML_INDENT
- soap_omode(&soap, SOAP_XML_INDENT);
-#endif
-
/*
* Following code is needed, when we can't combine more XSD/WSDL files
* for using both as client. We direct use structures only from
break;
case 'f':
if (strcasecmp(optarg, "xml") == 0) format = FORMAT_XML;
+ else if (strcasecmp(optarg, "strippedxml") == 0) format = FORMAT_STRIPPEDXML;
else format = FORMAT_HR;
break;
default:
goto cleanup;
}
if (!server) server = strdup(DEFAULT_JPIS);
+#ifdef SOAP_XML_INDENT
+ if (format != FORMAT_STRIPPEDXML) soap_omode(&soap, SOAP_XML_INDENT);
+#endif
+
/* prepare steps according to the arguments */
if (query_file) {
http://egee.cesnet.cz/en/Schema/LB/Attributes:user
OK
-<?xml version="1.0" encoding="UTF-8"?><jpisclient:QueryJobsResponse 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"></jpisclient:QueryJobsResponse>
+<jpisclient:QueryJobsResponse 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"></jpisclient:QueryJobsResponse>
http://egee.cesnet.cz/en/Schema/LB/Attributes:user
OK
-<?xml version="1.0" encoding="UTF-8"?><jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus1</jobid><owner>/O=CESNET/O=Masaryk University/CN=Milos Mulac</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Done</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs><jobs><jobid>https://localhost:7846/pokus2</jobid><owner>OwnerName</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Ready</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
+<jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus1</jobid><owner>/O=CESNET/O=Masaryk University/CN=Milos Mulac</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Done</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs><jobs><jobid>https://localhost:7846/pokus2</jobid><owner>OwnerName</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Ready</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
http://egee.cesnet.cz/en/Schema/LB/Attributes:user
OK
-<?xml version="1.0" encoding="UTF-8"?><jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus1</jobid><owner>/O=CESNET/O=Masaryk University/CN=Milos Mulac</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Done</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
+<jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus1</jobid><owner>/O=CESNET/O=Masaryk University/CN=Milos Mulac</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Done</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
http://egee.cesnet.cz/en/Schema/LB/Attributes:user
OK
-<?xml version="1.0" encoding="UTF-8"?><jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus1</jobid><owner>/O=CESNET/O=Masaryk University/CN=Milos Mulac</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Done</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
\ No newline at end of file
+<jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus1</jobid><owner>/O=CESNET/O=Masaryk University/CN=Milos Mulac</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Done</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>FILE</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
}
run_is() {
+ # check
+ if [ -f "${GLITE_JPIS_TEST_PIDFILE}" ]; then
+ echo "Index server already running!"
+ echo " pid $(cat ${GLITE_JPIS_TEST_PIDFILE})"
+ echo " pidfile ${GLITE_JPIS_TEST_PIDFILE}"
+ exit 1
+ fi
+
# run index server
X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT} \
$GLITE_LOCATION/bin/glite-jp-indexd -m $GLITE_JPIS_TEST_DB -p $GLITE_JPIS_TEST_PORT \
-i ${GLITE_JPIS_TEST_PIDFILE} -o ${GLITE_JPIS_TEST_LOGFILE} \
-x ${GLITE_JPIS_TEST_CONFIG} $1\
- 2>/dev/null
-
+ 2>/tmp/result
if [ x"$?" != x"0" ]; then
echo FAILED
exit 1
fi
if [ ! -s "${GLITE_JPIS_TEST_PIDFILE}" ]; then
+ sleep 1
+ fi
+ if [ ! -s "${GLITE_JPIS_TEST_PIDFILE}" ]; then
echo "Can't startup index server."
drop_db;
exit 1
kill `cat ${GLITE_JPIS_TEST_PIDFILE}`;
sleep 1;
kill -9 `cat ${GLITE_JPIS_TEST_PIDFILE}` 2>/dev/null
+ rm -f ${GLITE_JPIS_TEST_PIDFILE}
}
run_test_query() {
X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT} \
- $GLITE_LOCATION/examples/glite-jpis-client -f xml -q $1 \
- -i http://localhost:$GLITE_JPIS_TEST_PORT &>/tmp/result
- DIFF=`diff -b --ignore-matching-lines="query: using JPIS" $2 /tmp/result`
+ $GLITE_LOCATION/examples/glite-jpis-client -f strippedxml -q $1 \
+ -i http://localhost:$GLITE_JPIS_TEST_PORT 2>&1 | sed -e 's,<?xml version="1.0" encoding="UTF-8"?>,,' -e 's, SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/",,' > /tmp/result
+ DIFF=`diff -b -B --ignore-matching-lines="query: using JPIS" $2 /tmp/result`
if [ -z "$DIFF" -a "$?" -eq "0" ] ; then
echo "OK."
rm /tmp/result
run_test_feed() {
# run the example
- numok=`X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT}\
- $GLITE_LOCATION/examples/glite-jpis-test -p $GLITE_JPIS_TEST_PORT \
- -m $GLITE_JPIS_TEST_DB -x $GLITE_JPIS_TEST_CONFIG 2>&1 | grep -c OK`
+ X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT}\
+ $GLITE_LOCATION/examples/glite-jpis-test -p $GLITE_JPIS_TEST_PORT \
+ -m $GLITE_JPIS_TEST_DB -x $GLITE_JPIS_TEST_CONFIG &>/tmp/result
+ numok="$(cat /tmp/result | grep -c OK)"
if [ "$numok" -eq "2" ]; then
echo OK.
else
echo FAILED!
+ echo ---------------------------------------------------------------------------------------------------
+ echo
+ echo "Obtained result (in /tmp/result):"
+ echo ---------------------------------
+ cat /tmp/result
+ echo
+ echo ---------------------------------------------------------------------------------------------------
+ drop_db;
+ kill_is;
+ exit 1
fi
}
http://egee.cesnet.cz/en/Schema/LB/Attributes:user
OK
-<?xml version="1.0" encoding="UTF-8"?><jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus2</jobid><owner>OwnerName</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Ready</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
+<jpisclient:QueryJobsResponse 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"><jobs><jobid>https://localhost:7846/pokus2</jobid><owner>OwnerName</owner><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus</name><value><string>Ready</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><attributes><name>http://egee.cesnet.cz/en/Schema/LB/Attributes:user</name><value><string>CertSubj</string></value><timestamp>1970-01-01T02:00:01Z</timestamp><origin>SYSTEM</origin></attributes><primaryStorage>http://localhost:8901</primaryStorage></jobs></jpisclient:QueryJobsResponse>
#include <glite/jp/types.h>
#include <glite/jp/context.h>
+#include "soap_version.h"
+#include <glite/security/glite_gscompat.h>
+
#include "conf.h"
#include "db_ops.h"
#include "ws_is_typeref.h"
+#include <glite/jp/ws_fault.c>
#define SOAP_FMAC3 static
#define WITH_NOGLOBAL
int glite_jp_get_conf(int argc, char **argv, char *config_file, glite_jp_is_conf **configuration)
{
- char *ps = NULL, *qt = NULL, *conf_file = NULL;
+ char *qt = NULL, *conf_file = NULL;
int opt;
glite_jp_is_conf *conf;
}
}
if (out.__sizefeeds) {
-#warning FIXME: list
conf->feeds = calloc(out.__sizefeeds + 1, sizeof(*conf->feeds));
for (i=0; i < out.__sizefeeds; i++) {
+ struct jptype__feedSession *feed;
+
+ feed = GLITE_SECURITY_GSOAP_LIST_GET(out.feeds, i);
conf->feeds[i] = calloc(1, sizeof(*conf->feeds[i]));
- conf->feeds[i]->PS_URL=strdup(out.feeds[i]->primaryServer);
+ conf->feeds[i]->PS_URL=strdup(feed->primaryServer);
- if (out.feeds[i]->__sizecondition) {
- glite_jpis_SoapToPrimaryQueryConds(&soap, out.feeds[i]->__sizecondition,
- out.feeds[i]->condition, &conf->feeds[i]->query);
+ if (feed->__sizecondition) {
+ glite_jpis_SoapToPrimaryQueryConds(&soap, feed->__sizecondition,
+ feed->condition, &conf->feeds[i]->query);
}
- conf->feeds[i]->history = out.feeds[0]->history;
- conf->feeds[i]->continuous = out.feeds[0]->continuous;
+ conf->feeds[i]->history = feed->history;
+ conf->feeds[i]->continuous = feed->continuous;
}
}
int retval;
struct _jpelem__ServerConfigurationResponse out;
struct soap soap;
-
+ struct jptype__feedSession *feed;
+ struct jptype__primaryQuery *cond;
soap_init(&soap);
soap_set_namespaces(&soap, jpis__namespaces);
out.plugins[0] = strdup("plugin1");
out.plugins[1] = strdup("plugin2");
-#warning: FIXME: lists
- out.__sizefeeds = 1;
- out.feeds = calloc(1, sizeof(*out.feeds));
- out.feeds[0] = calloc(1, sizeof(*out.feeds[0]));
- out.feeds[0]->primaryServer = strdup("PrimaryServer");
- out.feeds[0]->__sizecondition = 1;
- out.feeds[0]->condition = calloc(1, sizeof(*(out.feeds[0]->condition)) );
- out.feeds[0]->condition[0] = calloc(1, sizeof(*(out.feeds[0]->condition[0])) );
- out.feeds[0]->condition[0]->attr = strdup("queryAttr");
- out.feeds[0]->condition[0]->op = jptype__queryOp__EQUAL;
- out.feeds[0]->condition[0]->origin = jptype__attrOrig__SYSTEM;
- out.feeds[0]->condition[0]->value = calloc(1, sizeof(*(out.feeds[0]->condition[0]->value)) );
- out.feeds[0]->condition[0]->value->string = strdup("attrValue");
- out.feeds[0]->history = 1;
- out.feeds[0]->continuous = 0;
+ GLITE_SECURITY_GSOAP_LIST_CREATE(&soap, &out, feeds, struct jptype__feedSession, 1);
+ feed = GLITE_SECURITY_GSOAP_LIST_GET(out.feeds, 0);
+ feed->primaryServer = strdup("PrimaryServer");
+ feed->__sizecondition = 1;
+ GLITE_SECURITY_GSOAP_LIST_CREATE(&soap, feed, condition, struct jptype__primaryQuery, 1);
+ cond = GLITE_SECURITY_GSOAP_LIST_GET(feed->condition, 0);
+ cond->attr = strdup("queryAttr");
+ cond->op = jptype__queryOp__EQUAL;
+ cond->origin = jptype__attrOrig__SYSTEM;
+ cond->value = calloc(1, sizeof(*(cond->value)));
+ GSOAP_SETSTRING(cond->value, soap_strdup(&soap, "attrValue"));
+ feed->history = 1;
+ feed->continuous = 0;
soap_serialize__jpelem__ServerConfigurationResponse(&soap, &out);
retval = soap_put__jpelem__ServerConfigurationResponse(&soap, &out, "jpelem:ServerConfiguration", NULL);
qwhere = strdup("");
for (i=0; i < in->__sizeconditions; i++) {
- {
- struct jptype__indexQuery *condition;
-
- condition = GLITE_SECURITY_GSOAP_LIST_GET(in->conditions, i);
-
- /* attr name */
- if (strcmp(condition->attr, GLITE_JP_ATTR_JOBID) == 0) {
- /* no subset from attr_ table, used jobs table instead */
- attr_md5 = NULL;
- qa = strdup("(");
- } else {
- attr_md5 = str2md5(condition->attr);
+ struct jptype__indexQuery *condition;
+
+ condition = GLITE_SECURITY_GSOAP_LIST_GET(in->conditions, i);
+
+ /* attr name */
+ if (strcmp(condition->attr, GLITE_JP_ATTR_JOBID) == 0) {
+ /* no subset from attr_ table, used jobs table instead */
+ attr_md5 = NULL;
+ qa = strdup("(");
+ } else {
+ attr_md5 = str2md5(condition->attr);
+
+ /* origin */
+ if (condition->origin) {
+ glite_jpis_SoapToAttrOrig(soap, condition->origin, &orig);
+ trio_asprintf(&qb, "attr_%|Ss.origin = %d AND ", attr_md5, orig);
+ } else
+ trio_asprintf(&qb, "");
+
+ /* select given records in attr_ table */
+ trio_asprintf(&qa,"%s%s jobs.jobid = attr_%|Ss.jobid AND (",
+ (i ? "AND" : ""), qb, attr_md5);
+
+ free(qb);
+ }
- /* origin */
- if (condition->origin) {
- glite_jpis_SoapToAttrOrig(soap, 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) */
+ for (j=0; j < condition->__sizerecord; j++) {
+ struct jptype__indexQueryRecord *record;
- /* select given records in attr_ table */
- trio_asprintf(&qa,"%s%s jobs.jobid = attr_%|Ss.jobid AND (",
- (i ? "AND" : ""), qb, attr_md5);
+ record = GLITE_SECURITY_GSOAP_LIST_GET(condition->record, j);
+ if (get_op(record->op, &qop)) goto err;
+ if (attr_md5) add_attr_table(attr_md5, &attr_tables);
- free(qb);
+ attr.name = condition->attr;
+ if (GSOAP_ISSTRING(record->value)) {
+ attr.value = GSOAP_STRING(record->value);
+ attr.binary = 0;
+ } else {
+ attr.value = GSOAP_BLOB(record->value)->__ptr;
+ attr.size = GSOAP_BLOB(record->value)->__size;
+ attr.binary = 1;
}
-
- /* inside part of the condition: record list (ORs) */
- for (j=0; j < condition->__sizerecord; j++) {
- struct jptype__indexQueryRecord *record;
-
- record = GLITE_SECURITY_GSOAP_LIST_GET(condition->record, j);
- if (get_op(record->op, &qop)) goto err;
- if (attr_md5) add_attr_table(attr_md5, &attr_tables);
-
- attr.name = condition->attr;
- if (GSOAP_ISSTRING(record->value)) {
- attr.value = GSOAP_STRING(record->value);
- attr.binary = 0;
- } else {
- attr.value = GSOAP_BLOB(record->value)->__ptr;
- attr.size = GSOAP_BLOB(record->value)->__size;
- attr.binary = 1;
- }
- glite_jpis_SoapToAttrOrig(soap,
- condition->origin, &(attr.origin));
- if (strcmp(condition->attr, GLITE_JP_ATTR_JOBID) == 0) {
- trio_asprintf(&qb,"%s%sjobs.dg_jobid %s \"%|Ss\"",
- qa, (j ? " OR " : ""), qop, attr.value);
- } else {
- trio_asprintf(&qb,"%s%sattr_%|Ss.value %s \"%|Ss\"",
- qa, (j ? " OR " : ""), attr_md5, qop,
- glite_jp_attrval_to_db_index(ctx->jpctx, &attr, 255));
- }
- free(qop);
- free(qa); qa = qb; qb = NULL;
+ glite_jpis_SoapToAttrOrig(soap,
+ condition->origin, &(attr.origin));
+ if (strcmp(condition->attr, GLITE_JP_ATTR_JOBID) == 0) {
+ trio_asprintf(&qb,"%s%sjobs.dg_jobid %s \"%|Ss\"",
+ qa, (j ? " OR " : ""), qop, attr.value);
+ } else {
+ trio_asprintf(&qb,"%s%sattr_%|Ss.value %s \"%|Ss\"",
+ qa, (j ? " OR " : ""), attr_md5, qop,
+ glite_jp_attrval_to_db_index(ctx->jpctx, &attr, 255));
}
- trio_asprintf(&qb,"%s %s)", qwhere, qa);
- free(qa); qwhere = qb; qb = NULL; qa = NULL;
- free(attr_md5);
+ free(qop);
+ free(qa); qa = qb; qb = NULL;
}
+ trio_asprintf(&qb,"%s %s)", qwhere, qa);
+ free(qa); qwhere = qb; qb = NULL; qa = NULL;
+ free(attr_md5);
}
qa = strdup("");
#include <stdsoap2.h>
#include <glite/jp/types.h>
+#include "soap_version.h"
#include "jpis_H.h"
#include "ws_typemap.h"
+#include <glite/security/glite_gscompat.h>
#include "ws_is_typeref.h"
#include "glite/jp/ws_fault.c"
int glite_jpis_SoapToPrimaryQueryConds(
struct soap *soap,
int size,
- struct jptype__primaryQuery **in,
+ GLITE_SECURITY_GSOAP_LIST_TYPE(jptype, primaryQuery) in,
glite_jp_query_rec_t ***out)
{
glite_jp_query_rec_t **qr;
qr = calloc(size+1, sizeof(*qr));
for (i=0; i<size; i++) {
- if ( SoapToPrimaryQueryCond(soap, in[i], &(qr[i])) ) {
+ if ( SoapToPrimaryQueryCond(soap, GLITE_SECURITY_GSOAP_LIST_GET(in, i), &(qr[i])) ) {
*out = NULL;
return 1;
}
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, struct jptype__primaryQuery **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);
#endif
memset(val, 0, sizeof(*val) );
if (binary) {
- GSOAP_STRING(val) = NULL;
- if ( !(GSOAP_BLOB(val) = soap_malloc(soap, sizeof(*GSOAP_BLOB(val)))) ) return SOAP_FAULT;
+ GSOAP_SETBLOB(val, soap_malloc(soap, sizeof(*GSOAP_BLOB(val))));
+ if ( !GSOAP_BLOB(val) ) return SOAP_FAULT;
GSOAP_BLOB(val)->__size = size;
if ( !(GSOAP_BLOB(val)->__ptr = soap_malloc(soap, GSOAP_BLOB(val)->__size)) ) return SOAP_FAULT;
memcpy(GSOAP_BLOB(val)->__ptr, in, GSOAP_BLOB(val)->__size);
// XXX how to handle id, type, option?
}
else {
- GSOAP_BLOB(val) = NULL;
- if ( !(GSOAP_STRING(val) = soap_strdup(soap, in)) ) return SOAP_FAULT;
+ GSOAP_SETSTRING(val, soap_strdup(soap, in));
+ if ( !(GSOAP_STRING(val) ) ) return SOAP_FAULT;
}
*out = val;
void glite_jpis_SoapToAttrVal(glite_jp_attrval_t *av, const struct jptype__attrValue *attr) {
memset(av, 0, sizeof(*av));
av->name = attr->name;
- av->binary = GSOAP_BLOB(attr->value) ? 1 : 0;
- assert(av->binary || GSOAP_STRING(attr->value));
+ av->binary = GSOAP_ISBLOB(attr->value);
if (av->binary) {
av->value = GSOAP_BLOB(attr->value)->__ptr;
av->size = GSOAP_BLOB(attr->value)->__size ;