0
|
1 /*
|
|
2 Contributed by Allan Kelly, June 17, 2002
|
|
3 Provides C++ alternatives for
|
|
4 soap_print_fault and soap_print_fault_location functions
|
|
5
|
|
6 Note: soap_stream_fault in stdsoap2.cpp provides similar functionality
|
|
7 */
|
|
8
|
|
9 /******************************************************************************/
|
|
10
|
|
11 SOAP_FMAC1
|
|
12 void
|
|
13 SOAP_FMAC2
|
|
14 soap_print_fault(struct soap *soap, std::ostream& msg)
|
|
15 { if (soap->error)
|
|
16 { if (!*soap_faultcode(soap))
|
|
17 soap_set_fault(soap);
|
|
18 if (!*soap_faultstring(soap))
|
|
19 *soap_faultstring(soap) = "";
|
|
20 msg << "SOAP FAULT: "
|
|
21 << *soap_faultcode(soap) << std::endl
|
|
22 << "\"" << *soap_faultstring(soap) << "\"" << std::endl;
|
|
23 if (*soap_faultdetail(soap))
|
|
24 msg << "Detail: " << *soap_faultdetail(soap) << std::endl;
|
|
25 }
|
|
26 }
|
|
27
|
|
28 /******************************************************************************/
|
|
29
|
|
30 SOAP_FMAC1
|
|
31 void
|
|
32 SOAP_FMAC2
|
|
33 soap_print_fault_location(struct soap *soap, std::ostream& msg)
|
|
34 { int c;
|
|
35 if (soap->error && soap->buflen > 0)
|
|
36 { if (soap->bufidx == 0)
|
|
37 soap->bufidx = 1;
|
|
38 c = soap->buf[soap->bufidx-1];
|
|
39 soap->buf[soap->bufidx-1] = '\0';
|
|
40 if (soap->bufidx < soap->buflen)
|
|
41 msg << soap->buf << static_cast<char> (c) << std::endl
|
|
42 << "** HERE **" << std::endl << soap->buf+soap->bufidx
|
|
43 << std::endl;
|
|
44 else
|
|
45 msg << soap->buf << static_cast<char> (c) << std::endl
|
|
46 << "** HERE **" << std::endl;
|
|
47 }
|
|
48 }
|
|
49
|
|
50 /******************************************************************************/
|