struct soap *mydlo = soap_new();
struct _lbe__QueryEventsResponse out;
struct _lbe__QueryEvents in;
+ edg_wll_QueryRec **jconds = NULL,
+ **econds = NULL;
edg_wll_QueryRec j[2], e[1];
- int opt, err;
+ int opt, err, i;
edg_wlc_JobId job;
char *server = "http://localhost:9003/",
*jobid = NULL,
j[0].op = EDG_WLL_QUERY_OP_EQUAL;
j[0].value.j = job;
- edg_wll_QueryCondsExtToSoap(mydlo, (const edg_wll_QueryRec **)j,
- &in.__sizejobConditions, &in.jobConditions);
- edg_wll_QueryCondsExtToSoap(mydlo, (const edg_wll_QueryRec **)e,
- &in.__sizeeventConditions, &in.eventConditions);
+
+ jconds = (edg_wll_QueryRec **) calloc(2, sizeof(edg_wll_QueryRec *));
+ for ( i = 0; i < 2; i++ )
+ {
+ jconds[i] = (edg_wll_QueryRec *) calloc(2, sizeof(edg_wll_QueryRec));
+ jconds[i][0] = j[i];
+ }
+
+ econds = (edg_wll_QueryRec **) calloc(1, sizeof(edg_wll_QueryRec *));
+ for ( i = 0; i < 1; i++ )
+ {
+ econds[i] = (edg_wll_QueryRec *) calloc(1, sizeof(edg_wll_QueryRec));
+ econds[i][0] = e[i];
+ }
+
+
+ if (edg_wll_QueryCondsExtToSoap(mydlo, (const edg_wll_QueryRec **)jconds,
+ &in.__sizejobConditions, &in.jobConditions) != SOAP_OK) {
+ printf("Error converting QueryConds to Soap!\n");
+ return(1);
+ }
+
+ //edg_wll_QueryCondsExtToSoap(mydlo, (const edg_wll_QueryRec **)econds,
+ // &in.__sizeeventConditions, &in.eventConditions);
+
+ //in.jobConditions = NULL;
+ //in.__sizejobConditions = 0;
+ in.eventConditions = NULL;
+ in.__sizeeventConditions = 0;
switch (err = soap_call___lb__QueryEvents(mydlo, server, "",&in,&out))
{
case SOAP_OK:
{
- edg_wll_Event *events;
+ edg_wll_Event *events = NULL;
int i;
edg_wll_SoapToEvents(mydlo,out,&events);
- for ( i = 0; events[i].type != EDG_WLL_EVENT_UNDEF; i++ )
+ for ( i = 0; events && events[i].type != EDG_WLL_EVENT_UNDEF; i++ )
{
char *e = edg_wll_UnparseEvent(ctx,events+i);
fputs(e,stdout);
edg_wll_Context ctx = (edg_wll_Context) glite_gsplugin_get_udata(soap);
edg_wll_QueryRec **job_conditions;
edg_wll_QueryRec **event_conditions;
- edg_wll_Event *events;
+ edg_wll_Event *events = NULL;
int ret = SOAP_OK;
edg_wll_ResetError(ctx);
- if ( edg_wll_SoapToQueryCondsExt(*in->jobConditions, in->__sizejobConditions,
+ if ( edg_wll_SoapToQueryCondsExt(in->jobConditions, in->__sizejobConditions,
&job_conditions) )
{
edg_wll_SetError(ctx, ENOMEM, "Couldn't create internal structures");
goto cleanup;
}
- if ( edg_wll_SoapToQueryCondsExt(*in->eventConditions, in->__sizeeventConditions,
+ if ( edg_wll_SoapToQueryCondsExt(in->eventConditions, in->__sizeeventConditions,
&event_conditions) )
{
edg_wll_SetError(ctx, ENOMEM, "Couldn't create internal structures");
if ( !qc->statName ) return SOAP_FAULT;
edg_wll_JobStatCodeToSoap(in->attr_id.state, qc->statName);
}
- else {
+ else if ( in->attr == EDG_WLL_QUERY_ATTR_USERTAG) {
qc->tagName = soap_strdup(soap, in->attr_id.tag);
if ( !qc->tagName ) return SOAP_FAULT;
}
- i = 0;
- while ( in[i].attr ) qc->__sizerecord++;
+ qc->__sizerecord = 0;
+ while ( in[qc->__sizerecord++].attr );
if ( !qc->__sizerecord )
goto ret;
edg_wll_QueryRec **qr;
- assert(in); assert(out);
+ assert(out);
if ( !(qr = calloc(__sizecondition, sizeof(*qr))) ) return -1;
for ( i = 0; i < __sizecondition; i++ )
if ( edg_wll_SoapToQueryConds(in[i], qr+i) ) goto err;
assert(in); assert(out);
- i = 0;
- while ( in[i] ) size++;
+ size = 0;
+ while ( in[size] ) size++;
if ( !size )
goto ret;
if ( !qc ) return SOAP_FAULT;
for ( i = 0; in[i]; i++ )
- if ( edg_wll_QueryCondsToSoap(soap, in[i], qc[i]) )
+ if ( edg_wll_QueryCondsToSoap(soap, in[i], &qc[i]) )
return SOAP_FAULT;
ret: