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
This commit is contained in:
parent
81678737cc
commit
030239cff2
6 changed files with 269 additions and 0 deletions
sca-cpp/trunk/components/webservice
38
sca-cpp/trunk/components/webservice/Makefile.am
Normal file
38
sca-cpp/trunk/components/webservice/Makefile.am
Normal file
|
@ -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
|
55
sca-cpp/trunk/components/webservice/client-test.cpp
Normal file
55
sca-cpp/trunk/components/webservice/client-test.cpp
Normal file
|
@ -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;
|
||||
}
|
51
sca-cpp/trunk/components/webservice/webservice-test.cpp
Normal file
51
sca-cpp/trunk/components/webservice/webservice-test.cpp
Normal file
|
@ -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;
|
||||
}
|
32
sca-cpp/trunk/components/webservice/webservice.composite
Normal file
32
sca-cpp/trunk/components/webservice/webservice.composite
Normal file
|
@ -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>
|
52
sca-cpp/trunk/components/webservice/webservice.cpp
Normal file
52
sca-cpp/trunk/components/webservice/webservice.cpp
Normal file
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
41
sca-cpp/trunk/components/webservice/webservice.hpp
Normal file
41
sca-cpp/trunk/components/webservice/webservice.hpp
Normal file
|
@ -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 */
|
Loading…
Add table
Reference in a new issue