1
/* Contributed by Allan Kelly, June 17, 2002
2
Provides C++ alternatives for
3
soap_print_fault and soap_print_fault_location functions
6
/******************************************************************************/
11
soap_print_fault(struct soap *soap, std::ostream& msg)
13
{ if (!*soap_faultcode(soap))
15
if (!*soap_faultstring(soap))
16
*soap_faultstring(soap) = "";
18
<< *soap_faultcode(soap) << std::endl
19
<< "\"" << *soap_faultstring(soap) << "\"" << std::endl;
20
if (*soap_faultdetail(soap))
21
msg << "Detail: " << *soap_faultdetail(soap) << std::endl;
25
/******************************************************************************/
30
soap_print_fault_location(struct soap *soap, std::ostream& msg)
32
if (soap->error && soap->buflen > 0)
33
{ if (soap->bufidx == 0)
35
c = soap->buf[soap->bufidx-1];
36
soap->buf[soap->bufidx-1] = '\0';
37
if (soap->bufidx < soap->buflen)
38
msg << soap->buf << static_cast<char> (c) << std::endl
39
<< "** HERE **" << std::endl << soap->buf+soap->bufidx
42
msg << soap->buf << static_cast<char> (c) << std::endl
43
<< "** HERE **" << std::endl;
47
/******************************************************************************/