You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2010/01/11 09:29:45 UTC
svn commit: r897790 - in /tuscany/sca-cpp/trunk/components/webservice: ./
Makefile.am client-test.cpp webservice-test.cpp webservice.composite
webservice.cpp webservice.hpp
Author: jsdelfino
Date: Mon Jan 11 08:29:45 2010
New Revision: 897790
URL: http://svn.apache.org/viewvc?rev=897790&view=rev
Log:
Created component structure and build files for Web service component using Axis2/C.
Added:
tuscany/sca-cpp/trunk/components/webservice/
tuscany/sca-cpp/trunk/components/webservice/Makefile.am
tuscany/sca-cpp/trunk/components/webservice/client-test.cpp
tuscany/sca-cpp/trunk/components/webservice/webservice-test.cpp
tuscany/sca-cpp/trunk/components/webservice/webservice.composite
tuscany/sca-cpp/trunk/components/webservice/webservice.cpp
tuscany/sca-cpp/trunk/components/webservice/webservice.hpp
Added: tuscany/sca-cpp/trunk/components/webservice/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/Makefile.am?rev=897790&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/Makefile.am (added)
+++ tuscany/sca-cpp/trunk/components/webservice/Makefile.am Mon Jan 11 08:29:45 2010
@@ -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
Added: tuscany/sca-cpp/trunk/components/webservice/client-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/client-test.cpp?rev=897790&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/client-test.cpp (added)
+++ tuscany/sca-cpp/trunk/components/webservice/client-test.cpp Mon Jan 11 08:29:45 2010
@@ -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;
+}
Added: tuscany/sca-cpp/trunk/components/webservice/webservice-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/webservice-test.cpp?rev=897790&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/webservice-test.cpp (added)
+++ tuscany/sca-cpp/trunk/components/webservice/webservice-test.cpp Mon Jan 11 08:29:45 2010
@@ -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;
+}
Added: tuscany/sca-cpp/trunk/components/webservice/webservice.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/webservice.composite?rev=897790&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/webservice.composite (added)
+++ tuscany/sca-cpp/trunk/components/webservice/webservice.composite Mon Jan 11 08:29:45 2010
@@ -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>
Added: tuscany/sca-cpp/trunk/components/webservice/webservice.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/webservice.cpp?rev=897790&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/webservice.cpp (added)
+++ tuscany/sca-cpp/trunk/components/webservice/webservice.cpp Mon Jan 11 08:29:45 2010
@@ -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));
+}
+
+}
Added: tuscany/sca-cpp/trunk/components/webservice/webservice.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/webservice.hpp?rev=897790&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/webservice.hpp (added)
+++ tuscany/sca-cpp/trunk/components/webservice/webservice.hpp Mon Jan 11 08:29:45 2010
@@ -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 */