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 2006/08/09 11:28:16 UTC
svn commit: r430012 [2/4] - in /incubator/tuscany/cpp/sca: runtime/core/src/
runtime/core/src/osoa/sca/ runtime/core/src/tuscany/sca/core/
runtime/core/src/tuscany/sca/model/ runtime/core/src/tuscany/sca/util/
runtime/core/src/tuscany/sca/ws/ runtime/w...
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp Wed Aug 9 02:28:11 2006
@@ -67,15 +67,15 @@
LOGENTRY(1, "ModelLoader::load");
LOGINFO_1(2,"configuration root: %s", configurationRoot.c_str());
- // The configuration root path will point to a directory structure:
- // root/
- // The sca.subsystem files can be located anywhere under this directory
- // structure.
- loadSubsystems(configurationRoot);
-
- // sca.composite files represent the root of a composite, and can occur anywhere
- // under the directory structure
- loadComposites(configurationRoot);
+ // The configuration root path will point to a directory structure.
+
+ // The composite files representing subsystems can be located anywhere under
+ // the subsystems directory.
+ loadSubsystems(configurationRoot+"/subsystems");
+
+ // composite files representing composite implementations can occur anywhere
+ // under the composites directory
+ loadComposites(configurationRoot+"/composites");
system->resolveWires();
LOGEXIT(1, "ModelLoader::load");
@@ -88,9 +88,9 @@
// ========================================================================
void ModelLoader::loadSubsystems(const string& configurationRoot)
{
- // Get all the sca.subsystem files in the composite
+ // Get all the composite files in the configuration directory
LOGENTRY(1, "ModelLoader::loadSubsystems");
- Files files(configurationRoot, "sca.subsystem", true);
+ Files files(configurationRoot, "*.composite", true);
for (unsigned int i=0; i < files.size(); i++)
{
loadSubsystemFile(files[i]);
@@ -142,20 +142,38 @@
Subsystem* subsystem;
subsystem = system->addSubsystem(root->getCString("name"));
- DataObjectList& Composites = root->getList("compositeComponent");
- LOGINFO_1(2, "ModelLoader::mapSubsystem: number of composite components: %d", Composites.size());
+ DataObjectList& componentDOs = root->getList("component");
+ LOGINFO_1(2, "ModelLoader::mapSubsystem: number of composite components: %d", componentDOs.size());
- // Iterate over composite components
- for (int i=0; i<Composites.size(); i++)
+ // Iterate over components
+ for (int i=0; i<componentDOs.size(); i++)
{
- // Add each composite component to the subsystem
- Composite* Composite;
- Composite = subsystem->addCompositeComponent(Composites[i]->getCString("name"), Composites[i]->getCString("composite"));
+ // Get the composite component implementation
+ DataObjectPtr impl = componentDOs[i]->getDataObject("implementation");
+ if (!impl)
+ {
+ string message = "No implementation for component: ";
+ message = message + componentDOs[i]->getCString("name");
+ throw SystemConfigurationException(message.c_str());
+ }
+
+ // Determine the implementation type
+ string implType = impl->getType().getName();
+ if (implType == "SCAImplementation")
+ {
+ // Add each composite component to the subsystem
+ Composite* composite;
+ composite = subsystem->addCompositeComponent(componentDOs[i]->getCString("name"), impl->getCString("name"));
+ }
+ else
+ {
+ string message = "Atomic component implementation not yet supported in a subsystem: ";
+ message = message + componentDOs[i]->getCString("name");
+ throw SystemConfigurationException(message.c_str());
+ }
}
-
- /// @todo Add external services and entry points
-
+ //TODO Add composite services and references
LOGEXIT(1, "ModelLoader::mapSubsystem");
}
@@ -168,12 +186,21 @@
// =====================================================================
void ModelLoader::loadComposites(const string& configurationRoot)
{
- // Get all the sca.composite files in the composite
+ // Get all the main composite files (named like the directory that contains them)
LOGENTRY(1, "ModelLoader::loadComposites");
- Files files(configurationRoot, "sca.composite", true);
+ Files files(configurationRoot, "*.composite", true);
for (unsigned int i=0; i < files.size(); i++)
{
- loadCompositeFile(files[i]);
+ string directoryName = files[i].getDirectory();
+ string fileName = files[i].getFileName();
+ int fl = fileName.length()-10;
+ string compositeName = "/" + fileName.substr(0, fl);
+ fl++;
+ int dl = directoryName.length();
+ if (dl>fl && directoryName.substr(dl-fl, fl) == compositeName)
+ {
+ loadCompositeFile(files[i]);
+ }
}
LOGEXIT(1, "ModelLoader::loadComposites");
}
@@ -192,12 +219,12 @@
try
{
- string filename = file.getDirectory() + "/" + file.getFileName();
+ string mainFileName = file.getDirectory() + "/" + file.getFileName();
- XMLDocumentPtr compositeFile = getXMLHelper()->loadFile(filename.c_str());
+ XMLDocumentPtr compositeFile = getXMLHelper()->loadFile(mainFileName.c_str());
if (compositeFile->getRootDataObject() == 0)
{
- LOGERROR_1(0, "ModelLoader::loadCompositeFile: Unable to load file: %s", filename.c_str());
+ LOGERROR_1(0, "ModelLoader::loadCompositeFile: Unable to load file: %s", mainFileName.c_str());
}
else
{
@@ -205,12 +232,17 @@
mapComposite(compositeName, compositeFile->getRootDataObject(), file.getDirectory());
// --------------------------------------------------------------
- // Load any composite Fragments in the same folder as the sca.composite
+ // Load any other composites in the same folder as the main composite
// --------------------------------------------------------------
- Files files(file.getDirectory(), "*.fragment", false);
+ Files files(file.getDirectory(), "*.composite", false);
for (unsigned int i=0; i < files.size(); i++)
{
- filename = file.getDirectory() + "/" + files[i].getFileName();
+ string filename = file.getDirectory() + "/" + files[i].getFileName();
+
+ // Skip the main composite file
+ if (filename == mainFileName)
+ continue;
+
compositeFile = getXMLHelper()->loadFile(filename.c_str());
if (compositeFile->getRootDataObject() == 0)
{
@@ -271,20 +303,20 @@
// ------------
// Entry points
// ------------
- DataObjectList& entryPointList = root->getList("entryPoint");
- for (i=0; i < entryPointList.size(); i++)
+ DataObjectList& compositeServiceList = root->getList("service");
+ for (i=0; i < compositeServiceList.size(); i++)
{
- addEntryPoint(*compositeIter, entryPointList[i]);
+ addCompositeServiceType(*compositeIter, compositeServiceList[i]);
}
// -----------------
// External services
// -----------------
- DataObjectList& externalServiceList = root->getList("externalService");
- for (i=0; i < externalServiceList.size(); i++)
+ DataObjectList& compositeReferenceTypeList = root->getList("reference");
+ for (i=0; i < compositeReferenceTypeList.size(); i++)
{
- addExternalService(*compositeIter, externalServiceList[i]);
+ addCompositeReferenceType(*compositeIter, compositeReferenceTypeList[i]);
}
// -----
@@ -293,8 +325,8 @@
DataObjectList& wireList = root->getList("wire");
for (int l=0; l < wireList.size(); l++)
{
- string source = wireList[l]->getCString("sourceUri");
- string target = wireList[l]->getCString("targetUri");
+ string source = wireList[l]->getCString("source");
+ string target = wireList[l]->getCString("target");
(*compositeIter)->addWire(source, target);
}
@@ -322,16 +354,17 @@
message = message + componentDO->getCString("name");
throw SystemConfigurationException(message.c_str());
}
+
// Determine the type
string componentTypeName;
string componentTypePath;
string implType = impl->getType().getName();
if (implType == "CPPImplementation")
{
- string dll = impl->getCString("dll");
+ string library = impl->getCString("library");
string header = impl->getCString("header");
string className = impl->getCString("class");
- CPPImplementation* cppImpl = new CPPImplementation(dll, header, className);
+ CPPImplementation* cppImpl = new CPPImplementation(library, header, className);
componentTypePath = cppImpl->getHeaderPath();
componentTypeName = cppImpl->getHeaderStub();
component->setImplementation(cppImpl);
@@ -365,44 +398,40 @@
LOGERROR_1(0, "ModelLoader::mapComposite: Exception caught: %s", ex.getMessageText());
throw SystemConfigurationException(ex.getMessageText());
}
+
// ----------
// Properties
// ----------
- DataObjectPtr props = componentDO->getDataObject("properties");
- component->addProperties(props);
+
+ //TODO handle new property declaration style
+ //DataObjectPtr props = componentDO->getDataObject("properties");
+ //component->addProperties(props);
// ----------
// References
// ----------
- DataObjectPtr refs = componentDO->getDataObject("references");
- if (refs)
+ DataObjectList& refs = componentDO->getList("reference");
+ for (int i=0; i<refs.size(); i++)
{
- PropertyList pl = refs->getInstanceProperties();
- for (int refI=0; refI < pl.size(); refI++)
+ // ----------------------------------------------------------
+ // Add the reference to the composite wires to be resolved later
+ // ----------------------------------------------------------
+ string refName = refs[i]->getCString("name");
+ if (!component->findReference(refName))
{
- // ----------------------------------------------------------
- // Add the reference to the composite wires to be resolved later
- // ----------------------------------------------------------
- string refName = pl[refI].getName();
- if (!component->findReference(pl[refI].getName()))
- {
- // Configuration error: reference is not defined
- message = "Undefined reference: " + refName;
- throw SystemConfigurationException(message.c_str());
- }
-
- string src = component->getName() + "/" + refName;
-
- // The reflist below is a list of open data objects
- DataObjectList& reflist = refs->getList(pl[refI]);
- for (int refslistI=0; refslistI<reflist.size(); refslistI++)
- {
- // Get the reference value
- string refValue = reflist.getDataObject(refslistI)->getSequence()->getCStringValue(0);
- composite->addWire(src, refValue);
- }
+ // Configuration error: reference is not defined
+ message = "Undefined reference: " + refName;
+ throw SystemConfigurationException(message.c_str());
}
+
+ string src = component->getName() + "/" + refName;
+
+ // Get the reference value
+ //Utils::printDO(refs[i], 0);
+ string refValue = refs[i]->getCString("value");
+
+ composite->addWire(src, refValue);
}
}
@@ -470,7 +499,10 @@
}
else
{
- // Error?
+ //TODO add support for other interface types
+ //string message = "Interface type not yet supported: ";
+ //message = message + ifType;
+ //throw SystemConfigurationException(message.c_str());
return 0;
}
}
@@ -491,59 +523,54 @@
many = props[i]->getBoolean("many");
}
- bool required=false;
- if (props[i]->isSet("required"))
- {
- many = props[i]->getBoolean("required");
- }
-
const char* defaultValue = 0;
if (props[i]->isSet("default"))
{
defaultValue = props[i]->getCString("default");
}
- component->addProperty(name, type, many, required, defaultValue);
+ component->addProperty(name, type, many, defaultValue);
}
}
// ===============================================
- // addEntryPoint: add an EntryPoint to the composite
+ // addCompositeServiceType: add an CompositeServiceType to the composite
// ===============================================
- void ModelLoader::addEntryPoint(Composite* composite, DataObjectPtr entryPointDO)
+ void ModelLoader::addCompositeServiceType(Composite* composite, DataObjectPtr compositeServiceDO)
{
string message;
- //Utils::printDO(entryPointDO);
- EntryPoint* entryPoint = composite->addEntryPoint(entryPointDO->getCString("name"));
+ //Utils::printDO(compositeServiceDO);
+ CompositeServiceType* compositeServiceType = composite->addCompositeServiceType(compositeServiceDO->getCString("name"));
string multiplicity = "1..1";
- if (entryPointDO->isSet("multiplicity"))
+ if (compositeServiceDO->isSet("multiplicity"))
{
- multiplicity = entryPointDO->getCString("multiplicity");
+ multiplicity = compositeServiceDO->getCString("multiplicity");
}
- entryPoint->setMultiplicity(multiplicity);
- entryPoint->setInterface(getInterface(entryPointDO));
+ compositeServiceType->setMultiplicity(multiplicity);
+ compositeServiceType->setInterface(getInterface(compositeServiceDO));
- DataObjectList& refs = entryPointDO->getList("reference");
+ DataObjectList& refs = compositeServiceDO->getList("reference");
for (int i=0; i<refs.size(); i++)
{
// ----------------------------------------------------------
// Add the reference to the composite wires to be resolved later
// ----------------------------------------------------------
string targ = refs.getCString(i);
- composite->addWire(entryPoint->getName(), targ);
+ composite->addWire(compositeServiceType->getName(), targ);
}
// Get binding, it will be the first and only binding
- DataObjectPtr binding = entryPointDO->getList("binding")[0];
- if (!binding)
+ DataObjectList& bindings = compositeServiceDO->getList("binding");
+ if (bindings.size()==0)
{
- message = "No binding for entryPoint: ";
- message = message + entryPointDO->getCString("name");
+ message = "No binding for compositeService: ";
+ message = message + compositeServiceDO->getCString("name");
throw SystemConfigurationException(message.c_str());
}
+ DataObjectPtr binding = bindings[0];
// Utils::printDO(binding);
@@ -557,37 +584,39 @@
WSBinding* wsBinding = new WSBinding(uri,port);
- entryPoint->setBinding(wsBinding);
+ compositeServiceType->setBinding(wsBinding);
}
else if (bindingType == "SCABinding")
{
- message = "SCA binding not yet implemented. Binding is for entryPoint: ";
- message = message + entryPointDO->getCString("name");
+ message = "SCA binding not yet implemented. Binding is for compositeService: ";
+ message = message + compositeServiceDO->getCString("name");
throw SystemConfigurationException(message.c_str());
}
}
// =========================================================
- // addExternalService: add an ExternalService to the composite
+ // addCompositeReferenceType: add an CompositeReferenceType to the composite
// =========================================================
- void ModelLoader::addExternalService(Composite* composite, DataObjectPtr externalServiceDO)
+ void ModelLoader::addCompositeReferenceType(Composite* composite, DataObjectPtr compositeReferenceTypeDO)
{
string message;
- ExternalService* externalService = composite->addExternalService(externalServiceDO->getCString("name"));
+ CompositeReferenceType* compositeReferenceType = composite->addCompositeReferenceType(compositeReferenceTypeDO->getCString("name"));
+
// Add the interface
- externalService->setInterface(getInterface(externalServiceDO));
+ compositeReferenceType->setInterface(getInterface(compositeReferenceTypeDO));
// Get binding, it will be the first and only binding
- DataObjectPtr binding = externalServiceDO->getList("binding")[0];
- if (!binding)
+ DataObjectList& bindings = compositeReferenceTypeDO->getList("binding");
+ if (bindings.size()==0)
{
- message = "No binding for externalService: ";
- message = message + externalServiceDO->getCString("name");
+ message = "No binding for compositeReferenceType: ";
+ message = message + compositeReferenceTypeDO->getCString("name");
throw SystemConfigurationException(message.c_str());
}
+ DataObjectPtr binding = bindings[0];
//Utils::printDO(binding);
@@ -601,7 +630,7 @@
WSBinding* wsBinding = new WSBinding(uri,port);
- externalService->setBinding(wsBinding);
+ compositeReferenceType->setBinding(wsBinding);
}
else if (bindingType == "SCABinding")
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h Wed Aug 9 02:28:11 2006
@@ -79,8 +79,8 @@
void mapComposite(const string& compositeName, commonj::sdo::DataObjectPtr rootDO, std::string compositeRootDir);
void addComponent(Composite* composite, DataObjectPtr componentDO);
- void addEntryPoint(Composite* composite, DataObjectPtr entryPointDO);
- void addExternalService(Composite* composite, DataObjectPtr externalServiceDO);
+ void addCompositeServiceType(Composite* composite, DataObjectPtr compositeServiceDO);
+ void addCompositeReferenceType(Composite* composite, DataObjectPtr externalServiceDO);
void addServices(Component* component, DataObjectPtr componentType);
void addReferences(Component* component, DataObjectPtr componentType);
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp Wed Aug 9 02:28:11 2006
@@ -89,19 +89,19 @@
///
/// Add a new entrypoint
///
- EntryPoint* Subsystem::addEntryPoint(const std::string& name)
+ CompositeServiceType* Subsystem::addCompositeServiceType(const std::string& name)
{
- LOGENTRY(1, "Subsystem::addEntryPoint");
+ LOGENTRY(1, "Subsystem::addCompositeServiceType");
- EntryPoint* newEntryPoint = new EntryPoint(name);
- entryPoints[name] = newEntryPoint;
- LOGEXIT(1, "Subsystem::addEntryPoint");
- return findEntryPoint(name);
+ CompositeServiceType* newCompositeServiceType = new CompositeServiceType(name);
+ compositeServices[name] = newCompositeServiceType;
+ LOGEXIT(1, "Subsystem::addCompositeServiceType");
+ return findCompositeServiceType(name);
}
- EntryPoint* Subsystem::findEntryPoint(const std::string& name)
+ CompositeServiceType* Subsystem::findCompositeServiceType(const std::string& name)
{
- return entryPoints[name];
+ return compositeServices[name];
}
void Subsystem::resolveWires()
@@ -113,7 +113,7 @@
compositeComponentIter->second->resolveWires();
}
- // Resolve EntryPoint wires
+ // Resolve CompositeServiceType wires
}
} // End namespace model
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h Wed Aug 9 02:28:11 2006
@@ -26,7 +26,7 @@
using std::map;
#include "tuscany/sca/model/Composite.h"
-#include "tuscany/sca/model/EntryPoint.h"
+#include "tuscany/sca/model/CompositeServiceType.h"
namespace tuscany
{
@@ -82,16 +82,16 @@
/**
* Add an new entry point to the subsystem.
* @param name The name of the entry point.
- * @return The new EntryPoint added to the subsystem.
+ * @return The new CompositeServiceType added to the subsystem.
*/
- EntryPoint* addEntryPoint(const std::string& name);
+ CompositeServiceType* addCompositeServiceType(const std::string& name);
/**
* Find an entry point by name.
* @param name The name of the entry point to be found.
- * @return The EntryPoint that was found, or 0 if not found.
+ * @return The CompositeServiceType that was found, or 0 if not found.
*/
- EntryPoint* findEntryPoint(const std::string& name);
+ CompositeServiceType* findCompositeServiceType(const std::string& name);
/**
* Return the name of the subsystem.
@@ -117,11 +117,11 @@
*/
COMPOSITECOMPONENT_MAP compositeComponents;
- typedef map<string, EntryPoint*> ENTRYPOINT_MAP;
+ typedef map<string, CompositeServiceType*> ENTRYPOINT_MAP;
/**
* A map of entry points defined in this subsystem.
*/
- ENTRYPOINT_MAP entryPoints;
+ ENTRYPOINT_MAP compositeServices;
};
} // End namespace model
} // End namespace sca
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h Wed Aug 9 02:28:11 2006
@@ -44,7 +44,7 @@
enum Type
{
ComponentServiceType,
- ExternalServiceType
+ CompositeReferenceTypeType
};
/**
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp Wed Aug 9 02:28:11 2006
@@ -76,9 +76,36 @@
LOGINFO_1(3, "Library::load : %s", name.c_str());
string msg;
#if defined(WIN32) || defined (_WINDOWS)
- hDLL = LoadLibrary(name.c_str());
+ int l = name.length();
+ if (l>=4 && name.substr(l-4, 4)==".dll")
+ {
+ hDLL = LoadLibrary(name.c_str());
+ }
+ else
+ {
+ hDLL = LoadLibrary((name+".dll").c_str());
+ }
#else
- hDLL = dlopen(name.c_str(), RTLD_NOW);
+ int l = name.length();
+ if (l>=3 && name.substr(l-3, 3)==".so")
+ {
+ hDLL = dlopen(name.c_str(), RTLD_NOW);
+ }
+ else
+ {
+ string soName;
+ int s = name.rfind("/");
+ if (s == name.length())
+ {
+ soName = name + ".so";
+ }
+ else
+ {
+ s++;
+ soName = name.substr(0, s) + "lib" + name.substr(s, name.length()-s) + ".so";
+ }
+ hDLL = dlopen(soName.c_str(), RTLD_NOW);
+ }
#endif
if (hDLL == NULL)
{
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp Wed Aug 9 02:28:11 2006
@@ -95,6 +95,10 @@
}
}
+ void Utils::breakpoint() {
+ // dummy method used to set breakpoints
+ }
+
//////////////////////////////////////////////////////////////////////////
// Print a DatObject tree
//////////////////////////////////////////////////////////////////////////
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h Wed Aug 9 02:28:11 2006
@@ -49,9 +49,11 @@
string& token1,
string& token2);
+ static void breakpoint();
+
SCA_API static void printDO(commonj::sdo::DataObjectPtr dataObject, int increment=0);
SCA_API static void printTypes(commonj::sdo::DataFactoryPtr df);
-
+
private:
static void tabs(int increment=0);
};
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceWrapper.h?rev=430012&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceWrapper.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceWrapper.h Wed Aug 9 02:28:11 2006
@@ -0,0 +1,47 @@
+/*
+ *
+ * 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 $ */
+
+#ifndef tuscany_sca_ws_wsreferencewrapper_h
+#define tuscany_sca_ws_wsreferencewrapper_h
+#include "osoa/sca/export.h"
+
+#include "tuscany/sca/core/CompositeReferenceWrapper.h"
+#include "tuscany/sca/model/CompositeReferenceType.h"
+#include "tuscany/sca/core/Operation.h"
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+
+ class SCA_API WSReferenceWrapper : public tuscany::sca::CompositeReferenceWrapper
+ {
+ public:
+ WSReferenceWrapper(tuscany::sca::model::WireTarget* target);
+ virtual ~WSReferenceWrapper();
+
+ virtual void invoke(Operation& operation);
+ };
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_ws_wsreferencewrapper_h
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceWrapper.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.cpp?rev=430012&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.cpp Wed Aug 9 02:28:11 2006
@@ -0,0 +1,678 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+#include "tuscany/sca/ws/WSServiceProxy.h"
+
+using namespace tuscany::sca;
+
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/core/SCARuntime.h"
+
+#include "tuscany/sca/model/WSBinding.h"
+
+#include "commonj/sdo/SDO.h"
+using namespace commonj::sdo;
+
+using namespace tuscany::sca::ws;
+
+
+// Singleton pattern
+WSServiceProxy* WSServiceProxy::compositeServiceProxyInstance = new WSServiceProxy();
+
+WSServiceProxy* WSServiceProxy::getInstance()
+{
+ return compositeServiceProxyInstance;
+}
+
+WSServiceProxy::WSServiceProxy()
+{
+ LOGENTRY(1,"WSServiceProxy::constructor");
+ tuscanyRuntime = NULL;
+ scaCompositeServiceType = NULL;
+ compositeServiceName = "";
+ systemRoot = "";
+ compositeComponent = "";
+ LOGEXIT(1,"WSServiceProxy::constructor");
+}
+
+WSServiceProxy::~WSServiceProxy()
+{
+ LOGENTRY(1,"WSServiceProxy::destructor");
+
+ if(tuscanyRuntime != NULL)
+ {
+ tuscanyRuntime->stop();
+ delete tuscanyRuntime;
+ tuscanyRuntime = NULL;
+ }
+ if(scaCompositeServiceType != NULL)
+ {
+ delete scaCompositeServiceType;
+ }
+ LOGEXIT(1,"WSServiceProxy::destructor");
+}
+
+void WSServiceProxy::init(const char* systemRootPath, const char* fullCompositeServiceTypeName)
+{
+ LOGENTRY(1,"WSServiceProxy::init");
+
+ try
+ {
+
+ // fullCompositeServiceTypeName is of the form "subsystem name"/"composite component name"/"entry point name"
+ // Get the "subsystem name"/"composite component name" part for setDefaultCompositeComponent
+ // Keep the "entry point name" part for use in invoke
+ string subsystemAndComponentName, epName;
+ Utils::rTokeniseString("/", fullCompositeServiceTypeName, subsystemAndComponentName, epName);
+
+ bool newInitParams = false;
+
+ if(systemRoot.length() != 0 && systemRoot != systemRootPath)
+ {
+ systemRoot = systemRootPath;
+ newInitParams = true;
+ }
+
+ if(compositeComponent.length() != 0 && compositeComponent != subsystemAndComponentName)
+ {
+ compositeComponent = subsystemAndComponentName;
+ newInitParams = true;
+ }
+
+ if(compositeServiceName.length() != 0 && compositeServiceName != epName)
+ {
+ compositeServiceName = epName;
+ newInitParams = true;
+ }
+
+
+ if(tuscanyRuntime == NULL)
+ {
+ LOGINFO(4, "Creating new TuscanyRuntime");
+ compositeComponent = subsystemAndComponentName;
+ systemRoot = systemRootPath;
+ compositeServiceName = epName;
+ tuscanyRuntime = new TuscanyRuntime(compositeComponent, systemRoot);
+ tuscanyRuntime->start();
+ }
+ else if(tuscanyRuntime != NULL && newInitParams)
+ {
+ LOGINFO(4, "Restarting TuscanyRuntime with new SystemRoot or DefaultComposite");
+ tuscanyRuntime->stop();
+ tuscanyRuntime->setDefaultCompositeComponent(compositeComponent);
+ tuscanyRuntime->setSystemRoot(systemRoot);
+ tuscanyRuntime->start();
+ }
+
+ if(scaCompositeServiceType == NULL)
+ {
+ scaCompositeServiceType = new CompositeService(fullCompositeServiceTypeName);
+ }
+ else
+ {
+ if(newInitParams)
+ {
+ delete scaCompositeServiceType;
+ scaCompositeServiceType = NULL;
+ scaCompositeServiceType = new CompositeService(fullCompositeServiceTypeName);
+ }
+ }
+ }
+ catch(SystemConfigurationException &ex)
+ {
+ LOGERROR_1(0, "SystemConfigurationException has been caught: %s\n", ex.getMessageText());
+ scaCompositeServiceType = 0;
+ }
+ catch(ServiceRuntimeException &ex)
+ {
+ LOGERROR_2(0, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText());
+ scaCompositeServiceType = 0;
+ }
+ LOGEXIT(1,"WSServiceProxy::init");
+}
+
+DataFactoryPtr WSServiceProxy::getDataFactory()
+{
+ if (scaCompositeServiceType == 0) return 0;
+ return scaCompositeServiceType->getDataFactory();
+}
+
+///
+/// This method will be called when an CompositeServiceType needs to be invoked.
+///
+DataObjectPtr WSServiceProxy::invoke(const char* operationName, DataObjectPtr inputDataObject)
+{
+ LOGENTRY(1,"WSServiceProxy::invoke");
+
+ if (scaCompositeServiceType == 0)
+ {
+ LOGINFO(4, "WSServiceProxy has not got an sca CompositeServiceType\n");
+ return NULL;
+ }
+
+ DataFactoryPtr dataFactoryPtr = scaCompositeServiceType->getDataFactory();
+
+ DataObjectPtr outputDataObject = NULL;
+ SCARuntime* runtime = SCARuntime::getInstance();
+
+ Composite* composite = runtime->getCurrentComposite();
+
+ CompositeServiceType* compositeService = composite->findCompositeServiceType(compositeServiceName);
+
+ Binding* binding = compositeService->getBinding();
+ if(binding->getBindingType() == Binding::SCA)
+ {
+ LOGINFO_1(4, "WSServiceProxy has got SCA binding: %s\n", binding->getUri().c_str());
+ LOGERROR(0, "CompositeServiceTypes with SCA bindings are not yet supported");
+ return NULL;
+ }
+ else if(binding->getBindingType() == Binding::WS)
+ {
+ WSBinding* wsBinding = (WSBinding*) binding;
+
+ string wsdlNamespace = wsBinding->getWSDLNamespaceURL();
+ string wsdlPort = wsBinding->getPortName();
+ string wsdlService = wsBinding->getServiceName();
+
+ Wsdl* wsdl = composite->findWsdl(wsdlNamespace);
+ if (wsdl == 0)
+ {
+ LOGINFO_1(0, "WSDL description %s not found\n", wsdlNamespace.c_str());
+ return NULL;
+ }
+
+ WsdlOperation operation;
+ try
+ {
+ operation = wsdl->findOperation(wsdlService, wsdlPort, operationName);
+ }
+ catch(SystemConfigurationException &ex)
+ {
+ LOGERROR_1(0, "SystemConfigurationException has been caught: %s\n", ex.getMessageText());
+ return NULL;
+ }
+
+ LOGINFO_2(4, "WSServiceProxy has got WsdlOperation with inputType: %s#%s",
+ operation.getInputTypeUri().c_str(),
+ operation.getInputTypeName().c_str());
+ LOGINFO_2(4, "WSServiceProxy has got WsdlOperation with outputType: %s#%s",
+ operation.getOutputTypeUri().c_str(),
+ operation.getOutputTypeName().c_str());
+ LOGINFO_2(4, "WSServiceProxy has got WsdlOperation with documentStyle=%d and encoded=%d",
+ operation.isDocumentStyle(),
+ operation.isEncoded());
+
+ if(operation.isDocumentStyle())
+ {
+ // Document style
+ outputDataObject = dataFactoryPtr->create(operation.getOutputTypeUri().c_str(), operation.getOutputTypeName().c_str());
+
+ //printf("outputDataObject %s#%s\n", outputDataObject->getType().getURI(), outputDataObject->getType().getName());
+ //Utils::printDO(outputDataObject);
+ }
+ else
+ {
+ // RPC style
+ LOGERROR(0, "CompositeServiceTypes with RPC style WSDL Operations are not yet supported");
+ return NULL;
+ }
+ }
+
+ // Create new Operation object and set parameters and return value
+ Operation operation(operationName);
+
+ // Go through input data object to set the operation parameters
+ PropertyList pl = inputDataObject->getInstanceProperties();
+
+ for(int i=0; i<pl.size(); i++)
+ {
+ const char* name = pl[i].getName();
+
+ switch (pl[i].getTypeEnum())
+ {
+ case Type::BooleanType:
+ {
+ bool* boolData = new bool;
+ *boolData = inputDataObject->getBoolean(pl[i]);
+ //printf("inputDataObject has BooleanType named %s with value %d\n", name, boolData);
+ operation.addParameter(boolData);
+ }
+ break;
+ case Type::ByteType:
+ {
+ char* byteData = new char;
+ //printf("inputDataObject has ByteType named %s\n", name);
+ *byteData = inputDataObject->getByte(pl[i]);
+ operation.addParameter(byteData);
+ }
+ break;
+ case Type::BytesType:
+ {
+ int len = inputDataObject->getLength(pl[i]);
+ char* bytesData = new char[len+1];
+ int bytesWritten = inputDataObject->getBytes(pl[i], bytesData, len);
+ // Ensure the bytes end with the null char. Not sure if this is neccessary
+ if(bytesWritten <= len)
+ {
+ bytesData[bytesWritten] = 0;
+ }
+ else
+ {
+ bytesData[len] = 0;
+ }
+ //printf("inputDataObject has BytesType named %s with length %d\n", name, bytesWritten);
+ operation.addParameter(&bytesData);
+ }
+ break;
+ case Type::CharacterType:
+ {
+ // This code should work but won't be used as there is no mapping from an XSD type to the SDO CharacterType
+ wchar_t* charData = new wchar_t;
+ //printf("inputDataObject has CharacterType named %s\n", name);
+ *charData = inputDataObject->getCharacter(pl[i]);
+ operation.addParameter(charData);
+ }
+ break;
+ case Type::DoubleType:
+ {
+ long double* doubleData = new long double;
+ *doubleData = inputDataObject->getDouble(pl[i]);
+ //printf("inputDataObject has DoubleType named %s\n", name);
+ operation.addParameter(doubleData);
+ }
+ break;
+ case Type::FloatType:
+ {
+ float* floatData = new float;
+ *floatData = inputDataObject->getFloat(pl[i]);
+ //printf("inputDataObject has FloatType named %s with value %f\n", name, *floatData);
+ operation.addParameter(floatData);
+ }
+ break;
+ case Type::IntegerType:
+ {
+ long* intData = new long;
+ //printf("inputDataObject has IntegerType named %s\n", name);
+ *intData = inputDataObject->getInteger(pl[i]);
+ operation.addParameter(intData);
+ }
+ break;
+ case Type::ShortType:
+ {
+ short* shortData = new short;
+ //printf("inputDataObject has ShortType named %s\n", name);
+ *shortData = inputDataObject->getShort(pl[i]);
+ operation.addParameter(shortData);
+ }
+ break;
+ case Type::StringType:
+ {
+ const char** stringData = new const char*;
+ *stringData = inputDataObject->getCString(pl[i]);
+ //printf("inputDataObject has StringType named %s with value %s\n", name, stringData);
+ operation.addParameter(stringData);
+ }
+ break;
+ case Type::DataObjectType:
+ {
+ DataObjectPtr dataObjectData = inputDataObject->getDataObject(pl[i]);
+ //printf("inputDataObject has DataObjectType named %s (#%d)\n", name, dataObjectData);
+
+ if(!dataObjectData)
+ {
+ LOGINFO_1(4, "SDO DataObject parameter named %s was null", name);
+ }
+ operation.addParameter(&dataObjectData);
+ }
+ break;
+ case Type::OpenDataObjectType:
+ {
+ /*
+ * This code deals with xsd:any element parameters
+ * Get each element as a DataObject and add in to the parameter list
+ */
+
+ //printf("inputDataObject has OpenDataObjectType named %s\n", name);
+ DataObjectList& dataObjectList = inputDataObject->getList(pl[i]);
+
+ for(int j=0; j<dataObjectList.size(); j++)
+ {
+ DataObjectPtr dataObjectData = dataObjectList[j];
+ if(!dataObjectData)
+ {
+ LOGINFO_2(4, "SDO OpenDataObject parameter named %s[%d] was null", name, j);
+ }
+ operation.addParameter(&dataObjectData);
+ //Utils::printDO(dataObjectData);
+ }
+ }
+ break;
+ case Type::DateType:
+ LOGERROR_1(0, "SDO DateType parameters are not yet supported (%s)", name);
+ return NULL;
+ case Type::LongType:
+ LOGERROR_1(0, "SDO LongType (int64_t) parameters are not yet supported (%s)", name);
+ return NULL;
+ break;
+ case Type::UriType:
+ LOGERROR_1(0, "SDO UriType parameters are not yet supported (%s)", name);
+ return NULL;
+ break;
+ case Type::BigDecimalType:
+ LOGERROR_1(0, "SDO BigDecimalType parameters are not yet supported (%s)", name);
+ return NULL;
+ break;
+ case Type::BigIntegerType:
+ LOGERROR_1(0, "SDO BigIntegerType parameters are not yet supported (%s)", name);
+ return NULL;
+ break;
+ default:
+ LOGERROR_1(0, "Unknown SDO type parameter named %s has been found. Unknown types are not yet supported", name);
+ return NULL;
+ }
+ }
+
+ // Now go through outputDataObject to set the return value
+ pl = outputDataObject->getInstanceProperties();
+
+ // Set up the possible return value pointers
+ bool boolData = 0;
+ char byteData = 0;
+ wchar_t charData = 0;
+ long double doubleData = 0;
+ float floatData = 0;
+ long intData = 0;
+ short shortData = 0;
+ const char* stringData;
+ DataObjectPtr dataObjectData;
+
+
+ // There should only be one return value, but go through any list anyway?
+ if(pl.size() > 1)
+ {
+ LOGINFO(4, "More than one return value is defined in the WSDL, just defining the first");
+ }
+ else if(pl.size() == 0)
+ {
+ if(outputDataObject->getType().isOpenType() && outputDataObject->getType().isDataObjectType())
+ {
+ /*
+ * This code deals with returning xsd:any elements
+ * Return as a DataObject set within the outputDataObject
+ */
+
+ // An OpenDataObject for the data to return in
+ operation.setReturnValue(&dataObjectData);
+ }
+ else
+ {
+ LOGINFO(4, "No return values are defined in the WSDL");
+ }
+
+ }
+
+ if(pl.size() > 0)
+ {
+ const char* name = pl[0].getName();
+
+ switch (pl[0].getTypeEnum())
+ {
+ case Type::BooleanType:
+ {
+ //printf("outputDataObject has BooleanType named %s\n", name);
+ operation.setReturnValue(&boolData);
+ }
+ break;
+ case Type::ByteType:
+ {
+ //printf("outputDataObject has ByteType named %s\n", name);
+ operation.setReturnValue(&byteData);
+ }
+ break;
+ case Type::CharacterType:
+ {
+ //printf("outputDataObject has CharacterType named %s\n", name);
+ operation.setReturnValue(&charData);
+ }
+ break;
+ case Type::DoubleType:
+ {
+ //printf("outputDataObject has DoubleType named %s\n", name);
+ operation.setReturnValue((long double*) &doubleData);
+ }
+ break;
+ case Type::FloatType:
+ {
+ //printf("outputDataObject has FloatType named %s\n", name);
+ operation.setReturnValue(&floatData);
+ }
+ break;
+ case Type::IntegerType:
+ {
+ //printf("outputDataObject has IntegerType named %s\n", name);
+ operation.setReturnValue(&intData);
+ }
+ break;
+ case Type::ShortType:
+ {
+ //printf("outputDataObject has ShortType named %s\n", name);
+ operation.setReturnValue(&shortData);
+ }
+ break;
+ case Type::StringType:
+ case Type::BytesType:
+ {
+ //printf("outputDataObject has StringType or BytesType named %s\n", name);
+ operation.setReturnValue((const char**) &stringData);
+ }
+ break;
+ case Type::DataObjectType:
+ {
+ // printf("outputDataObject has DataObjectType named %s with type %s # %s\n", name, pl[0].getType().getURI(), pl[0].getType().getName());
+ operation.setReturnValue(&dataObjectData);
+ }
+ break;
+ case Type::DateType:
+ LOGERROR_1(0, "SDO DateType return values are not yet supported (%s)", name);
+ return NULL;
+ case Type::LongType:
+ LOGERROR_1(0, "SDO LongType (int64_t) return values are not yet supported (%s)", name);
+ return NULL;
+ case Type::UriType:
+ LOGERROR_1(0, "SDO UriType return values are not yet supported (%s)", name);
+ return NULL;
+ case Type::BigDecimalType:
+ LOGERROR_1(0, "SDO BigDecimalType return values are not yet supported (%s)", name);
+ return NULL;
+ case Type::BigIntegerType:
+ LOGERROR_1(0, "SDO BigIntegerType return values are not yet supported (%s)", name);
+ return NULL;
+ default:
+ LOGERROR_1(0, "Unknown SDO type return value named %s has been found. Unknown types are not yet supported", name);
+ return NULL;
+ }
+ }
+
+ try
+ {
+ // Call into the wired composite
+ scaCompositeServiceType->invoke(operation);
+
+ // Set the data in the outputDataObject to be returned
+ setOutputData(operation, outputDataObject);
+ }
+ catch(SDORuntimeException &ex)
+ {
+ // TODO: Return more error information than just a null DataObject
+ LOGERROR_2(0, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText());
+ return NULL;
+ }
+ catch(ServiceRuntimeException &ex)
+ {
+ // TODO: Return more error information than just a null DataObject
+ LOGERROR_2(0, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText());
+ return NULL;
+ }
+
+ LOGEXIT(1,"WSServiceProxy::invoke");
+
+ return outputDataObject;
+}
+
+
+void WSServiceProxy::setOutputData(Operation operation, DataObjectPtr outputDataObject)
+{
+ // Go through data object to set the return value
+ PropertyList pl = outputDataObject->getInstanceProperties();
+
+ if(pl.size() == 0)
+ {
+ if(outputDataObject->getType().isOpenType() && outputDataObject->getType().isDataObjectType())
+ {
+ /*
+ * This code deals with returning xsd:any elements
+ * Return as a DataObject set within the outputDataObject
+ */
+
+ DataObjectPtr* dataObjectData = (DataObjectPtr*) operation.getReturnValue();
+ //Utils::printDO(*dataObjectData);
+
+ // Need to provide a name for the dataobject being returned, use the containment property name if there is one.
+ const char* rootName = "OpenDataObject";
+ try
+ {
+ const Property& prop = (*dataObjectData)->getContainmentProperty();
+ rootName = prop.getName();
+ (*dataObjectData)->detach();
+ }
+ catch(SDOPropertyNotFoundException&)
+ {
+ // DataObject has no containment property - use default rootName
+ }
+ outputDataObject->setDataObject(rootName, *dataObjectData);
+ }
+ else
+ {
+ LOGINFO(4, "No return values are defined in the WSDL");
+ }
+
+ }
+
+ // Should only be one return value.. This goes through all return values
+ for(int i=0; i<pl.size(); i++)
+ {
+ const char* name = pl[i].getName();
+
+ switch (pl[i].getTypeEnum())
+ {
+ case Type::BooleanType:
+ {
+ bool* boolData = (bool*)operation.getReturnValue();
+ //printf("outputDataObject has BooleanType named %s with value %d\n", name, *boolData);
+ outputDataObject->setBoolean(pl[i], *boolData);
+ }
+ break;
+ case Type::ByteType:
+ {
+ char* byteData = (char*) operation.getReturnValue();
+ //printf("outputDataObject has ByteType named %s with value %c (#%d)\n", name, *byteData, *byteData);
+ outputDataObject->setByte(pl[i], *byteData);
+ }
+ break;
+ case Type::BytesType:
+ {
+ const char** bytesData = (const char**) operation.getReturnValue();
+ // TODO This looks for the first NULL byte - this may not be the full length of the data...
+ int len = 0;
+ while((*bytesData)[len] != 0)
+ {
+ len++;
+ }
+ //printf("outputDataObject has BytesType named %s with value %s and length %d\n", name, *bytesData, len);
+ outputDataObject->setBytes(pl[i], *bytesData, len);
+ }
+ break;
+ case Type::CharacterType:
+ {
+ wchar_t* charData = (wchar_t*) operation.getReturnValue();
+ //printf("outputDataObject has CharacterType named %s with value %s\n", name, charData);
+ outputDataObject->setCharacter(pl[i], *charData);
+ }
+ break;
+ case Type::DoubleType:
+ {
+ long double* doubleData = (long double*) operation.getReturnValue();
+ //printf("outputDataObject has DoubleType named %s with value %f\n", name, *doubleData);
+ outputDataObject->setDouble(pl[i], *doubleData);
+ }
+ break;
+ case Type::FloatType:
+ {
+ float* floatData = (float*) operation.getReturnValue();
+ //printf("outputDataObject has FloatType named %s with value %f \n", name, *floatData);
+ outputDataObject->setFloat(pl[i], *floatData);
+ }
+ break;
+ case Type::IntegerType:
+ {
+ long* intData = (long*) operation.getReturnValue();
+ //printf("outputDataObject has IntegerType named %s with value %d\n", name, *intData);
+ outputDataObject->setInteger(pl[i], *intData);
+ }
+ break;
+ case Type::ShortType:
+ {
+ short* shortData = (short*) operation.getReturnValue();
+ //printf("outputDataObject has ShortType named %s with value %d\n", name, *shortData);
+ outputDataObject->setShort(pl[i], *shortData);
+ }
+ break;
+ case Type::StringType:
+ {
+ const char** stringData = (const char**) operation.getReturnValue();
+ //printf("outputDataObject has StringType named %s with value %s\n", name, *stringData);
+ outputDataObject->setCString(pl[i], *stringData);
+ }
+ break;
+ case Type::DataObjectType:
+ {
+ DataObjectPtr* dataObjectData = (DataObjectPtr*) operation.getReturnValue();
+ //printf("outputDataObject has DataObjectType named %s with value (%d)\n", name, (*dataObjectData));
+ outputDataObject->setDataObject(pl[i], *dataObjectData);
+ }
+ break;
+ case Type::DateType:
+ LOGERROR_1(0, "SDO DateType return values are not yet supported (%s)", name);
+ break;
+ case Type::LongType:
+ LOGERROR_1(0, "SDO LongType (int64_t) return values are not yet supported (%s)", name);
+ break;
+ case Type::UriType:
+ LOGERROR_1(0, "SDO UriType return values are not yet supported (%s)", name);
+ break;
+ case Type::BigDecimalType:
+ LOGERROR_1(0, "SDO BigDecimalType return values are not yet supported (%s)", name);
+ break;
+ case Type::BigIntegerType:
+ LOGERROR_1(0, "SDO BigIntegerType return values are not yet supported (%s)", name);
+ break;
+ default:
+ LOGERROR_1(0, "Unknown SDO type return value named %s has been found. Unknown types are not yet supported", name);
+ }
+ }
+}
+
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.h?rev=430012&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.h Wed Aug 9 02:28:11 2006
@@ -0,0 +1,63 @@
+/*
+ *
+ * Copyright 2006 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.
+ */
+
+#ifndef tuscany_sca_ws_wsserviceproxy_h
+#define tuscany_sca_ws_wsserviceproxy_h
+
+#include "osoa/sca/export.h"
+
+#include "commonj/sdo/SDO.h"
+using commonj::sdo::DataObjectPtr;
+
+#include "tuscany/sca/core/CompositeService.h"
+using tuscany::sca::CompositeService;
+
+#include "tuscany/sca/core/TuscanyRuntime.h"
+using tuscany::sca::TuscanyRuntime;
+
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+ class SCA_API WSServiceProxy
+ {
+ public:
+ static WSServiceProxy* getInstance();
+ virtual ~WSServiceProxy();
+ virtual void init(const char* systemRoot, const char* compositeServiceName);
+ virtual DataFactoryPtr getDataFactory(void);
+ virtual DataObjectPtr invoke(const char* operationName, DataObjectPtr inputDataObject);
+ private:
+ WSServiceProxy();
+ static WSServiceProxy* compositeServiceProxyInstance;
+ virtual void setOutputData(Operation operation, DataObjectPtr outputDataObject);
+ string compositeServiceName;
+ string systemRoot;
+ string compositeComponent;
+ CompositeService* scaCompositeServiceType;
+ TuscanyRuntime* tuscanyRuntime;
+ };
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_ws_wsserviceproxy_h
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.cpp?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.cpp Wed Aug 9 02:28:11 2006
@@ -45,7 +45,7 @@
using namespace commonj::sdo;
using namespace commonj::sdo_axiom;
-Axis2Client::Axis2Client(ExternalService* extService)
+Axis2Client::Axis2Client(CompositeReferenceType* extService)
: externalService(extService)
{
}
Modified: incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.h?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.h (original)
+++ incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.h Wed Aug 9 02:28:11 2006
@@ -24,8 +24,8 @@
#include <osoa/sca/export.h>
-#include "tuscany/sca/core/ExternalServiceWrapper.h"
-#include "tuscany/sca/model/ExternalService.h"
+#include "tuscany/sca/core/CompositeReferenceWrapper.h"
+#include "tuscany/sca/model/CompositeReferenceType.h"
#include "tuscany/sca/model/Wsdl.h"
#include "tuscany/sca/core/Operation.h"
@@ -43,13 +43,13 @@
class SCA_API Axis2Client
{
public:
- Axis2Client(tuscany::sca::model::ExternalService* externalService);
+ Axis2Client(tuscany::sca::model::CompositeReferenceType* externalService);
virtual ~Axis2Client();
virtual void invoke(tuscany::sca::Operation& operation);
private:
- tuscany::sca::model::ExternalService* externalService;
+ tuscany::sca::model::CompositeReferenceType* externalService;
axiom_node_t* createPayload(Operation& operation,
const WsdlOperation& wsdlOp,
Modified: incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Makefile.am?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Makefile.am Wed Aug 9 02:28:11 2006
@@ -1,6 +1,6 @@
lib_LTLIBRARIES = libtuscany_sca_ws_reference.la
-libtuscany_sca_ws_reference_la_SOURCES = WSServiceWrapper.cpp Axis2Client.cpp
+libtuscany_sca_ws_reference_la_SOURCES = WSReferenceWrapper.cpp Axis2Client.cpp
noinst_HEADERS = *.h
Added: incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/WSReferenceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/WSReferenceWrapper.cpp?rev=430012&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/WSReferenceWrapper.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/WSReferenceWrapper.cpp Wed Aug 9 02:28:11 2006
@@ -0,0 +1,71 @@
+/*
+ *
+ * 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: 414501 $ $Date: 2006-06-15 00:45:29 -0700 (Thu, 15 Jun 2006) $ */
+#if defined(WIN32) || defined (_WINDOWS)
+#pragma warning(disable: 4091)
+#endif
+
+#include "tuscany/sca/ws/WSReferenceWrapper.h"
+
+#include "Axis2Client.h"
+
+#include "osoa/sca/sca.h"
+using namespace osoa::sca;
+
+#include "tuscany/sca/util/Logging.h"
+using namespace tuscany::sca;
+using namespace tuscany::sca::ws;
+
+
+
+
+WSReferenceWrapper::WSReferenceWrapper(tuscany::sca::model::WireTarget* target) : CompositeReferenceWrapper(target)
+{
+
+}
+
+WSReferenceWrapper::~WSReferenceWrapper()
+{
+
+}
+
+///
+/// This method will be called when a web service call needs to be made.
+///
+void WSReferenceWrapper::invoke(Operation& operation)
+{
+ LOGENTRY(1, "WSReferenceWrapper::invoke");
+
+ const string& operationName = operation.getName();
+
+ LOGINFO_2(2,"External service: %s, Operation: %s", getTarget()->getName().c_str() , operationName.c_str());
+
+ for (unsigned int i=0; i<operation.getNParms(); i++)
+ {
+ LOGINFO_2(2, "Parameter %p, Type %u", operation.getParameterValue(i),(int) operation.getParameterType(i));
+ }
+
+ // From the external service ws-binding, get the namespace of the wsdl endpoint
+ CompositeReferenceType* externalService = getCompositeReferenceType();
+
+ Axis2Client client(externalService);
+ client.invoke(operation);
+
+ LOGEXIT(1, "WSReferenceWrapper::invoke");
+}
+
Propchange: incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/WSReferenceWrapper.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Axis2Service_skeleton.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Axis2Service_skeleton.cpp?rev=430012&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Axis2Service_skeleton.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Axis2Service_skeleton.cpp Wed Aug 9 02:28:11 2006
@@ -0,0 +1,256 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+#if defined(WIN32) || defined (_WINDOWS)
+#pragma warning(disable: 4786)
+#pragma warning(disable: 4091)
+#endif
+
+#include <axis2_svc_skeleton.h>
+#include <axis2_array_list.h>
+#include <axis2_log_default.h>
+#include <axis2_error_default.h>
+#include <axiom.h>
+#include <stdio.h>
+
+#include <sdo_axiom.h>
+using namespace commonj::sdo;
+using namespace commonj::sdo_axiom;
+
+#include "tuscany/sca/util/Utils.h"
+using namespace tuscany::sca;
+
+#include "tuscany/sca/ws/WSServiceProxy.h"
+#include "Axis2Utils.h"
+using namespace tuscany::sca::ws;
+
+
+int AXIS2_CALL
+Axis2Service_free(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env);
+
+/*
+ * This method invokes the right service method
+ */
+axiom_node_t* AXIS2_CALL
+Axis2Service_invoke(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env,
+ axiom_node_t *node,
+ axis2_msg_ctx_t *msg_ctx);
+
+int AXIS2_CALL Axis2Service_init(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env);
+
+WSServiceProxy* compositeServiceProxy = NULL;
+
+axis2_svc_skeleton_t *
+axis2_Axis2Service_create(axis2_env_t *env)
+{
+ axis2_svc_skeleton_t *svc_skeleton = NULL;
+ svc_skeleton = (axis2_svc_skeleton_t *) AXIS2_MALLOC((env)->allocator,
+ sizeof(axis2_svc_skeleton_t));
+
+
+ svc_skeleton->ops = (axis2_svc_skeleton_ops_t *) AXIS2_MALLOC(
+ (env)->allocator, sizeof(axis2_svc_skeleton_ops_t));
+
+ svc_skeleton->func_array = NULL;
+
+ svc_skeleton->ops->free = Axis2Service_free;
+ svc_skeleton->ops->init = Axis2Service_init;
+ svc_skeleton->ops->invoke = Axis2Service_invoke;
+ /*svc_skeleton->ops->on_fault = Axis2Service_on_fault;*/
+
+ if(compositeServiceProxy == NULL)
+ {
+ compositeServiceProxy = WSServiceProxy::getInstance();
+ }
+
+ return svc_skeleton;
+}
+
+int AXIS2_CALL
+Axis2Service_init(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env)
+{
+ // This method never seems to be called - an old Axis2C artifact?
+
+ svc_skeleton->func_array = axis2_array_list_create(env, 0);
+ return AXIS2_SUCCESS;
+}
+
+int AXIS2_CALL
+Axis2Service_free(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env)
+{
+ /*if(svc_skeleton->func_array)
+ {
+ AXIS2_ARRAY_LIST_FREE(svc_skeleton->func_array, env);
+ svc_skeleton->func_array = NULL;
+ }*/
+
+ if(svc_skeleton->ops)
+ {
+ AXIS2_FREE((env)->allocator, svc_skeleton->ops);
+ svc_skeleton->ops = NULL;
+ }
+
+ if(svc_skeleton)
+ {
+ AXIS2_FREE((env)->allocator, svc_skeleton);
+ svc_skeleton = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+/*
+ * This method invokes the right service method
+ */
+axiom_node_t* AXIS2_CALL
+Axis2Service_invoke(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env,
+ axiom_node_t *node,
+ axis2_msg_ctx_t *msg_ctx)
+{
+ axiom_node_t *returnNode = node;
+
+ /* Depending on the function name invoke the
+ * corresponding Axis2Service method
+ */
+ if (node)
+ {
+ if (AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+ {
+ axiom_element_t *element = NULL;
+ element = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+ if (element)
+ {
+ // This gets the operation name from the root element name - this is correct for DocLit Wrapped style
+ axis2_char_t *op_name = AXIOM_ELEMENT_GET_LOCALNAME(element, env);
+ if (op_name)
+ {
+ char* systemRoot = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanySystemRoot");
+ char* fullCompositeServiceTypeName = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyCompositeServiceType");
+
+ AXIS2_LOG_INFO((env)->log, "Axis2Service invoke called with system root: %s entrypoint name: %s operation name: %s", systemRoot, fullCompositeServiceTypeName, op_name);
+
+ //LOGINFO_2(4, "Axis2Service invoke called with system root: %s and entrypoint name: %s", systemRoot, fullCompositeServiceTypeName);
+ //LOGINFO_1(4, "Axis2Service invoke called with operation", op_name);
+ compositeServiceProxy->init(systemRoot, fullCompositeServiceTypeName);
+
+ //Utils::printTypes(compositeServiceProxy->getDataFactory());
+
+ AxiomHelper* axiomHelper = AxiomHelper::getHelper();
+ if (compositeServiceProxy->getDataFactory() == 0)
+ {
+ AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: CompositeServiceType has no SCA implementation");
+ return 0;
+ }
+
+ char* om_str = NULL;
+ om_str = AXIOM_NODE_TO_STRING(node, env);
+ if (om_str)
+ {
+ AXIS2_LOG_INFO((env)->log, "Axis2Service invoke has request OM: %s\n", om_str);
+ }
+
+ DataObjectPtr inputDataObject = axiomHelper->toSdo(node, compositeServiceProxy->getDataFactory());
+
+ //printf("Axis2ServiceType inputDataObject: (%d)\n", inputDataObject);
+
+ if(!inputDataObject)
+ {
+ AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: Could not convert received Axiom node to SDO");
+ //LOGERROR(0, "Axis2Service_invoke: Failure whilst invoking CompositeServiceType");
+ /** TODO: return a SOAP fault here */
+ return 0;
+ }
+ //std::cout << "Axis2ServiceType inputDataObject:" << inputDataObject;
+ //Utils::printDO(inputDataObject);
+ //std::cout << "Axis2ServiceType inputDataObject printed\n";
+
+ DataObjectPtr outputDataObject = compositeServiceProxy->invoke(op_name, inputDataObject);
+
+ //std::cout << "Axis2ServiceType outputDataObject:" << outputDataObject;
+ //Utils::printDO(outputDataObject);
+ //std::cout << "Axis2ServiceType outputDataObject printed\n";
+
+ if(!outputDataObject)
+ {
+ AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: Failure whilst invoking CompositeServiceType");
+ //LOGERROR(0, "Axis2Service_invoke: Failure whilst invoking CompositeServiceType");
+ /** TODO: return a SOAP fault here */
+ return 0;
+ }
+
+ returnNode = axiomHelper->toAxiomNode(outputDataObject);
+
+ om_str = NULL;
+ om_str = AXIOM_NODE_TO_STRING(returnNode, env);
+ if (om_str)
+ {
+ AXIS2_LOG_INFO((env)->log, "Axis2Service invoke has response OM : %s\n", om_str);
+ }
+
+ AxiomHelper::releaseHelper(axiomHelper);
+
+ //LOGEXIT(1, "Axis2Service_invoke");
+ return returnNode;
+ }
+ }
+ }
+ }
+
+ AXIS2_LOG_ERROR((env)->log, AXIS2_LOG_SI, "Axis2Service_invoke: invalid OM parameters in request");
+ //LOGERROR(0, "Axis2Service service ERROR: invalid OM parameters in request\n");
+
+ /** TODO: return a SOAP fault here */
+ return node;
+}
+
+
+extern "C"
+{
+/**
+ * Following block distinguish the exposed part of the dll.
+ */
+
+AXIS2_EXPORT int axis2_get_instance(axis2_svc_skeleton **inst,
+ axis2_env_t *env)
+{
+ *inst = axis2_Axis2Service_create(env);
+ /*if(NULL != *inst)
+ {
+ status = *inst->init();
+ }*/
+ if(!(*inst))
+ {
+ return AXIS2_FAILURE;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int axis2_remove_instance(axis2_svc_skeleton_t *inst,
+ axis2_env_t *env)
+{
+ axis2_status_t status = AXIS2_FAILURE;
+ if (inst)
+ {
+ status = AXIS2_SVC_SKELETON_FREE(inst, env);
+ }
+ return status;
+}
+}
Propchange: incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Axis2Service_skeleton.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Makefile.am?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Makefile.am Wed Aug 9 02:28:11 2006
@@ -1,6 +1,6 @@
lib_LTLIBRARIES = libtuscany_sca_ws_service.la
-libtuscany_sca_ws_service_la_SOURCES = Axis2EntryPointService_skeleton.cpp Axis2Utils.cpp
+libtuscany_sca_ws_service_la_SOURCES = Axis2Service_skeleton.cpp Axis2Utils.cpp
noinst_HEADERS = *.h
Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType Wed Aug 9 02:28:11 2006
@@ -15,11 +15,10 @@
limitations under the License.
-->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9">
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
<service name="AccountDataService">
- <interface.cpp header="AccountDataService.h">
- </interface.cpp>
+ <interface.cpp header="AccountDataService.h"/>
</service>
</componentType>
Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.componentType?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.componentType (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.componentType Wed Aug 9 02:28:11 2006
@@ -15,22 +15,19 @@
limitations under the License.
-->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9"
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<service name="AccountService">
- <interface.cpp header="AccountService.h">
- </interface.cpp>
+ <interface.cpp header="AccountService.h"/>
</service>
- <reference name="AccountDataService">
- <interface.cpp header="AccountDataService.h">
- </interface.cpp>
+ <reference name="accountData">
+ <interface.cpp header="AccountDataService.h"/>
</reference>
<reference name="stockQuote">
- <interface.cpp header="StockQuoteService.h">
- </interface.cpp>
+ <interface.cpp header="StockQuoteService.h"/>
</reference>
<property name="currency" type="xs:string"/>
Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp Wed Aug 9 02:28:11 2006
@@ -84,7 +84,7 @@
factory->create("http://www.bigbank.com/AccountService","AccountReport");
com::bigbank::account::AccountDataService *dataService =
- (com::bigbank::account::AccountDataService*)theContext.getService("AccountDataService");
+ (com::bigbank::account::AccountDataService*)theContext.getService("accountData");
if (dataService == 0)
{
@@ -121,7 +121,7 @@
if (stockService == 0)
{
- std::cout << "No Stock Quote Data Service registered" << std::endl;
+ std::cout << "No Stock Quote Service registered" << std::endl;
return newReport;
}
Added: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Accounts.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Accounts.composite?rev=430012&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Accounts.composite (added)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Accounts.composite Wed Aug 9 02:28:11 2006
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 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.
+ -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ name="Accounts">
+
+ <service name="WSAccountEntrypoint" multiplicity="1..1">
+ <interface.wsdl interface="AccountService.wsdl"/>
+ <binding.ws port="http://www.bigbank.com/AccountService#wsdl.endpoint(AccountService/AccountServiceSOAP)"/>
+ <reference>AccountServiceComponent</reference>
+ </service>
+
+ <component name="AccountServiceComponent">
+ <implementation.cpp library="Accounts" header="AccountServiceImpl.h"/>
+ <reference name="accountData">AccountDataServiceComponent</reference>
+ <reference name="stockQuote">StockQuoteServiceComponent</reference>
+ <property name="currency">EURO</property>
+ </component>
+
+ <component name="AccountDataServiceComponent">
+ <implementation.cpp library="Accounts" header="AccountDataServiceImpl.h"/>
+ </component>
+
+ <component name="StockQuoteServiceComponent">
+ <implementation.cpp library="Accounts" header="StockQuoteServiceImpl.h"/>
+ <reference name="webService">StockQuoteWebService</reference>
+ </component>
+
+ <reference name="StockQuoteWebService">
+ <interface.cpp header="StockQuoteWebService.h"/>
+ <binding.ws port="http://www.webserviceX.NET/#wsdl.endpoint(StockQuote/StockQuoteSoap)"/>
+ </reference>
+
+</composite>
Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Makefile.am?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Makefile.am Wed Aug 9 02:28:11 2006
@@ -3,11 +3,11 @@
BUILT_SOURCES = AccountDataServiceImpl_AccountDataService_Proxy.cpp \
AccountDataServiceImpl_AccountDataService_Wrapper.cpp \
-AccountServiceImpl_AccountDataService_Proxy.cpp \
+AccountServiceImpl_accountData_Proxy.cpp \
AccountServiceImpl_AccountService_Proxy.cpp \
AccountServiceImpl_AccountService_Wrapper.cpp \
AccountServiceImpl_stockQuote_Proxy.cpp \
-StockQuoteServiceImpl_StockQuoteExternal_Proxy.cpp \
+StockQuoteServiceImpl_webService_Proxy.cpp \
StockQuoteServiceImpl_StockQuoteService_Proxy.cpp \
StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp
@@ -26,11 +26,11 @@
StockQuoteServiceImpl.cpp \
AccountDataServiceImpl_AccountDataService_Proxy.cpp \
AccountDataServiceImpl_AccountDataService_Wrapper.cpp \
-AccountServiceImpl_AccountDataService_Proxy.cpp \
+AccountServiceImpl_accountData_Proxy.cpp \
AccountServiceImpl_AccountService_Proxy.cpp \
AccountServiceImpl_AccountService_Wrapper.cpp \
AccountServiceImpl_stockQuote_Proxy.cpp \
-StockQuoteServiceImpl_StockQuoteExternal_Proxy.cpp \
+StockQuoteServiceImpl_webService_Proxy.cpp \
StockQuoteServiceImpl_StockQuoteService_Proxy.cpp \
StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp
Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/StockQuoteService.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/StockQuoteService.h?rev=430012&r1=430011&r2=430012&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/StockQuoteService.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/StockQuoteService.h Wed Aug 9 02:28:11 2006
@@ -8,7 +8,7 @@
{
/*
- * AccountsService C interface
+ * StockQuote interface
*/
class StockQuoteService {
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org