annotate GEMBASSY-1.0.3/gsoap/extras/fault.cpp @ 1:84a17b3fad1f draft

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