tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robbin...@apache.org
Subject svn commit: r366157 [9/33] - in /incubator/tuscany/cpp/sca: ./ bin/ include/ include/osoa/ include/osoa/sca/ include/tuscany/ include/tuscany/sca/ include/tuscany/sca/core/ include/tuscany/sca/model/ include/tuscany/sca/util/ include/tuscany/sca/ws/ li...
Date Thu, 05 Jan 2006 10:59:14 GMT
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,235 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/model/Module.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+        
+        namespace model
+        {
+            
+            // Constructor
+            Module::Module(const std::string& moduleName) 
+                : name(moduleName)
+            {
+                LOGENTRY(1, "Module::constructor");
+                LOGEXIT(1, "Module::constructor");
+            }
+            
+            Module::~Module()
+            {
+            }
+            
+            void Module::setRoot(const std::string& rootDirectory)
+            {
+                moduleRoot = rootDirectory;
+            }
+            
+            
+            ///
+            /// Add a new component to the module component
+            ///
+            Component* Module::addComponent(const std::string& name)
+            {
+                LOGENTRY(1, "Module::addComponent");
+                Component* newComponent = new Component(name, this);
+                components[name] = newComponent;
+                LOGEXIT(1, "Module::addComponent");
+                return newComponent;
+            }
+            
+            Component* Module::findComponent(const std::string& name)
+            {
+                LOGENTRY(1, "Module::findComponent");
+                Component* foundComponent = components[name];
+                LOGEXIT(1, "Module::findComponent");
+                return foundComponent;
+            }
+            
+            Service* Module::findComponentService(const std::string& name)
+            {
+                LOGENTRY(1, "Module::findComponentService");
+                
+                Service* service = 0;
+                
+                string componentName;
+                string serviceName;
+                Utils::tokeniseUri(name, componentName, serviceName);
+                
+                // Locate the component
+                Component* foundComponent = components[name];
+                if (foundComponent)
+                {
+                    // Locate the service
+                    service = foundComponent->findService(serviceName);
+                }
+                LOGEXIT(1, "Module::findComponentService");
+                return service;
+            }
+            
+            ExternalService* Module::findExternalService(const std::string& name)
+            {
+                LOGENTRY(1, "Module::findExternalService");
+                ExternalService* foundService = externalServices[name];
+                LOGEXIT(1, "Module::findExternalService");
+                return foundService;
+            }
+            
+            
+            EntryPoint* Module::addEntryPoint(const std::string& name)
+            {
+                LOGENTRY(1, "Module::addEntryPoint");
+                EntryPoint* ep = new EntryPoint(name);
+                entryPoints[name] = ep;
+                LOGEXIT(1, "Module::addEntryPoint");
+                return findEntryPoint(name);
+            }
+            
+            EntryPoint* Module::findEntryPoint(const std::string& name)
+            {
+                return entryPoints[name];
+            }
+
+
+            ExternalService* Module::addExternalService(const std::string& name)
+            {
+                LOGENTRY(1, "Module::addExternalService");
+                ExternalService* es = new ExternalService(name, this);
+                externalServices[name] = es;
+                LOGEXIT(1, "Module::addExternalService");
+                return es;
+            }
+            
+            void Module::addWire(const std::string& source, const std::string& target)
+            {
+                LOGENTRY(1, "Module::addWire");
+                wires.push_back(Wire(source, target));
+                LOGEXIT(1, "Module::addWire");
+            }
+            
+            
+            void Module::resolveWires()
+            {
+                LOGENTRY(1, "Module::resolveWires");
+                 for (WIRES::iterator iter = wires.begin();
+                iter != wires.end();
+                iter++)
+                {
+                    // -----------------
+                    // Locate the target
+                    // -----------------
+                    WireTarget* target = findComponentService(iter->getTarget());
+                    if (!target)
+                    {
+                        target = findExternalService(iter->getTarget());
+                    }
+                    if (!target)
+                    {
+                        LOGERROR_1(0, "Module::resolveWires: Wire target %s not found", iter->getTarget().c_str());
+                    }
+                    else
+                    {
+                        EntryPoint* entrypoint = findEntryPoint(iter->getSourceComponent());
+                        if (entrypoint)
+                        {
+                            entrypoint->addTarget(target);
+                        }
+                        else
+                        {
+                            Component* component = findComponent(iter->getSourceComponent());
+                            if (component)
+                            {
+                                ServiceReference* serviceReference = component->findReference(iter->getSourceReference());
+                                if (serviceReference)
+                                {
+                                    serviceReference->addTarget(target);
+                                }
+                                else
+                                {
+                                    LOGERROR_1(0, "Module::resolveWires: Wire source reference %s not found", iter->getSourceReference().c_str());
+                                }
+                            }
+                            else
+                            {
+                                LOGERROR_1(0, "Module::resolveWires: Wire source %s not found", iter->getSourceComponent().c_str());
+                            }
+                        }
+                    }
+                }
+
+                LOGEXIT(1, "Module::resolveWires");
+            }
+
+
+            
+            void Module::addWsdl(commonj::sdo::DataObjectPtr wsdlModel)
+            {
+                LOGENTRY(1, "Module::addWsdl");
+                Wsdl* wsdl = new Wsdl(wsdlModel);
+                wsdls[wsdl->getNamespace()] = wsdl;
+                LOGEXIT(1, "Module::addWsdl");
+
+            }
+
+            Wsdl* Module::findWsdl(const std::string& wsdlNamespace )
+            {
+                return wsdls[wsdlNamespace];
+
+            }
+
+
+            // Get an XSDHelper - one will be created for each module
+            commonj::sdo::XSDHelperPtr Module::getXSDHelper()
+            {
+                if (xsdHelper == 0)
+                {
+                    xsdHelper = commonj::sdo::HelperProvider::getXSDHelper();
+                }
+
+                return xsdHelper;
+            }
+
+            // Get an XMLHelper - one will be created for each module
+            commonj::sdo::XMLHelperPtr Module::getXMLHelper()
+            {
+                if (xmlHelper == 0)
+                {
+                    xmlHelper = commonj::sdo::HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory());
+                }
+
+                return xmlHelper;
+            }
+
+
+            // Get a data factory - the one in the xsd/xml helper
+            commonj::sdo::DataFactoryPtr Module::getDataFactory()
+            {
+                return getXSDHelper()->getDataFactory();
+            }
+            
+        } // End namespace model
+        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,235 @@
+/*
+ *
+ *  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_model_module_h
+#define tuscany_sca_model_module_h
+
+#include <string>
+using std::string;
+
+#include <map>
+using std::map;
+#include <vector>
+using std::vector;
+
+#include "commonj/sdo/SDO.h"
+
+
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/ExternalService.h"
+#include "tuscany/sca/model/EntryPoint.h"
+#include "tuscany/sca/model/Wire.h"
+#include "tuscany/sca/model/Wsdl.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+
+        namespace model
+        {
+            /**
+             * Information about a module.
+             */
+            class Module
+            {
+            public:
+                /**
+                 * Constructor.
+                 * @param name the name of the module.
+                 */
+                Module(const std::string& name);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~Module();
+
+                /**
+                 * Set the root directory of the module information.
+                 * @param rootDirectory The root of the module in the file system.
+                 */
+                void setRoot(const std::string& rootDirectory);
+
+                /**
+                 * Get the root directory of the module.
+                 * @return The root of the module in the file system.
+                 */
+                const std::string& getRoot() {return moduleRoot;}
+                
+                /**
+                 * Return the name of the module.
+                 * @return Name of the module.
+                 */
+                const std::string& getName() {return name;}
+
+                /**
+                 * Add a new component to the module.
+                 * @param componentName The name of the new component.
+                 * @return The Component added to the module.
+                 */
+                Component* addComponent(const std::string& componentName);
+
+                /**
+                 * Add a new entry point to the module.
+                 * @param name The name of the new entry point.
+                 * @return The entry point added to the module.
+                 */
+                EntryPoint* addEntryPoint(const std::string& name);
+
+                /**
+                 * Find an entry point by name.
+                 * @param name The name of the entry point to be found.
+                 * @return The entry point that was found, or 0 if not found.
+                 */
+                EntryPoint* findEntryPoint(const std::string& name);
+                
+                /**
+                 * Add a new external service to the module.
+                 * @param name The name of the new external service.
+                 * @return The external service added to the module.
+                 */
+                ExternalService* addExternalService(const std::string& name);
+
+                /**
+                 * Add a wire to the model.
+                 * @param source The source location. Either the source component and
+                 * reference (optional), or an entry point.
+                 * @param target The target location. Either the target component and
+                 * service (optional), or an external service.
+                 */
+                void addWire(const std::string& source, const std::string& target);
+ 
+                /**
+                 * Find a component by name.
+                 * @param componentName The name of the component to be found.
+                 * @return The component that was found, or 0 if not found.
+                 */
+                Component* findComponent(const std::string& componentName);
+
+                /**
+                 * Find a component and service by name.
+                 * @param componentServiceName A string of the form 
+                 * "componentName"/"serviceName" where the service name is optional
+                 * if there is only one service on the component.
+                 * @return The Service that was found, or 0 if not found.
+                 */
+                Service* findComponentService(const std::string& componentServiceName);
+
+                /**
+                 * Find an external service by name.
+                 * @param serviceName The name of the external service to be found.
+                 * @return The external service that was found, or 0 if not found.
+                 */
+                ExternalService* findExternalService(const std::string& serviceName);
+
+                /**
+                 * Add a WSDL definition to the module.
+                 * @param wsdlModel A data object holding all the information about 
+                 * the WSDL definition from a WSDL file.
+                 */
+                void addWsdl(commonj::sdo::DataObjectPtr wsdlModel);
+
+                /**
+                 * Find a WSDL definition by target namespace.
+                 * @param wsdlNamespace The namespace of the WSDL definitions to find.
+                 */
+                Wsdl* findWsdl(const std::string& wsdlNamespace);
+
+                /**
+                 * Return a cached SDO XSDHelper.
+                 */
+                commonj::sdo::XSDHelperPtr getXSDHelper(void);
+
+                /**
+                 * Return a cached SDO XMLHelper.
+                 */
+                commonj::sdo::XMLHelperPtr getXMLHelper(void);
+
+                /**
+                 * Return a data factory which has all the types defined in XSDs and
+                 * WSDL files configured for this module.
+                 * @return The data factory for this module.
+                 */
+                commonj::sdo::DataFactoryPtr getDataFactory(void);
+
+                /**
+                 * Work through the list of wires and connect the source and target uris.
+                 */
+                void resolveWires();
+ 
+            private:
+                /**
+                 * Name of the module.
+                 */
+                string name;
+
+                /**
+                 * Directory of the root of the module.
+                 */
+                string moduleRoot;
+
+                /**
+                 * Cached XSDHelper.
+                 */
+                commonj::sdo::XSDHelperPtr xsdHelper;
+
+                /**
+                 * Cached XMLHelper.
+                 */
+                commonj::sdo::XMLHelperPtr xmlHelper;
+
+                typedef map<std::string, Component*> COMPONENT_MAP;
+                /**
+                 * Map (by name) of all the components in this module.
+                 */
+                COMPONENT_MAP components;
+
+                typedef map<std::string, ExternalService*> EXTERNALSERVICE_MAP;
+                /**
+                 * Map (by name) of all the external services in this module.
+                 */
+                EXTERNALSERVICE_MAP externalServices;
+
+                typedef map<std::string, EntryPoint*> ENTRYPOINT_MAP;
+                /**
+                 * Map (by name) of all the entry points in this module.
+                 */
+                ENTRYPOINT_MAP entryPoints;
+
+                typedef vector<Wire> WIRES;
+                /**
+                 * Vector of all the wires in this module.
+                 */
+                WIRES wires;
+
+                typedef map<std::string, Wsdl*> WSDL_MAP;
+                /**
+                 * Map by namespace of all the wsdl definitions in this module.
+                 */
+                WSDL_MAP wsdls;
+            };
+
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // SCA_ModuleComponent_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Module.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp Thu Jan  5 02:54:16 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 $ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/Service.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            
+            
+            // Constructor
+            Service::Service(const std::string& serviceName, Component* comp) 
+                : WireTarget(serviceName),
+                component(comp)
+            {
+                LOGENTRY(1, "Service::constructor (Component)");
+                LOGINFO_1(3, "Service::constructor: Service name: %s", serviceName.c_str());
+                LOGEXIT(1, "Service::constructor");
+            }
+
+            Service::~Service()
+            {
+            }
+
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,81 @@
+/*
+ *
+ *  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_model_service_h
+#define tuscany_sca_model_service_h
+
+#include <string>
+using std::string;
+
+#include "tuscany/sca/model/WireTarget.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            class Component;
+
+            /**
+             * Information about a service defined on a component.
+             */
+            class Service : public WireTarget
+            {
+            public:
+                /**
+                 * Destructor.
+                 */
+                 virtual ~Service();
+
+                /**
+                 * Return the type of the wire target.
+                 * @return Always returns ComponentServiceType.
+                 */
+                virtual Type getServiceType() {return ComponentServiceType;}
+
+                /**
+                 * Get the component on which this service is defined.
+                 * @return The component on which this service is defined.
+                 */
+                Component* getComponent() {return component;}
+
+
+            private:
+                friend class Component;
+                /**
+                 * Constructor.
+                 * @param name The name of the service.
+                 * @param component The component on which this service is defined.
+                 */
+                Service(const std::string& name, Component* component);
+
+                /**
+                 * The component on which this service is defined.
+                 */
+                 Component* component;
+
+            };
+
+         } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_service_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,89 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/model/ServiceReference.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            
+            
+            // Constructor
+            ServiceReference::ServiceReference(const std::string& referenceName)
+                : name(referenceName), multiplicity(ONE_ONE)
+            {
+            }
+            
+            ServiceReference::~ServiceReference()
+            {
+            }
+            
+            void ServiceReference::addTarget(WireTarget* targ)
+            {
+                if (multiplicity == ONE_ONE || multiplicity == ZERO_ONE)
+                {
+                    if (targets.size() > 0)
+                    {
+                        // throw exception
+                        string message = "Duplicate wire for reference: " + name;
+                        throw SystemConfigurationException(message.c_str());
+                    }
+                }
+
+                targets.push_back(targ);
+            }
+            
+            void ServiceReference::setMultiplicity(const std::string& multip)
+            {
+                if (multip == "0..1")
+                {
+                    multiplicity = ZERO_ONE;
+                }
+                else if (multip == "1..1")
+                {
+                    multiplicity = ONE_ONE;
+                }
+                else if (multip == "0..n")
+                {
+                    multiplicity = ZERO_MANY;
+                }
+                else if (multip == "1..n")
+                {
+                    multiplicity = ONE_MANY;
+                }
+                else
+                {
+                    string msg = "Invalid multiplicity specified, " + multip + ", for reference: " +name;
+                    throw SystemConfigurationException(msg.c_str());
+                }
+            }
+            
+             void ServiceReference::setInterface(Interface* interf)
+            {
+                iface = interf;
+            }
+
+       } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,136 @@
+/*
+ *
+ *  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_model_servicereference_h
+#define tuscany_sca_model_servicereference_h
+
+#include <string>
+using std::string;
+#include <vector>
+using std::vector;
+
+#include "tuscany/sca/model/Interface.h"
+#include "tuscany/sca/model/WireTarget.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Information about a reference on a serivce.
+             */
+            class ServiceReference
+            {
+            public:
+                /**
+                 * Constructor.
+                 * @param name The name of the reference.
+                 */
+                ServiceReference(const std::string& name)
+                    
+                /**
+                 * Destructor.
+                 */;
+                virtual ~ServiceReference();
+
+                /**
+                 * Get the name of the service.
+                 * @return The name of the service.
+                 */
+                const std::string& getName() {return name;}
+
+                /**
+                 * Multiplicity (how many wires can be attached to this
+                 * reference as their source)
+                 */
+                enum Multiplicity
+                {
+                    ZERO_ONE,
+                    ONE_ONE,
+                    ZERO_MANY,
+                    ONE_MANY
+                };
+
+                /**
+                 * Set the multiplicity of this reference.
+                 * @param multiplicity One of "0..1", "1..1", "0..n", "1..n"
+                 */
+                void setMultiplicity(const std::string& multiplicity);
+
+                /**
+                 * Get the multiplicity of this reference.
+                 * @return The multiplicity.
+                 */
+                Multiplicity getMultiplicity() {return multiplicity;}
+
+                /**
+                 * Set the interface required by this reference.
+                 * @param iface The interface.
+                 */
+                void setInterface(Interface* iface);
+
+                /**
+                 * Get the interface.
+                 * @return The interface.
+                 */
+                Interface* getInterface() {return iface;}
+
+                /**
+                 * Add a target for a reference. There may be more than
+                 * one if the multiplicity is 0..n or 1..n.
+                 * @param target The target for a wire.
+                 */
+                void addTarget(WireTarget* target);
+                typedef vector<WireTarget*> TARGETS;
+
+                /**
+                 * Get a vector of all the targets from this reference.
+                 * @return The targets of this reference.
+                 */
+                const TARGETS& getTargets() {return targets;}
+            private:
+                /**
+                 * Name of this reference.
+                 */
+                string name;            
+                
+                /**
+                 * The interface defining this reference.
+                 */
+                Interface* iface;
+
+                /**
+                 * The multiplicity of this reference.
+                 */
+                Multiplicity multiplicity;
+
+                /**
+                 * Vector of all the targets wired from this reference.
+                 */
+                TARGETS targets;
+             };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_servicereference_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,122 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/Subsystem.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            
+            // Constructor
+            Subsystem::Subsystem(const std::string& subsystemName) : name(subsystemName)
+            {
+                LOGENTRY(1, "Subsystem::constructor");
+                
+                
+                LOGEXIT(1, "Subsystem::constructor");
+            }
+            
+            Subsystem::~Subsystem()
+            {
+            }
+
+            ///
+            /// Add a new module component
+            ///
+            Module* Subsystem::addModuleComponent(const std::string& name, const std::string& moduleName)
+            {
+                LOGENTRY(1, "Subsystem::addModuleComponent");
+                
+                Module* newModule = new Module(moduleName);
+                
+                // TODO: Should check for duplicates and throw exception
+                moduleComponents[name] = newModule;
+                
+                LOGEXIT(1, "Subsystem::addModuleComponent");
+                
+                return newModule;
+            }
+            
+            Module* Subsystem::findModule(const std::string& moduleName)
+            {
+                for (MODULECOMPONENT_MAP::iterator moduleComponentIter = moduleComponents.begin();
+                moduleComponentIter != moduleComponents.end();
+                moduleComponentIter++)
+                {
+                    if (moduleName == moduleComponentIter->second->getName())
+                    {
+                        return (Module*)moduleComponentIter->second;
+                    } 
+                }
+                return 0;
+            }
+            
+            Module* Subsystem::findModuleByComponentName(const std::string& moduleComponentName)
+            {
+                return moduleComponents[moduleComponentName];
+            }
+            
+            Module* Subsystem::getDefaultModule()
+            {
+                if (moduleComponents.size() == 1)
+                {
+                    MODULECOMPONENT_MAP::iterator moduleComponentIter = moduleComponents.begin();
+                    return moduleComponentIter->second;
+                }
+                return 0;
+            }
+            
+            ///
+            /// Add a new entrypoint 
+            ///
+            EntryPoint* Subsystem::addEntryPoint(const std::string& name)
+            {
+                LOGENTRY(1, "Subsystem::addEntryPoint");
+                
+                EntryPoint* newEntryPoint = new EntryPoint(name);
+                entryPoints[name] = newEntryPoint;
+                LOGEXIT(1, "Subsystem::addEntryPoint");
+                return findEntryPoint(name);
+           }
+            
+            EntryPoint* Subsystem::findEntryPoint(const std::string& name)
+            {
+                return entryPoints[name];
+            }
+
+            void Subsystem::resolveWires()
+            {
+                for (MODULECOMPONENT_MAP::iterator moduleComponentIter = moduleComponents.begin();
+                moduleComponentIter != moduleComponents.end();
+                moduleComponentIter++)
+                {
+                    moduleComponentIter->second->resolveWires();
+                }
+
+                // Resolve EntryPoint wires
+            }
+
+        } // End namespace model
+        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,131 @@
+/*
+ *
+ *  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_model_h
+#define tuscany_sca_model_h
+
+#include <string>
+using std::string;
+#include <map>
+using std::map;
+
+#include "tuscany/sca/model/Module.h"
+#include "tuscany/sca/model/EntryPoint.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Information about a subsystem.
+             */
+            class Subsystem {
+            public:
+                /**
+                 * Constructor.
+                 * @param name The name of the subsystem.
+                 */
+                Subsystem(const std::string& name);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~Subsystem();
+
+                /**
+                 * Add a new module component to the subsystem.
+                 * @param name The name of the module component.
+                 * @param moduleName The name of the module.
+                 * @return The new Module added to the subsystem.
+                 */
+                Module* addModuleComponent(const std::string& name, const std::string& moduleName);
+
+                /**
+                 * Find a module by module name.
+                 * @param moduleName The name of the module to be found.
+                 * @return The Module that was found, or 0 if not found.
+                 */
+                Module* findModule(const std::string& moduleName);
+
+                /**
+                 * Find a module by the module component name.
+                 * @param moduleComponentName The module component name to be used to find
+                 * the module.
+                 * @return The Module that was found, or 0 if not found.
+                 */
+                Module* findModuleByComponentName(const std::string& moduleComponentName);
+
+                /**
+                 * Get the default module set for this subsystem.
+                 * @return The default module.
+                 */
+                Module* getDefaultModule();
+                
+                /**
+                 * Add an new entry point to the subsystem.
+                 * @param name The name of the entry point.
+                 * @return The new EntryPoint added to the subsystem.
+                 */
+                EntryPoint* addEntryPoint(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.
+                 */
+                EntryPoint* findEntryPoint(const std::string& name);
+
+                /**
+                 * Return the name of the subsystem.
+                 * @return The name.
+                 */
+                const std::string& getName() {return name;}
+
+                /**
+                 * Resolve all the wires configured in all the modules in this
+                 * subsystem.
+                 */
+                void resolveWires();
+  
+            private:    
+                /**
+                 * The name of the subsystem.
+                 */
+                std::string name;
+
+                typedef std::map<std::string, Module*> MODULECOMPONENT_MAP;
+                /**
+                 * A map by module component name of modules.
+                 */
+                MODULECOMPONENT_MAP moduleComponents; 
+
+                typedef map<string, EntryPoint*> ENTRYPOINT_MAP;
+                /**
+                 * A map of entry points defined in this subsystem.
+                 */
+                ENTRYPOINT_MAP entryPoints;
+            };
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,118 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/System.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            
+            // ============
+            // Constructor
+            // ============
+            System::System()
+            {
+                LOGENTRY(1, "System::constructor");
+                
+                
+                LOGEXIT(1, "System::constructor");
+            }
+            
+            System::~System()
+            {
+                SUBSYSTEM_MAP::iterator subsystemsIter;
+                for (subsystemsIter = subsystemMap.begin();
+                subsystemsIter != subsystemMap.end(); 
+                subsystemsIter++ ) 
+                {                    
+                    delete subsystemsIter->second;
+                }                
+            }
+            
+            // =================================
+            // Add a new subsystem to the system
+            // =================================
+            Subsystem* System::addSubsystem(const std::string& name)
+            {
+                LOGENTRY(1, "System::addSubsystem");
+                
+                Subsystem* newSubsystem = new Subsystem(name);
+                
+                subsystemMap[name] = newSubsystem;
+                
+                LOGEXIT(1, "System::addSubsystem");
+                
+                return newSubsystem;
+            }
+            
+            // ====================================================================
+            // Get a map of all the moduleComponents that use a particular module
+            // ====================================================================
+            MODULE_LIST System::findModules(const std::string& name)
+            {
+                LOGENTRY(1, "System::findModules");
+                MODULE_LIST foundModules;
+                
+                SUBSYSTEM_MAP::iterator subsystemsIter;
+                for (subsystemsIter = subsystemMap.begin(); 
+                subsystemsIter != subsystemMap.end(); subsystemsIter++ ) {
+                    LOGINFO_1(2, "System::findModules: Found subsystem: %s", subsystemsIter->second->getName().c_str());
+                    // In each subsystem, find module components with this module defined
+                    
+                    Module* module = subsystemsIter->second->findModule(name);
+                    if (module)
+                    {
+                        LOGINFO_1(2, "System::findModules: Found module: %s", module->getName().c_str());
+                        foundModules.push_back(module);
+                    }
+                }   
+                LOGEXIT(1, "System::findModules");
+                
+                return foundModules;
+            }
+
+            
+            // ====================================================================
+            // Get a map of all the moduleComponents that use a particular module
+            // ====================================================================
+            Subsystem* System::findSubsystem(const std::string& subsystem)
+            {
+                return subsystemMap[subsystem];
+            }
+            
+            void System::resolveWires()
+            {
+                SUBSYSTEM_MAP::iterator subsystemsIter;
+                for (subsystemsIter = subsystemMap.begin();
+                subsystemsIter != subsystemMap.end(); 
+                subsystemsIter++ ) 
+                {                    
+                    subsystemsIter->second->resolveWires();
+                }                
+            }
+
+     } // End namespace model
+        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,89 @@
+/*
+ *
+ *  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_model_system_h
+#define tuscany_sca_model_system_h
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "tuscany/sca/model/Subsystem.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            typedef std::vector<Module*> MODULE_LIST;
+
+            /**
+             * The root of the runtime model supported by a Tuscany runtime.
+             */
+            class System {
+            public:
+                System();
+                virtual ~System();
+
+                /**
+                 * Add a new subsystem to the system.
+                 * @param subsystemName The name of the new subsystem to add.
+                 * @return The new Subsystem added to the system.
+                 */
+                Subsystem* addSubsystem(const std::string& subsystemName);
+
+                /**
+                 * Find subsystem by name.
+                 * @param subsystemName The name of the subsystem to be found.
+                 * @return The Subsystem found, or 0 if not found.
+                 */
+                Subsystem* findSubsystem(const std::string& subsystemName);
+
+                typedef std::vector<Module*> MODULE_LIST;
+
+                /**
+                 * Return a vector of all the modules with a given module name.
+                 * @param moduleName The name of the module to find
+                 * @return A vector of all the times the module appears in the 
+                 * system. It can be more than once because the same module name
+                 * is used by more than one module component.
+                 */
+                MODULE_LIST findModules(const std::string& moduleName);
+
+                /**
+                 * Resolve all the wires defined in the system.
+                 */
+                void resolveWires();
+ 
+            private:
+
+                typedef std::map<std::string, Subsystem*>    SUBSYSTEM_MAP;
+
+                /**
+                 * Map by name of subsystems.
+                 */
+                SUBSYSTEM_MAP subsystemMap;
+           };
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_system_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,127 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/WSBinding.h"
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+
+        namespace model
+        {
+
+            // Constructor
+            WSBinding::WSBinding(const string& uri,    const string& port)
+                : Binding(uri), port(port)
+            {
+
+                // Port is of the form: <wsdl-namepace-uri>#wsdl.endpoint(<service-name>/<port-name>)
+                string::size_type hash = port.find("#");
+                if (hash != string::npos)
+                {
+                    // Found a hash
+
+                    // Namepace is the part before the #
+                    wsdlNamespaceURL = port.substr(0, hash);
+
+                    
+                    if ( (hash+1) < port.length())
+                    {
+                        // Check the next part is wsdl.endpoint( 
+                        int ending = hash+15;
+                        string check = port.substr(hash+1, 14);
+                        if (check.compare("wsdl.endpoint(") == 0)
+                        {
+                            // Find the matching )
+                            int endBracket = port.find(")",ending);
+                            if (endBracket-1 > ending+1)
+                            {
+                                string serviceAndPort = port.substr(ending, endBracket-ending);
+                                // Look for a '/'
+                                string::size_type slash = serviceAndPort.find("/");
+                                if (slash != string::npos)
+                                {
+                                    serviceName = serviceAndPort.substr(0, slash);
+
+                                    if ( (slash+1) < serviceAndPort.length())
+                                    {
+                                        portName = serviceAndPort.substr(slash+1);
+                                    }
+                                    else
+                                    {
+                                        portName = "";
+                                    }
+
+                                }
+                                else
+                                {
+                                    // No '/' so all of it is the service name
+                                    serviceName = serviceAndPort;
+                                    portName = "";
+
+                                }
+                            }
+                            else
+                            {
+                                // Nothing between the ()
+                                serviceName = "";
+                                portName = "";
+                            }
+                        }
+                        else
+                        {
+                            // not the correct characters after the #, ignore the rest
+                            serviceName = "";
+                            portName = "";
+                        }
+                        
+                    }
+                    else
+                    {
+                        // Nothing after the hash
+                        serviceName = "";
+                        portName = "";
+                    }
+                }
+                else
+                {
+                    // No hash at all
+                    wsdlNamespaceURL = port;
+                    serviceName = "";
+                    portName = "";
+                }
+
+
+
+                
+
+
+            }
+
+            WSBinding::~WSBinding()
+            {
+            }
+
+        } // End namespace model
+
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,106 @@
+/*
+ *
+ *  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_model_wsbinding_h
+#define tuscany_sca_model_wsbinding_h
+
+#include "tuscany/sca/model/Binding.h"
+
+#include <string>
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Information about a web service binding for an entry point or an
+             * external service.
+             */
+            class WSBinding : public Binding
+            {    
+            public:
+                /**
+                 * Constructor.
+                 * @param uri The uri of the binding.
+                 * @param port The definition of the port to which the entrypoint
+                 * or external service is to be bound. This is of the form
+                 * "namespace"#endpoint("service"/"port")
+                 */
+                WSBinding(const string&uri, const string& port);  
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~WSBinding();
+                            
+                /**
+                 * Return the type of the binding.
+                 * @return Always returns WS.
+                 */
+                virtual Type getBindingType() {return WS;};
+
+                /**
+                 * Return the part of the port definition describing the wsdl 
+                 * namespace.
+                 * @return The wsdl namespace.
+                 */
+                string getWSDLNamespaceURL() {return wsdlNamespaceURL;};
+
+                /**
+                 * Return the service part of the port definition.
+                 * @return The service to use.
+                 */
+                string getServiceName() {return serviceName;};
+
+                /**
+                 * Return the port name part of the port definition.
+                 * @return The port name to use.
+                 */
+                string getPortName() {return portName;};
+                
+            private:
+                /**
+                 * The full port string.
+                 */
+                string port;
+
+                /**
+                 * Namespace from the port.
+                 */
+                string wsdlNamespaceURL;
+
+                /**
+                 * Service name from the port.
+                 */
+                string serviceName;
+
+                /**
+                 * Port name from the port.
+                 */
+                string portName;
+            };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_wsbinding_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,46 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/model/Wire.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            
+            // Constructor
+            Wire::Wire(const std::string& source, const std::string& targ) 
+            {
+                Utils::tokeniseUri(source, sourceComponent, sourceReference);
+                target = targ;
+           }
+            
+            Wire::~Wire()
+            {
+            }
+
+        } // End namespace model
+        
+        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,91 @@
+/*
+ *
+ *  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_model_wire_h
+#define tuscany_sca_model_wire_h
+
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Information about a wire in the model.
+             */
+            class Wire
+            {
+            public: 
+                /**
+                 * Constructor.
+                 * @param source The source of the wire. Either the component and 
+                 * reference name (optional) or an entry point.
+                 * @param target The target of the wire. Either a component and service
+                 * service name (optional) or an external sevice.
+                 */
+                Wire(const std::string& source, const std::string& target);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~Wire();
+
+                /**
+                 * Get the component name defined by the source of the wire.
+                 * @return The component name which is the source of the wire.
+                 */
+                const std::string& getSourceComponent() {return sourceComponent;}
+
+                /**
+                 * Get the reference name defined by the source of the wire.
+                 * @return The reference name which is the source of the wire.
+                 */
+                const std::string& getSourceReference() {return sourceReference;}
+
+                /**
+                 * Get the target uri defined by the target of the wire.
+                 * @return The target uri which is the source of the wire.
+                 */
+                const std::string& getTarget() {return target;}
+             private:
+                /**
+                 * The source component of the wire.
+                 */
+                string sourceComponent;
+
+                /**
+                 * The source reference of the wire.
+                 */
+                string sourceReference;
+
+                /**
+                 * The target uri of the wire.
+                 */
+                 string target;
+            };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_wire_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,49 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/model/WireTarget.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            
+            // Constructor
+            WireTarget::WireTarget(const std::string& targetName) 
+                : name(targetName)
+            {
+            }
+            
+            WireTarget::~WireTarget()
+            {
+            }
+
+            void WireTarget::setInterface(Interface* interf)
+            {
+                iface = interf;
+            }
+
+        } // End namespace model
+        
+        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h Thu Jan  5 02:54:16 2006
@@ -0,0 +1,106 @@
+/*
+ *
+ *  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_model_wiretarget_h
+#define tuscany_sca_model_wiretarget_h
+
+#include <string>
+using std::string;
+
+#include "tuscany/sca/model/Interface.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            /**
+             * Represents the target of a wire. This could be a service on a 
+             * component or an external service.
+             */
+            class WireTarget
+            {
+            public:
+                /**
+                 * Supported types of wire target.
+                 */
+                enum Type
+                {
+                    ComponentServiceType,
+                    ExternalServiceType
+                };
+                
+                /**
+                 * Constructor.
+                 * @param name The name of the wire target.
+                 */
+                WireTarget(const std::string& name);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~WireTarget();
+                
+                /**
+                 * Return the name of the wire target.
+                 */
+                string getName() {return name;}
+                
+                /**
+                 * Get the type of the wire target. 
+                 * @return Depends on the type of the wire target.
+                 */
+                virtual Type getServiceType() = 0;
+
+                /**
+                 * Set the interface describing the wire target.
+                 * @param iface The interface.
+                 */
+                void setInterface(Interface* iface);
+
+                /**
+                 * Get the interface describing the wire target.
+                 * @return The interface.
+                 */
+                Interface* getInterface() {return iface;}
+                
+            private:
+                /**
+                 * Name of the wire target (service name or external service name)
+                 */
+                string name;
+
+                /**
+                 * Type of the service.
+                 */
+                Type serviceType;
+
+                /**
+                 * Interface describing the wire target.
+                 */
+                Interface* iface;
+            };
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_model_wiretarget_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp?rev=366157&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp Thu Jan  5 02:54:16 2006
@@ -0,0 +1,345 @@
+/*
+ *
+ *  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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/model/Wsdl.h"
+#include "tuscany/sca/util/Exceptions.h"
+
+using namespace tuscany::sca;
+
+using namespace commonj::sdo;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace model
+        {
+            
+            
+            // Constructor
+            Wsdl::Wsdl(DataObjectPtr wsdlModel) 
+                : wsdlModel(wsdlModel)
+            {
+                LOGENTRY(1, "Wsdl::constructor");
+
+                // Trace
+                Utils::printDO(wsdlModel);
+
+
+                
+                LOGEXIT(1, "Wsdl::constructor");
+            }
+
+            Wsdl::~Wsdl()
+            {
+            }
+
+
+            /// 
+            /// The namespace of the service and other definitions defined in this wsdl definition
+            string Wsdl::getNamespace()
+            {
+
+                return wsdlModel->getCString("targetNamespace");
+
+            }
+
+            ///
+            /// Find the operation defined in this wsdl
+            ///
+            WsdlOperation Wsdl::findOperation(const string& serviceName, 
+                                        const string& portName, 
+                                        const string& operationName)
+            {
+                string message;
+                
+                // Find the service
+                DataObjectPtr service = findService(serviceName);
+                if (!service)
+                {
+                    // Service not found
+                    message = "Unable to find service ";
+                    message = message + serviceName;
+                    message = message + " in the WSDL definition";
+                    throw SystemConfigurationException(message.c_str());
+                }
+                else
+                {
+                    
+                    
+                    // Found the service
+                    DataObjectList& portList = service->getList("port");
+                    for (int j=0; j<portList.size();j++)
+                    {
+                        string portListName(portList[j]->getCString("name"));
+                        if (portListName.compare(portName) == 0)
+                        {
+                            
+                            // found port
+                            // Add address at this point
+                            string targetAddress(portList[j]->getCString("address/location"));
+                            
+                            // find operation by traversing the binding, portType then operation
+                            string wsBindingName(portList[j]->getCString("binding"));
+                            
+                            DataObjectPtr wsBinding = findBinding(wsBindingName);
+                            if (!wsBinding)
+                            {
+                                message = "Unable to find binding ";
+                                message = message + wsBindingName;
+                                message = message + " in the WSDL definition";
+                                throw SystemConfigurationException(message.c_str());
+                            }
+
+                            // Get the soapAction
+                            string soapAction = getSoapAction(wsBinding, operationName);
+                            
+                            
+                            // Found the binding, get the portType
+                            string wsPortTypeName(wsBinding->getCString("type"));
+                            DataObjectPtr wsPortType = findPortType(wsPortTypeName);
+                            if (!wsPortType)
+                            {
+                                message = "Unable to find PortType ";
+                                message = message + wsPortTypeName;
+                                message = message + " in the WSDL definition";
+                                throw SystemConfigurationException(message.c_str());
+                            }
+
+                            Utils::printDO(wsPortType);
+                            
+                            // Found the portType, find the operation
+                            DataObjectList& operationList = wsPortType->getList("operation");
+                            for (int k=0; k< operationList.size(); k++)
+                            {
+                                string opName(operationList[k]->getCString("name"));
+                                if( opName.compare(operationName) == 0)
+                                {
+                                    // Found the operation
+
+                                    // Find the type of the request message
+                                    string inputMessageType =  string(operationList[k]->getCString("input/message"));
+
+                                    DataObjectPtr wsMessageIn = findMessage(inputMessageType);
+                                    if (!wsMessageIn)
+                                    {
+                                        message = "Unable to find message ";
+                                        message = message + inputMessageType;
+                                        message = message + " in the WSDL definition";
+                                        throw SystemConfigurationException(message.c_str());
+                                    }
+
+                                    string requestType(wsMessageIn->getList("part")[0]->getCString("element"));
+                                    string requestTypeName;
+                                    string requestTypeUri;
+                                    // Utils::tokeniseQName(requestType, requestTypeUri, requestTypeName); 
+                                    Utils::rTokeniseString(":", requestType, requestTypeUri, requestTypeName); 
+
+                                    // Find the type of the response message
+                                    string outputMessageType =  string(operationList[k]->getCString("output/message"));
+
+                                    DataObjectPtr wsMessageOut = findMessage(outputMessageType);
+                                    if (!wsMessageOut)
+                                    {
+                                        message = "Unable to find message ";
+                                        message = message + outputMessageType;
+                                        message = message + " in the WSDL definition";
+                                        throw SystemConfigurationException(message.c_str());
+                                    }
+
+                                    string responseType(wsMessageOut->getList("part")[0]->getCString("element"));
+                                    string responseTypeName;
+                                    string responseTypeUri;
+                                    // Utils::tokeniseQName(responseType, responseTypeUri, responseTypeName); 
+                                    Utils::rTokeniseString(":", responseType, responseTypeUri, responseTypeName);
+
+                                    return WsdlOperation(requestTypeName, 
+                                        soapAction, 
+                                        targetAddress, 
+                                        responseTypeName);
+                                }
+                                
+                            }
+                            
+                            message = "Unable to find Operation ";
+                            message = message + operationName;
+                            message = message + " in the WSDL definition";
+                            throw SystemConfigurationException(message.c_str());
+                            
+                            
+                            
+                            
+                        }
+                        
+                        
+                        
+                        
+                    }
+                    // cannot find the port
+                    message = "Unable to find port ";
+                    message = message + portName;
+                    message = message + " in the WSDL definition";
+                    throw SystemConfigurationException(message.c_str());
+                }
+                
+            }
+            
+        
+
+            ///
+            /// Find a service
+            ///
+            DataObjectPtr Wsdl::findService(const string& serviceName)
+            {
+                DataObjectPtr service = 0;
+        
+
+                // Find the binding
+                DataObjectList& serviceList = wsdlModel->getList("service");
+                for (int i=0; i<serviceList.size(); i++)
+                {
+                    string name(serviceList[i]->getCString("name"));
+
+                    if (name.compare(serviceName) == 0)
+                    {
+                        return serviceList[i];
+                    }
+                }
+
+                return service;
+            }
+
+
+            ///
+            /// Find a named binding
+            ///
+            DataObjectPtr Wsdl::findBinding(const string& bindingName)
+            {
+                DataObjectPtr binding = 0;
+                string uri;
+                string name;
+
+
+                //Utils::tokeniseQName(bindingName, uri, name);
+                Utils::rTokeniseString(":", bindingName, uri, name);
+
+
+                // Find the binding
+                DataObjectList& bindingList = wsdlModel->getList("binding");
+                for (int i=0; i<bindingList.size(); i++)
+                {
+                    string nameBinding(bindingList[i]->getCString("name"));
+
+                    if (nameBinding.compare(name) == 0)
+                    {
+                        return bindingList[i];
+                    }
+                }
+
+                return binding;
+            }
+
+            ///
+            /// Find a named portType
+            ///
+            DataObjectPtr Wsdl::findPortType(const string& portTypeName)
+            {
+                DataObjectPtr portType = 0;
+                string uri;
+                string name;
+
+
+                // Utils::tokeniseQName(portTypeName, uri, name);
+                Utils::rTokeniseString(":", portTypeName, uri, name);
+
+
+                // Find the binding
+                DataObjectList& portTypeList = wsdlModel->getList("portType");
+                for (int i=0; i<portTypeList.size(); i++)
+                {
+                    string namePortType(portTypeList[i]->getCString("name"));
+
+                    if (namePortType.compare(name) == 0)
+                    {
+                        return portTypeList[i];
+                    }
+                }
+
+                return portType;
+            }
+
+            ///
+            /// Find a named message
+            ///
+            DataObjectPtr Wsdl::findMessage(const string& messageName)
+            {
+                DataObjectPtr message = 0;
+                string uri;
+                string name;
+
+
+                // Utils::tokeniseQName(messageName, uri, name);
+                Utils::rTokeniseString(":", messageName, uri, name);
+
+
+                // Find the binding
+                DataObjectList& messageList = wsdlModel->getList("message");
+                for (int i=0; i<messageList.size(); i++)
+                {
+                    string nameMessage(messageList[i]->getCString("name"));
+
+                    if (nameMessage.compare(name) == 0)
+                    {
+                        return messageList[i];
+                    }
+                }
+
+                return message;
+            }
+
+            ///
+            /// Get the soap action
+            ///
+            string Wsdl::getSoapAction(DataObjectPtr binding, const string& operationName)
+            {
+                
+        
+                // Find the binding operation
+                DataObjectList& bindingOperationList = binding->getList("operation");
+                for (int i=0; i<bindingOperationList.size(); i++)
+                {
+                    string name(bindingOperationList[i]->getCString("name"));
+
+                    if (name.compare(operationName) == 0)
+                    {
+                        // Found the binding operation, return the soap action
+                        string soapAction(bindingOperationList[i]->getCString("operation/soapAction"));
+                        return soapAction;
+                    }
+                }
+
+                return string("");
+            }
+
+            
+        } // End namespace model
+    } // End namespace sca
+} // End namespace tuscany



Mime
View raw message