summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/kernel/element.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-24 09:27:52 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-24 09:27:52 +0000
commit878131a50cf9651fc8de402420b8c94696328a3c (patch)
treed0112887a0204bbf6ad9e76ae062ca4b70bc094a /sca-cpp/trunk/kernel/element.hpp
parent1c21d758af81d880ad6e045d18f8bc62ad8be89e (diff)
Working Web service component using Axis2C 1.6. Some fixes to the JSON conversion functions to correctly handle all cases of nested objects and arrays. Added support for component properties, the Web service component has a URI property that can be configured to the address of the target Web service.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@902540 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/kernel/element.hpp')
-rw-r--r--sca-cpp/trunk/kernel/element.hpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/sca-cpp/trunk/kernel/element.hpp b/sca-cpp/trunk/kernel/element.hpp
index 4570110e96..0d14acc4a3 100644
--- a/sca-cpp/trunk/kernel/element.hpp
+++ b/sca-cpp/trunk/kernel/element.hpp
@@ -37,6 +37,7 @@ namespace tuscany
*/
const value attribute("attribute");
const value element("element");
+const string atsign("@");
/**
* Returns true if a value is an element.
@@ -125,7 +126,7 @@ const value elementToValue(const value& t) {
// Convert an attribute
if (isTaggedList(t, attribute))
- return mklist(attributeName(t), attributeValue(t));
+ return mklist<value>(c_str(atsign + attributeName(t)), attributeValue(t));
// Convert an element
if (isTaggedList(t, element)) {
@@ -196,9 +197,12 @@ const value valueToElement(const value& t) {
const value n = car<value>(t);
const value v = cadr<value>(t);
- // Convert a single value
- if (!isList(v))
+ // Convert a single value to an attribute or an element
+ if (!isList(v)) {
+ if (substr(n, 0, 1) == atsign)
+ return mklist<value>(attribute, substr(n, 1), v);
return mklist(element, n, v);
+ }
// Convert a list value
if (isNil((list<value>)v) || !isSymbol(car<value>(v)))