free(ed);
}
-/* FIXME: assignment from incompatible pointer type */
- detail = soap_faultdetail(soap);
+ detail = (struct SOAP_ENV__Detail *)soap_faultdetail(soap);
detail->__type = GFNUM;
#if GSOAP_VERSION >= 20700
detail->fault = f;
if (soap->version == 2) soap->fault->SOAP_ENV__Detail = detail;
else soap->fault->detail = detail;
}
-
-
-void edg_wll_FaultToErr(const struct soap *soap,edg_wll_Context ctx)
-{
- struct SOAP_ENV__Detail *detail;
- struct lbt__genericFault *f;
-
- if (!soap->fault) {
- edg_wll_SetError(ctx,EINVAL,"SOAP: (no error info)");
- return;
- }
-
- detail = soap->version == 2 ? soap->fault->SOAP_ENV__Detail : soap->fault->detail;
- if (detail->__type == GFNUM) {
-#if GSOAP_VERSION >= 20709
- f = (struct lbt__genericFault *)detail->fault;
-#elif GSOAP_VERSION >= 20700
- f = ((struct _genericFault *) detail->fault)
- ->lbe__genericFault;
-#else
- f = ((struct _genericFault *) detail->value)
- ->lbe__genericFault;
-#endif
- if (f) edg_wll_SetError(ctx,f->code,f->description);
- else edg_wll_SetError(ctx, EIO, "no or not parsable error from SOAP");
- }
- else {
- char *s;
-
- if (detail->__any) asprintf(&s, "SOAP: %s", detail->__any);
- else asprintf(&s,"SOAP: %s", soap->version == 2 ?
- GLITE_SECURITY_GSOAP_REASON(soap) : soap->fault->faultstring);
- edg_wll_SetError(ctx,EINVAL,s);
- free(s);
- }
-}
limitations under the License.
*/
+#define _GNU_SOURCE 1
+
#include <string.h>
#include <stdio.h>
#if GSOAP_VERSION >= 20709
- #define GFITEM reason
#define GFNUM SOAP_TYPE_lbt__genericFault
#else
- #define GFITEM lbe__genericFault
#define GFNUM SOAP_TYPE__genericFault
#endif
struct lbt__genericFault *f;
if (!soap->fault) {
- *text = NULL;
+ *text = strdup("SOAP: (no error info)");
return EINVAL;
}
detail = soap->version == 2 ? soap->fault->SOAP_ENV__Detail : soap->fault->detail;
if (detail->__type == GFNUM) {
#if GSOAP_VERSION >= 20709
- f = detail->lbe__genericFault;
+ f = (struct lbt__genericFault *)detail->fault;
#elif GSOAP_VERSION >= 20700
f = ((struct _genericFault *) detail->fault)
->lbe__genericFault;
f = ((struct _genericFault *) detail->value)
->lbe__genericFault;
#endif
- *text = strdup(f->description);
- return f->code;
+ if (f && (f->description || f->text)) {
+ *text = strdup(f->description ? : f->text);
+ return f->code;
+ } else {
+ *text = strdup("no or not parsable error from SOAP");
+ return EINVAL;
+ }
}
else {
- asprintf(text,"SOAP: %s", soap->version == 2 ?
+ if (detail->__any) asprintf(text, "SOAP: %s", detail->__any);
+ else asprintf(text,"SOAP: %s", soap->version == 2 ?
GLITE_SECURITY_GSOAP_REASON(soap) : soap->fault->faultstring);
return EINVAL;
}
struct soap *mydlo = soap_new();
struct _lbe__QueryEventsResponse out,*outp = &out;
struct _lbe__QueryEvents in;
- int opt, err, i;
+ int opt, err;
char *server = "http://localhost:9003/",
*jobid = NULL,
*name = NULL;
- struct lbt__queryConditions qc,*qcp;
- struct lbt__queryRecord qr,*qrp;
+ struct lbt__queryConditions *qcp;
+ struct lbt__queryRecord *qrp;
struct lbt__queryRecValue qv;
name = strrchr(argv[0],'/');
return 1;
}
- qcp = &qc;
- in.jobConditions = &qcp;
- in.__sizejobConditions = 1;
+ GLITE_SECURITY_GSOAP_LIST_CREATE(mydlo, &in, jobConditions, struct lbt__queryConditions, 1);
+ qcp = GLITE_SECURITY_GSOAP_LIST_GET(in.jobConditions, 0);
in.eventConditions = NULL;
in.__sizeeventConditions = 0;
- memset(&qc,0,sizeof qc);
- qc.attr = lbt__queryAttr__JOBID;
- qc.__sizerecord = 1;
- qc.record = &qrp;
- qrp = &qr;
+ memset(qcp,0,sizeof(*qcp));
+ qcp->attr = lbt__queryAttr__JOBID;
+ GLITE_SECURITY_GSOAP_LIST_CREATE(mydlo, qcp, record, struct lbt__queryRecord, 1);
+ qrp = GLITE_SECURITY_GSOAP_LIST_GET(qcp->record, 0);
- memset(&qr,0,sizeof qr);
- qr.op = lbt__queryOp__EQUAL;
- qr.value1 = &qv;
+ memset(qrp,0,sizeof(*qrp));
+ qrp->op = lbt__queryOp__EQUAL;
+ qrp->value1 = &qv;
GLITE_SECURITY_GSOAP_CHOICE_SET(&qv,c,lbt,queryRecValue,2,jobid);
#include "glite/security/glite_gscompat.h"
#include "bk_ws_H.h"
+#include "ws_fault.h"
#if GSOAP_VERSION <= 20602
#define soap_call___lb__JobStatus soap_call___ns1__JobStatus
#include "glite/security/glite_gscompat.h"
#include "bk_ws_H.h"
+#include "ws_fault.h"
#include "LoggingAndBookkeeping.nsmap"
char *server = "http://localhost:9003/",
*jobid = NULL,
*name = NULL;
+ int ret_code = 1;
name = strrchr(argv[0],'/');
soap_begin_send(outsoap);
soap_put_PointerTo_lb4ague__GetActivityInfoResponse(outsoap,&out,"status","http://glite.org/wsdl/services/lb4agu:GetActivityInfoResponse");
soap_end_send(outsoap);
+
+ ret_code = 0;
}
break;
case SOAP_FAULT:
err = glite_lb_FaultToErr(mydlo,&et);
fprintf(stderr,"%s: %s (%s)\n",argv[0],strerror(err),et);
- exit(1);
}
+ break;
default:
fprintf(stderr,"err = %d\n",err);
soap_print_fault(mydlo,stderr);
free(mydlo);
glite_gsplugin_free_context(gsplugin_ctx);
- return 0;
+ return ret_code;
}
#include "glite/security/glite_gscompat.h"
#include "bk_ws_H.h"
+#include "ws_fault.h"
#include "LoggingAndBookkeeping.nsmap"
char *server = "http://localhost:9003/",
*jobid = NULL,
*name = NULL;
+ int ret_code = 1;
name = strrchr(argv[0],'/');
in = soap_malloc(mydlo, sizeof(*in));
- out = soap_malloc(mydlo, sizeof(*out));
+ in->id = soap_malloc(mydlo, 1 * sizeof(char *));
in->id[0] = soap_strdup(mydlo, jobid);
in->__sizeid = 1;
+ out = soap_malloc(mydlo, sizeof(*out));
switch (err = soap_call___lb4agu__GetActivityStatus(mydlo, server, "",in,out)) {
case SOAP_OK:
soap_begin_send(outsoap);
soap_put_PointerTo_lb4ague__GetActivityStatusResponse(outsoap,&out,"status","http://glite.org/wsdl/services/lb4agu:GetActivityStatusResponse");
soap_end_send(outsoap);
+
+ ret_code = 0;
}
break;
case SOAP_FAULT:
err = glite_lb_FaultToErr(mydlo,&et);
fprintf(stderr,"%s: %s (%s)\n",argv[0],strerror(err),et);
- exit(1);
}
+ break;
default:
fprintf(stderr,"err = %d\n",err);
soap_print_fault(mydlo,stderr);
free(mydlo);
glite_gsplugin_free_context(gsplugin_ctx);
- return 0;
+ return ret_code;
}