summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/components/webservice
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-05-28 04:39:18 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-05-28 04:39:18 +0000
commitf278315081b24b59bf73e9613e552e3519200a71 (patch)
treecdfe0e8d00e2c3e8002284c4541429f91cb66e68 /sca-cpp/trunk/components/webservice
parentc3eb9d1e20e1f8a7a101854d6a883692cac4e8d0 (diff)
Improve error reporting with a reason code. Improve debug and audit logging. Fix test scripts to cleanup state from previous builds and correctly report test errors.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343138 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/components/webservice')
-rw-r--r--sca-cpp/trunk/components/webservice/axis2.hpp8
-rwxr-xr-xsca-cpp/trunk/components/webservice/server-test1
-rw-r--r--sca-cpp/trunk/components/webservice/webservice-listener.cpp2
3 files changed, 6 insertions, 5 deletions
diff --git a/sca-cpp/trunk/components/webservice/axis2.hpp b/sca-cpp/trunk/components/webservice/axis2.hpp
index 62797d86f2..7630b54295 100644
--- a/sca-cpp/trunk/components/webservice/axis2.hpp
+++ b/sca-cpp/trunk/components/webservice/axis2.hpp
@@ -112,7 +112,7 @@ const failable<axiom_node_t*> stringToAxiomNode(const string& s, const Axis2Cont
const failable<axiom_node_t*> valuesToAxiomNode(const list<value>& l, const Axis2Context& ax) {
const failable<list<string> > xml = writeXML(valuesToElements(l), false);
if (!hasContent(xml))
- return mkfailure<axiom_node_t*>(reason(xml));
+ return mkfailure<axiom_node_t*>(xml);
ostringstream os;
write(content(xml), os);
return stringToAxiomNode(str(os), ax);
@@ -136,7 +136,7 @@ const failable<const string> axiomNodeToString(axiom_node_t* node, const Axis2Co
const failable<const list<value> > axiomNodeToValues(axiom_node_t* node, const Axis2Context& ax) {
const failable<const string> s = axiomNodeToString(node, ax);
if (!hasContent(s))
- return mkfailure<const list<value> >(reason(s));
+ return mkfailure<const list<value> >(s);
istringstream is(content(s));
const failable<const list<value> > l = readXML(streamList(is));
if (!hasContent(l))
@@ -170,7 +170,7 @@ const failable<value> evalExpr(const value& expr, const Axis2Context& ax) {
// Construct request Axiom node
const failable<axiom_node_t*> req = valuesToAxiomNode(param, ax);
if (!hasContent(req))
- return mkfailure<value>(reason(req));
+ return mkfailure<value>(req);
// Call the Web service
axiom_node_t* res = axis2_svc_client_send_receive(client, env(ax), content(req));
@@ -182,7 +182,7 @@ const failable<value> evalExpr(const value& expr, const Axis2Context& ax) {
// Parse result Axiom node
const failable<const list<value> > lval = axiomNodeToValues(res, ax);
if (!hasContent(lval))
- return mkfailure<value>(reason(lval));
+ return mkfailure<value>(lval);
const value rval = content(lval);
debug(rval, "webservice::evalExpr::result");
diff --git a/sca-cpp/trunk/components/webservice/server-test b/sca-cpp/trunk/components/webservice/server-test
index 35cca9f7ad..cb12accbfb 100755
--- a/sca-cpp/trunk/components/webservice/server-test
+++ b/sca-cpp/trunk/components/webservice/server-test
@@ -18,6 +18,7 @@
# under the License.
# Setup
+rm -rf tmp
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
diff --git a/sca-cpp/trunk/components/webservice/webservice-listener.cpp b/sca-cpp/trunk/components/webservice/webservice-listener.cpp
index e3347fa186..29ebef4bcb 100644
--- a/sca-cpp/trunk/components/webservice/webservice-listener.cpp
+++ b/sca-cpp/trunk/components/webservice/webservice-listener.cpp
@@ -47,7 +47,7 @@ extern "C" {
const value redirectToAxis2(const string& uri, request_rec* r, const value& relay) {
const failable<request_rec*, int> nr = httpd::internalRedirectRequest(uri, r);
if (!hasContent(nr))
- return value(reason(nr));
+ return value(reason(nr), rcode(nr));
ap_set_module_config(content(nr)->request_config, &axis2_module, const_cast<void*>((const void*)&relay));
return value(httpd::internalRedirect(content(nr)));
}