summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-11 08:29:45 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-11 08:29:45 +0000
commit030239cff2f98c0e7b2a66e1930008eed418e07d (patch)
tree6c5082ff8ccd673487404d4e20df1c1d26fd2ee4
parent81678737cc3682dd811660ca794851b72e2b1fbe (diff)
Created component structure and build files for Web service component using Axis2/C.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@897790 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-cpp/trunk/components/webservice/Makefile.am38
-rw-r--r--sca-cpp/trunk/components/webservice/client-test.cpp55
-rw-r--r--sca-cpp/trunk/components/webservice/webservice-test.cpp51
-rw-r--r--sca-cpp/trunk/components/webservice/webservice.composite32
-rw-r--r--sca-cpp/trunk/components/webservice/webservice.cpp52
-rw-r--r--sca-cpp/trunk/components/webservice/webservice.hpp41
6 files changed, 269 insertions, 0 deletions
diff --git a/sca-cpp/trunk/components/webservice/Makefile.am b/sca-cpp/trunk/components/webservice/Makefile.am
new file mode 100644
index 0000000000..e2971b5182
--- /dev/null
+++ b/sca-cpp/trunk/components/webservice/Makefile.am
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+if WANT_WEBSERVICE
+
+noinst_PROGRAMS = webservice-test client-test
+
+INCLUDES = -I${AXIS2C_INCLUDE}
+
+compdir=$(prefix)/components/webservice
+comp_LTLIBRARIES = libwebservice.la
+
+libwebservice_la_SOURCES = webservice.cpp
+libwebservice_la_LIBADD = -lxml2 -L${AXIS2C_LIB} -laxis2_engine
+
+webservice_test_SOURCES = webservice-test.cpp
+webservice_test_LDADD = -lxml2 -L${AXIS2C_LIB} -laxis2_engine
+
+client_test_SOURCES = client-test.cpp
+client_test_LDADD = -lxml2 -lcurl -lmozjs
+
+TESTS = webservice-test client-test
+
+endif \ No newline at end of file
diff --git a/sca-cpp/trunk/components/webservice/client-test.cpp b/sca-cpp/trunk/components/webservice/client-test.cpp
new file mode 100644
index 0000000000..c2593e75d9
--- /dev/null
+++ b/sca-cpp/trunk/components/webservice/client-test.cpp
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+/**
+ * Test Web service component.
+ */
+
+#include <assert.h>
+#include "stream.hpp"
+#include "string.hpp"
+#include "list.hpp"
+#include "value.hpp"
+#include "monad.hpp"
+#include "perf.hpp"
+#include "../../modules/http/curl.hpp"
+
+namespace tuscany {
+namespace webservice {
+
+const string url("http://localhost:8090/echo");
+
+bool testEval() {
+ return true;
+}
+
+}
+}
+
+int main() {
+ tuscany::cout << "Testing..." << tuscany::endl;
+
+ tuscany::webservice::testEval();
+
+ tuscany::cout << "OK" << tuscany::endl;
+
+ return 0;
+}
diff --git a/sca-cpp/trunk/components/webservice/webservice-test.cpp b/sca-cpp/trunk/components/webservice/webservice-test.cpp
new file mode 100644
index 0000000000..e544b193c8
--- /dev/null
+++ b/sca-cpp/trunk/components/webservice/webservice-test.cpp
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+/**
+ * Test WebService component.
+ */
+
+#include <assert.h>
+#include "stream.hpp"
+#include "string.hpp"
+#include "list.hpp"
+#include "perf.hpp"
+#include "webservice.hpp"
+
+namespace tuscany {
+namespace webservice {
+
+bool testEval() {
+ return true;
+}
+
+}
+}
+
+int main() {
+ tuscany::cout << "Testing..." << tuscany::endl;
+
+ tuscany::webservice::testEval();
+
+ tuscany::cout << "OK" << tuscany::endl;
+
+ return 0;
+}
diff --git a/sca-cpp/trunk/components/webservice/webservice.composite b/sca-cpp/trunk/components/webservice/webservice.composite
new file mode 100644
index 0000000000..3e6be1fae6
--- /dev/null
+++ b/sca-cpp/trunk/components/webservice/webservice.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/components"
+ name="webservice">
+
+ <component name="webservice">
+ <t:implementation.cpp uri=".libs/libwebservice"/>
+ <service name="webservice">
+ <t:binding.http uri="webservice"/>
+ </service>
+ </component>
+
+</composite>
diff --git a/sca-cpp/trunk/components/webservice/webservice.cpp b/sca-cpp/trunk/components/webservice/webservice.cpp
new file mode 100644
index 0000000000..769df9e258
--- /dev/null
+++ b/sca-cpp/trunk/components/webservice/webservice.cpp
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+/**
+ * Web service component implementation.
+ */
+
+#include "string.hpp"
+#include "function.hpp"
+#include "list.hpp"
+#include "value.hpp"
+#include "monad.hpp"
+#include "webservice.hpp"
+
+namespace tuscany {
+namespace webservice {
+
+/**
+ * Evaluate a Web service function / operation.
+ */
+const failable<value> eval(const value& func, unused const list<value>& params) {
+ return tuscany::mkfailure<tuscany::value>(tuscany::string("Function not supported: ") + func);
+}
+
+}
+}
+
+extern "C" {
+
+const tuscany::value eval(const tuscany::list<tuscany::value>& params) {
+ return tuscany::webservice::eval(car(params), cdr(params));
+}
+
+}
diff --git a/sca-cpp/trunk/components/webservice/webservice.hpp b/sca-cpp/trunk/components/webservice/webservice.hpp
new file mode 100644
index 0000000000..8214d77c86
--- /dev/null
+++ b/sca-cpp/trunk/components/webservice/webservice.hpp
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+#ifndef tuscany_webservice_hpp
+#define tuscany_webservice_hpp
+
+/**
+ * Web service invocation functions using Axis2.
+ */
+
+#include "string.hpp"
+#include "list.hpp"
+#include "value.hpp"
+#include "monad.hpp"
+#include "debug.hpp"
+
+namespace tuscany {
+namespace webservice {
+
+}
+}
+
+#endif /* tuscany_webservice_hpp */