diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /tags/cpp-stable-20060304/sca/runtime/axis_binding |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tags/cpp-stable-20060304/sca/runtime/axis_binding')
17 files changed, 788 insertions, 0 deletions
diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/Makefile.am b/tags/cpp-stable-20060304/sca/runtime/axis_binding/Makefile.am new file mode 100644 index 0000000000..f7eaa50485 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = handler wrapper diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/Makefile.am b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/Makefile.am new file mode 100644 index 0000000000..956b824d5c --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src + diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.cdtbuild b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.cdtbuild new file mode 100644 index 0000000000..55590cf0c8 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.cdtbuild @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?fileVersion 3.0.0?> + +<ManagedProjectBuildInfo> +<project id="tuscany_sca_axis_handler.cdt.managedbuild.target.gnu.so.124845918" name="Shared Library (Gnu)" projectType="cdt.managedbuild.target.gnu.so"> +<configuration artifactExtension="so" artifactName="tuscany_sca_axis_handler" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.config.gnu.so.debug.2106566379" name="Debug" parent="cdt.managedbuild.config.gnu.so.debug"> +<toolChain id="cdt.managedbuild.toolchain.gnu.so.debug.1396429365" name="GCC Tool Chain" superClass="cdt.managedbuild.toolchain.gnu.so.debug"> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.compiler.so.debug.2071328545" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.debug"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.1635475070" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug"> +<option id="gnu.cpp.compiler.option.preprocessor.def.1293358265" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> +<listOptionValue builtIn="false" value="_DEBUG"/> +</option> +<option id="gnu.cpp.compiler.option.include.paths.1368705467" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="${AXISCPP_DEPLOY}/include"/> +</option> +</tool> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.so.debug.381547341" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.debug"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.linker.so.debug.794316354" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.debug"/> +<tool command="as" id="cdt.managedbuild.tool.gnu.assembler.so.debug.68244965" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.debug"/> +<macros/> +</toolChain> +</configuration> +<configuration artifactExtension="so" artifactName="tuscany_sca_axis_handler" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.config.gnu.so.release.221779505" name="Release" parent="cdt.managedbuild.config.gnu.so.release"> +<toolChain id="cdt.managedbuild.toolchain.gnu.so.release.1798353066" name="GCC Tool Chain" superClass="cdt.managedbuild.toolchain.gnu.so.release"> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.compiler.so.release.361313298" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.release"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.so.release.1236253117" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.so.release"> +<option id="gnu.cpp.compiler.option.include.paths.1090562118" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="${AXISCPP_DEPLOY}/include"/> +</option> +</tool> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.so.release.1432689629" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.release"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.linker.so.release.681065405" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.release"/> +<tool command="as" id="cdt.managedbuild.tool.gnu.assembler.so.release.1255538075" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.release"/> +<macros/> +</toolChain> +</configuration> +<macros/> +</project> +</ManagedProjectBuildInfo> diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.cdtproject b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.cdtproject new file mode 100644 index 0000000000..48a12e6664 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.cdtproject @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.managedbuilder.core.managedMake">
+<extension id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager" point="org.eclipse.cdt.core.ScannerInfoProvider"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.domsourceindexer" point="org.eclipse.cdt.core.CIndexer"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"/>
+</item>
+</data>
+</cdtproject>
diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.project b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.project new file mode 100644 index 0000000000..a2718eca4f --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.project @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tuscany_sca_axis_handler</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + </natures> +</projectDescription> diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs new file mode 100644 index 0000000000..1023be0afa --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -0,0 +1,9 @@ +#Thu Feb 16 14:40:27 GMT 2006 +eclipse.preferences.version=1 +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.so.debug.2106566379=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="CPLUS_INCLUDE_PATH" operation\="remove"/>\n</environment>\n +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.so.release.221779505=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="CPLUS_INCLUDE_PATH" operation\="remove"/>\n</environment>\n +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.so.debug.2106566379=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.so.release.221779505=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n +environment/project=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n +environment/project/cdt.managedbuild.config.gnu.so.debug.2106566379=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n +environment/project/cdt.managedbuild.config.gnu.so.release.221779505=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/Makefile.am b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/Makefile.am new file mode 100644 index 0000000000..6054ec7b31 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/Makefile.am @@ -0,0 +1,9 @@ +lib_LTLIBRARIES = libtuscany_sca_axis_handler.la + +libtuscany_sca_axis_handler_la_SOURCES = SCAWSHandler.cpp + +libtuscany_sca_axis_handler_la_LIBADD = -lstdc++ + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I${AXISCPP_DEPLOY}/include + diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/SCAWSHandler.cpp b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/SCAWSHandler.cpp new file mode 100644 index 0000000000..ed57c0677e --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/SCAWSHandler.cpp @@ -0,0 +1,154 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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$ */ + +#include "SCAWSHandler.h" +#include <axis/Handler.hpp> +#include <string> + +AXIS_CPP_NAMESPACE_USE +using std::string; + +/** Construct an SCAWSHandler. + */ +SCAWSHandler::SCAWSHandler() +{ + return; +} + +/** Destruct an SCAWSHandler. + */ +SCAWSHandler::~SCAWSHandler() +{ +} + + +/** Perform any necessary initialization. + */ +int SCAWSHandler::init() +{ + return AXIS_SUCCESS; +} + +/** Perform any necessary finalization. + */ +int SCAWSHandler::fini() +{ + return AXIS_SUCCESS; +} + +/** Get the SCA specific properties that were set in the deployment + * descriptor (server.wsdd) and set them into the MessageData where + * they can be retrieved by the SCAWSWrapper to invoke the correct + * SCA Entry Point. + * @param pvIMsg - pointer to IMessageData + * + * @see SCAWSWrapper + */ +int SCAWSHandler::invoke(void *pvIMsg) +{ + IMessageData *pIMsg = (IMessageData*) pvIMsg; + + if(pIMsg->isPastPivot()) + { + // This is a response. + } + else + { + // This is a request + + // + // Get the SCA specific properties from the handler. + // + + // NOTE: WE CANNOT MAKE THE SIMPLE 'GETOPTION' CALLS BECAUSE THE + // STD::MAP CODE WILL CAUSE AN ACCESS VIOLATION IN AXISSERVER.DLL. + // THE GETOPTION METHOD IN HANDLER.HPP NEEDS TO BE MOVED INTO + // AXISSERVER.DLL AND BE EXPORTED. + //const string& strTargetNamespace = getOption("targetNamespace"); + //const string& strSCAEntryPoint = getOption("scaEntryPoint"); + + // HACK + // BECAUSE WE CANNOT MAKE ANY MAP CALLS THAT REQUIRE PARAMETERS AND + // CANNOT SEEM TO ITERATE OVER THE MAP IN A FOR LOOP EITHER WITHOUT + // TRAPPING, WE RESORT TO READING THE FIRST AND LAST PROPERTIES. + // THIS IS ACCEPTABLE AS A WORKAROUND FOR NOW BECAUSE WE ONLY + // HAVE TWO PROPERTIES. + string strName; + string strValue; + // Read the first property in the map and set its name and value + // into the IMessageData. + map<string, string>::const_iterator it = m_pOption->begin(); + strName = (*it).first; + strValue = (*it).second; + pIMsg->setProperty(strName.c_str(), strValue.c_str()); + // Read the last property in the map and set its name and value + // into the IMessageData. + map<string, string>::const_reverse_iterator itr = m_pOption->rbegin(); + strName = (*itr).first; + strValue = (*itr).second; + pIMsg->setProperty(strName.c_str(), strValue.c_str()); + // END HACK + } + + return AXIS_SUCCESS; +} + +/** Handle Faults. + */ +void SCAWSHandler::onFault(void *pvIMsg) +{ + +} + +// +// These functions are exported from the SCAWSHandler DLL and are called by the Axis Engine +// to create/destroy instances of the SCAWSHandler class. +// +extern "C" +{ +STORAGE_CLASS_INFO +int GetClassInstance(BasicHandler **inst) +{ + *inst = new BasicHandler(); + + SCAWSHandler* pSCAWSHandler = new SCAWSHandler(); + (*inst)->_functions = 0; + if (pSCAWSHandler) + { + (*inst)->_object = pSCAWSHandler; + return pSCAWSHandler->init(); + } + + return AXIS_FAIL; +} + +STORAGE_CLASS_INFO +int DestroyInstance(BasicHandler *inst) +{ + if (inst) + { + Handler* pH = static_cast<Handler*>(inst->_object); + pH->fini(); + delete pH; + delete inst; + return AXIS_SUCCESS; + } + return AXIS_FAIL; +} +} // extern "C" diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/SCAWSHandler.h b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/SCAWSHandler.h new file mode 100644 index 0000000000..3f0c576921 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/handler/src/SCAWSHandler.h @@ -0,0 +1,79 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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: 2005/12/22 11:33:21 $ */ + +#if !defined(SCAWSHANDLER_H_INCLUDED) +#define SCAWSHANDLER_H_INCLUDED + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include <axis/Handler.hpp> + +/** The SCAWSHandler class is an Axis Handler that retrieves properties set + * in the deployment descriptor (server.wsdd) and sets them into the + * MessageData for use by the SCAWSWrapper which invokes SCA Entry Points. + * + * @see SCAWSWrapper + */ +AXIS_CPP_NAMESPACE_USE + +class SCAWSHandler : public Handler +{ + public: + /** Construct an SCAWSHandler. + */ + SCAWSHandler(void); + + /** Destruct an SCAWSHandler. + */ + virtual ~SCAWSHandler(void); + + // Axis WrapperClassHandler interface. + + /** Perform an necessary initialization. + */ + int AXISCALL init(); + + /** Perform any necessary finalization. + */ + int AXISCALL fini(); + + /** Get the SCA specific properties that were set in the deployment + * descriptor (server.wsdd) and set them into the MessageData where + * they can be retrieved by the SCAWSWrapper to invoke the correct + * SCA Entry Point. + * @param pvIMsg - pointer to IMessageData + * + * @see SCAWSWrapper + */ + int AXISCALL invoke(void* pvIMsg); + + /** Handle Faults. + */ + void AXISCALL onFault(void* pvIMsg); + + private: + +}; + + +#endif // !defined(SCAWSHANDLER_H_INCLUDED) + + diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/Makefile.am b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/Makefile.am new file mode 100644 index 0000000000..af437a64d6 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.cdtbuild b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.cdtbuild new file mode 100644 index 0000000000..cad284f534 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.cdtbuild @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?fileVersion 3.0.0?> + +<ManagedProjectBuildInfo> +<project id="tuscany_sca_axis_wrapper.cdt.managedbuild.target.gnu.so.1184841924" name="Shared Library (Gnu)" projectType="cdt.managedbuild.target.gnu.so"> +<configuration artifactExtension="so" artifactName="tuscany_sca_axis_wrapper" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.config.gnu.so.debug.928824798" name="Debug" parent="cdt.managedbuild.config.gnu.so.debug"> +<toolChain id="cdt.managedbuild.toolchain.gnu.so.debug.1339758042" name="GCC Tool Chain" superClass="cdt.managedbuild.toolchain.gnu.so.debug"> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.compiler.so.debug.1154109611" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.debug"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.1608382279" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug"> +<option id="gnu.cpp.compiler.option.preprocessor.def.1011501225" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> +<listOptionValue builtIn="false" value="_DEBUG"/> +</option> +<option id="gnu.cpp.compiler.option.include.paths.1415031933" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="${project_loc}/../../../core/src"/> +<listOptionValue builtIn="false" value="${TUSCANY_SDOCPP}/include"/> +<listOptionValue builtIn="false" value="${AXISCPP_DEPLOY}/include"/> +</option> +</tool> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.so.debug.1838165705" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.debug"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.linker.so.debug.967811729" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.debug"/> +<tool command="as" id="cdt.managedbuild.tool.gnu.assembler.so.debug.182811061" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.debug"/> +<macros/> +</toolChain> +</configuration> +<configuration artifactExtension="so" artifactName="tuscany_sca_axis_wrapper" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.config.gnu.so.release.417732635" name="Release" parent="cdt.managedbuild.config.gnu.so.release"> +<toolChain id="cdt.managedbuild.toolchain.gnu.so.release.2030957057" name="GCC Tool Chain" superClass="cdt.managedbuild.toolchain.gnu.so.release"> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.compiler.so.release.1306716781" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.release"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.so.release.1788615220" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.so.release"> +<option id="gnu.cpp.compiler.option.include.paths.425019187" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="${project_loc}/../../../core/src"/> +<listOptionValue builtIn="false" value="${TUSCANY_SDOCPP}/include"/> +<listOptionValue builtIn="false" value="${AXISCPP_DEPLOY}/include"/> +</option> +</tool> +<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.so.release.1895133278" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.release"/> +<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.linker.so.release.279322021" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.release"/> +<tool command="as" id="cdt.managedbuild.tool.gnu.assembler.so.release.774676807" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.release"/> +<macros/> +</toolChain> +</configuration> +<macros/> +</project> +</ManagedProjectBuildInfo> diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.cdtproject b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.cdtproject new file mode 100644 index 0000000000..48a12e6664 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.cdtproject @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.managedbuilder.core.managedMake">
+<extension id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager" point="org.eclipse.cdt.core.ScannerInfoProvider"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.domsourceindexer" point="org.eclipse.cdt.core.CIndexer"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"/>
+</item>
+</data>
+</cdtproject>
diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.project b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.project new file mode 100644 index 0000000000..526e05b5c0 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.project @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tuscany_sca_axis_wrapper</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + </natures> +</projectDescription> diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs new file mode 100644 index 0000000000..263f7d68d6 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -0,0 +1,9 @@ +#Thu Feb 16 14:46:12 GMT 2006 +eclipse.preferences.version=1 +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.so.debug.928824798=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="CPLUS_INCLUDE_PATH" operation\="remove"/>\n</environment>\n +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.so.release.417732635=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="CPLUS_INCLUDE_PATH" operation\="remove"/>\n</environment>\n +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.so.debug.928824798=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.so.release.417732635=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n +environment/project=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n +environment/project/cdt.managedbuild.config.gnu.so.debug.928824798=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable delimiter\="" name\="TUSCANY_SDOCPP" operation\="replace" value\="/home/tuscany/workspace/sdo"/>\n</environment>\n +environment/project/cdt.managedbuild.config.gnu.so.release.417732635=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable delimiter\="" name\="TUSCANY_SDOCPP" operation\="replace" value\="/home/tuscany/workspace/sdo"/>\n</environment>\n diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/Makefile.am b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/Makefile.am new file mode 100644 index 0000000000..f3dda31d1c --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/Makefile.am @@ -0,0 +1,10 @@ +lib_LTLIBRARIES = libtuscany_sca_axis_wrapper.la + +libtuscany_sca_axis_wrapper_la_SOURCES = SCAWSWrapper.cpp + +libtuscany_sca_axis_wrapper_la_LIBADD = -lstdc++ -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include \ + -I${AXISCPP_DEPLOY}/include + diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/SCAWSWrapper.cpp b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/SCAWSWrapper.cpp new file mode 100644 index 0000000000..1ae9739117 --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/SCAWSWrapper.cpp @@ -0,0 +1,254 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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: 2005/12/22 11:33:21 $ */ + +#include "SCAWSWrapper.h" + +#include "commonj/sdo/SDO.h" +#include "tuscany/sca/util/Exceptions.h" +#include "tuscany/sca/core/SCAEntryPoint.h" + + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca; +AXIS_CPP_NAMESPACE_USE; + +/** Construct an SCAWSWrapper. + */ +SCAWSWrapper::SCAWSWrapper() +{ +} + +/** Destruct an SCAWSWrapper. + */ +SCAWSWrapper::~SCAWSWrapper() +{ +} + + +// +// Implementation of WrapperClassHandler interface +// + +/** Perform any necessary initialization. + */ +int SCAWSWrapper::init() +{ + return AXIS_SUCCESS; +} + +/** Perform an necessary finalization. + */ +int SCAWSWrapper::fini() +{ + return AXIS_SUCCESS; +} + +/** Invoke a web service operation. The invoke method expects SCA specific + * properties to have been set into the MessageData by the SCAWSHandler. + * Using those properties, the wrapper will invoke the correct SCA Entry + * Point. + * @param pMsg - pointer to IMessageData. + * + * @see SCAWSHandler + */ +int SCAWSWrapper::invoke(void *pMsg) +{ + + IMessageData *pIMsg = (IMessageData*)pMsg; + const AxisChar *operationName = pIMsg->getOperationName(); + + int axisReturn = invokeService(pIMsg, operationName); + return axisReturn; +} + +/** Handle Faults. + */ +void SCAWSWrapper::onFault(void *pMsg) +{ +} + + +// Invoke an operation on an SCA Entry Point. +int SCAWSWrapper::invokeService(IMessageData *pIMsg, + const AxisChar *operationName) +{ + int axisReturn = AXIS_SUCCESS; + + // Get the SoapSerializer. + IWrapperSoapSerializer* pIWSSZ; + pIMsg->getSoapSerializer(&pIWSSZ); + if (!pIWSSZ) + { + return AXIS_FAIL; + } + + // Get the SoapDeSerializer. + IWrapperSoapDeSerializer* pIWSDZ; + pIMsg->getSoapDeSerializer(&pIWSDZ); + if (!pIWSDZ) + { + return AXIS_FAIL; + } + + // Target Namespace was set into the MessageData by the SCAWSHandler. + const AxisChar *targetNamespace = (const AxisChar *)pIMsg->getProperty("targetNamespace"); + + // Make sure we have the correct message. + if (AXIS_SUCCESS != pIWSDZ->checkMessageBody(operationName, targetNamespace)) + { + return AXIS_FAIL; + } + + try + { + // + // Create the SCA EntryPoint + // + const AxisChar *scaEntryPointName = (const AxisChar *)pIMsg->getProperty("scaEntryPoint"); + SCAEntryPoint entrypoint(scaEntryPointName); + + // Get the DataFactory which has Types loaded from WSDLs + DataFactoryPtr dataFactory = entrypoint.getDataFactory(); + + // + // Get the Soap body and create an SDO request object from it. + // + AnyType *soapAny = pIWSDZ->getAnyObject(); + + // The Doc Literal soap message does not include the root element (operation name) when + // we use getAnyObject. Axis calls this element the 'soap method' but there is no + // 'getSoapMethod' method on the deserializer - we need to wrap the soap body with an + // element named for the operation name. + + string soapBody("<"); + soapBody.append(operationName); + soapBody.append(" "); + soapBody.append("xmlns"); + soapBody.append("=\""); + soapBody.append(targetNamespace); + soapBody.append("\">"); + for (int i=0; i < soapAny->_size ; i++) + { + // The soap body is stored in the _array member of AnyType. + soapBody.append(soapAny->_array[i]); + } + soapBody.append("</"); + soapBody.append(operationName); + soapBody.append(">"); + + // + // Create the SDO request object from the soap body. + // + XMLHelperPtr xmlHelper = HelperProvider::getXMLHelper(dataFactory); + XMLDocumentPtr xmlDoc = xmlHelper->load(soapBody.c_str(), targetNamespace); + DataObjectPtr requestSDO = xmlDoc->getRootDataObject(); + + // + // Invoke the operation on the SCA EntryPoint. + // + DataObjectPtr responseSDO = entrypoint.invoke(operationName, requestSDO); + + // + // Serialize the responseSDO into a SOAP response. + // + // Get the name of the response SDO. The entry point was invoked using an + // SDOStub and the stub makes sure that the response includes the root + // element (operation response name). + + const Type &responseType = responseSDO->getType(); + const char *operationResponseName = responseType.getName(); + + // Get the first child of the root element - this is the soap body + // to return in the response. The body will be wrapped with the root + // element (operation response name) when we call the Axis method + // 'createSoapmMethod'. + DataObjectPtr soapBodySDO = responseSDO->getDataObject((unsigned int)0); + const Type& soapBodyType = soapBodySDO->getType(); + const char *soapBodyName = soapBodyType.getName(); + // Convert the soap body DataObject into XML. + XMLDocumentPtr responseDoc = xmlHelper->createDocument(soapBodySDO, + targetNamespace, + soapBodyName); + responseDoc->setXMLDeclaration(false); + char *responseXML = xmlHelper->save(responseDoc); + + // + // Serialize the response + // + // Wrap the soap body with the root element (operation response name). + pIWSSZ->createSoapMethod(operationResponseName, targetNamespace); + // Add the XML response document (soap body) as an AnyType. + AnyType *soapAnyResponse = new AnyType(); + soapAnyResponse->_size = 1; + soapAnyResponse->_array = new char*[1]; + soapAnyResponse->_array[0] = strdup(responseXML); + + pIWSSZ->addOutputAnyObject(soapAnyResponse); + + } + catch(ServiceRuntimeException e) + { + axisReturn = AXIS_FAIL; + } + catch(SDORuntimeException e) + { + axisReturn = AXIS_FAIL; + } + + + return axisReturn; +} + +// +// These functions are exported from the SCAWSWrapper DLL and are called by the Axis Engine +// to create/destroy instances of the service wrapper class. +// +extern "C" +{ +STORAGE_CLASS_INFO +int GetClassInstance(BasicHandler **inst) +{ + *inst = new BasicHandler(); + WrapperClassHandler* pWCH = new SCAWSWrapper(); + (*inst)->_functions = 0; + if (pWCH) + { + (*inst)->_object = pWCH; + return pWCH->init(); + } + return AXIS_FAIL; +} +STORAGE_CLASS_INFO +int DestroyInstance(BasicHandler *inst) +{ + if (inst) + { + WrapperClassHandler* pWCH = reinterpret_cast<WrapperClassHandler*>(inst); + pWCH->fini(); + delete pWCH; + delete inst; + return AXIS_SUCCESS; + } + return AXIS_FAIL; +} +} // extern "C" + + + diff --git a/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/SCAWSWrapper.h b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/SCAWSWrapper.h new file mode 100644 index 0000000000..474c39977f --- /dev/null +++ b/tags/cpp-stable-20060304/sca/runtime/axis_binding/wrapper/src/SCAWSWrapper.h @@ -0,0 +1,110 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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: 2005/12/22 11:33:21 $ */ + +#if !defined(SCAWSWRAPPER_H_INCLUDED) +#define SCAWSWRAPPER_H_INCLUDED + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "osoa/sca/export.h" +#include <axis/server/WrapperClassHandler.hpp> +#include <axis/IMessageData.hpp> +#include <axis/GDefine.hpp> +#include <axis/AxisWrapperAPI.hpp> +#include <axis/AxisUserAPI.hpp> + + +AXIS_CPP_NAMESPACE_USE + +/** The SCAWSWrapper class is an Axis WrapperClassHandler that acts as a generic service wrapper for + * invoking services using the SCARuntime. Any services defined in the deployment descriptor (server.wsdd) + * with <parameter name="className" value="<path>\SCAWSWrapper.dll"/> will be invoked by the SCAWSWrapper. + * The service must also be configured with a handler (SCAWSHandler) that sets SCA specific properties + * from the deployment descriptor into the MessageData that is passed to the wrapper's invoke method. + * The SCAWSWrapper uses the properties to configure an SCA Entry Point and invoke the requested operation + * on the service. + * + * Example: + * + * <service name="ExampleService" provider="CPP:DOCUMENT" description="Example Service"> + * <requestFlow> + * <handler name="SCAWSHandler" type="C:\Apache2.0.54\Apache2\Axis\handlers\SCAWSHandler.dll"> + * <parameter name="targetNamespace" value="http://com.exampleservice"/> + * <parameter name="scaEntryPoint" value="SubSystem1/ExampleService/ExampleService"/> + * </handler> + * </requestFlow> + * + * <parameter name="className" value="C:\Apache2.0.54\Apache2\Axis\webservices\SCAWSWrapper.dll"/> + * <parameter name="allowedMethods" value="ExampleMethod "/> + * </service> + * + * @see SCAWSHandler + */ +class SCAWSWrapper : public WrapperClassHandler +{ + public: + + /** Construct an SCAWSWrapper. + */ + SCAWSWrapper(); + + /** Destruct an SCAWSWrapper. + */ + virtual ~SCAWSWrapper(); + + // + // Axis WrapperClassHandler interface. + // + + /** Perform any necessary initialization. + */ + int AXISCALL init(); + + /** Perform any necessary finalization. + */ + int AXISCALL fini(); + + /** Invoke a web service operation. The invoke method expects SCA specific + * properties to have been set into the MessageData by the SCAWSHandler. + * Using those properties, the wrapper will invoke the correct SCA Entry + * Point. + * @param pMsg - pointer to IMessageData. + * + * @see SCAWSHandler + */ + int AXISCALL invoke(void* pMsg); + + /** Handle Faults. + */ + void AXISCALL onFault(void* pMsg); + + /** Binding Style: Document Literal. + */ + AXIS_BINDING_STYLE AXISCALL getBindingStyle() { return DOC_LITERAL; }; + + private: + + // Invoke an SCA Entry Point and return an SDO object as a result. + int invokeService(IMessageData *pIMsg, + const AxisChar *operationName); +}; + +#endif // !defined(SCAWSWRAPPER_H_INCLUDED) |