static void glite_jp_server_err2fault(const glite_jp_context_t ctx,struct soap *soap)
{
struct SOAP_ENV__Detail *detail;
+ struct jptype__genericFault *item;
#if GSOAP_VERSION >= 20709
struct jptype__genericFault *f;
- f = jp2s_error(soap,ctx->error);
+ item = f = jp2s_error(soap,ctx->error);
#else
struct _genericFault *f = soap_malloc(soap, sizeof *f);
- f->jpelem__genericFault = jp2s_error(soap,ctx->error);
+ item = f->jpelem__genericFault = jp2s_error(soap,ctx->error);
#endif
soap_receiver_fault(soap,"Oh, shit!",NULL);
// no error in JP context?
- if (!f) return;
+ if (!item) return;
- detail = soap_malloc(soap,sizeof *detail);
- memset(detail, 0, sizeof(*detail));
+ detail = soap_faultdetail(soap);
#if GSOAP_VERSION >= 20700
detail->fault = (void *)f;
#else
#endif
detail->__type = GFNUM;
detail->__any = NULL;
-
- if (soap->version == 2) soap->fault->SOAP_ENV__Detail = detail;
- else soap->fault->detail = detail;
}
memset(&in, 0, sizeof in);
memset(&out, 0, sizeof out);
+ soap_begin(mydlo);
if (edg_wll_QueryCondsExtToSoap(mydlo, (const edg_wll_QueryRec **)jconds,
&in.__sizejobConditions, &in.jobConditions) != SOAP_OK) {
printf("Error converting QueryConds to Soap!\n");
+ soap_end(mydlo);
+ soap_done(mydlo);
+ glite_gsplugin_free_context(gsplugin_ctx);
+ edg_wll_FreeContext(ctx);
return(1);
}
edg_wll_FaultToErr(mydlo,ctx);
edg_wll_Error(ctx,&et,&ed);
fprintf(stderr,"%s: %s (%s)\n",argv[0],et,ed);
- soap_done(mydlo);
+ soap_end(mydlo);
+ soap_done(mydlo); free(mydlo);
+ glite_gsplugin_free_context(gsplugin_ctx);
+ edg_wll_FreeContext(ctx);
exit(1);
}
default:
void edg_wll_ErrToFault(const edg_wll_Context ctx,struct soap *soap)
{
char *et,*ed;
- struct SOAP_ENV__Detail *detail = soap_malloc(soap,sizeof *detail);
+ struct SOAP_ENV__Detail *detail;
#if GSOAP_VERSION >= 20709
struct lbt__genericFault *f = soap_malloc(soap,sizeof *f);
struct lbt__genericFault *item = f;
free(ed);
}
+ detail = soap_faultdetail(soap);
detail->__type = GFNUM;
#if GSOAP_VERSION >= 20700
detail->fault = f;
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
- edg_wll_SetError(ctx,f->code,f->description);
+ 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;
- asprintf(&s,"SOAP: %s", soap->version == 2 ?
+ 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);