1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
/*
* Copyright (C) 2004-2005 by CERN/IT/GD/CT & CNRS/IN2P3/LAL
* All rights reserved
*/
// $Id: soapcallns1.ic,v 1.1 2006/12/19 20:05:29 grodid Exp $
char **faultcode;
char **faultstring;
char **faultdetail;
int nscount;
#define SOAP_CALL_NS1O(func) \
while (1) { \
if (soap_call_ns1__srm ## func (&soap, srm_endpoint, "srm" #func, \
&req, &rep)) { \
faultcode = (char**) soap_faultcode(&soap); \
faultstring = (char**) soap_faultstring(&soap); \
faultdetail = (char**) soap_faultdetail(&soap); \
printf (" SOAP fault processing:\ncode: %s\nstring: %s\ndetail: %s\n", faultcode[0], faultstring[0], faultdetail[0]); \
if ( ! strcmp(faultcode[0], "SOAP-ENV:Client") || ! strcmp(faultcode[0], "SOAP-ENV:Server") ) { \
printf (" SOAP fault: restarting soap_call_ns1__srm" #func "\n"); \
usleep(1000); \
continue; \
} else { \
soap_print_fault (&soap, stderr); \
soap_print_fault_location (&soap, stderr); \
soap_end (&soap); \
exit (1); \
} \
} \
break; \
}
#define SOAP_CALL_NS1(func, ptrs) \
nscount = 0; \
while (1) { \
if (soap_call_ns1__srm ## func (&soap, srm_endpoint, "srm" #func, \
& ptrs ## q, & ptrs ## p)) { \
faultcode = (char**) soap_faultcode(&soap); \
faultstring = (char**) soap_faultstring(&soap); \
faultdetail = (char**) soap_faultdetail(&soap); \
printf (" SOAP fault processing:\ncode: %s\nstring: %s\ndetail: %s\n", faultcode[0], faultstring[0], faultdetail[0]); \
if ( (! strcmp(faultcode[0], "SOAP-ENV:Client") || ! strcmp(faultcode[0], "SOAP-ENV:Server")) && nscount++ < 5 ) { \
printf (" SOAP fault: restarting soap_call_ns1__srm" #func "\n"); \
usleep(10000 * nscount); \
continue; \
} else { \
soap_print_fault (&soap, stderr); \
soap_print_fault_location (&soap, stderr); \
soap_end (&soap); \
exit (1); \
} \
} \
break; \
}
#define SOAP_CALL_NS1RO(func) \
while (1) { \
if (soap_call_ns1__srm ## func (&soap, srm_endpoint, "srm" #func, \
&sreq, &srep)) { \
faultcode = (char**) soap_faultcode(&soap); \
faultstring = (char**) soap_faultstring(&soap); \
faultdetail = (char**) soap_faultdetail(&soap); \
printf (" SOAP fault processing:\ncode: %s\nstring: %s\ndetail: %s\n", faultcode[0], faultstring[0], faultdetail[0]); \
if ( ! strcmp(faultcode[0], "SOAP-ENV:Client") || ! strcmp(faultcode[0], "SOAP-ENV:Server") ) { \
printf (" SOAP fault: restarting soap_call_ns1__srm" #func "\n"); \
usleep(1000); \
continue; \
} else { \
soap_print_fault (&soap, stderr); \
soap_print_fault_location (&soap, stderr); \
soap_end (&soap); \
exit (1); \
} \
} \
break; \
}
|