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/29 11:04:46 UTC
svn commit: r438022 [1/2] - in /incubator/tuscany/cpp/sca/runtime: ./ core/
core/src/ core/src/tuscany/sca/core/ core/src/tuscany/sca/extension/
core/src/tuscany/sca/model/ core/src/tuscany/sca/ws/ core/test/src/
extensions/ extensions/cpp/src/ extensi...
Author: jsdelfino
Date: Tue Aug 29 02:04:43 2006
New Revision: 438022
URL: http://svn.apache.org/viewvc?rev=438022&view=rev
Log:
Repackaged WS reference and WS service support as extensions
Added:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp (with props)
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h (with props)
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp (with props)
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/sca-binding-webservice.xsd (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/Axis2Service_skeleton.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/Axis2Utils.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/Axis2Utils.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/WSReferenceBindingExtension.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/WSReferenceBindingExtension.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/WSServiceProxy.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/WSServiceProxy.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/model/
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/model/WSReferenceBinding.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/model/WSReferenceBinding.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/xsd/ (with props)
incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/xsd/sca-binding-webservice.xsd (with props)
Removed:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/
incubator/tuscany/cpp/sca/runtime/ws_reference/
incubator/tuscany/cpp/sca/runtime/ws_service/
Modified:
incubator/tuscany/cpp/sca/runtime/Makefile.am
incubator/tuscany/cpp/sca/runtime/core/Makefile.am
incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
incubator/tuscany/cpp/sca/runtime/core/test/src/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/Makefile.am
Modified: incubator/tuscany/cpp/sca/runtime/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/Makefile.am?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/Makefile.am Tue Aug 29 02:04:43 2006
@@ -1 +1 @@
-SUBDIRS = ws_reference core extensions ws_service
+SUBDIRS = core extensions
Modified: incubator/tuscany/cpp/sca/runtime/core/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/Makefile.am?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/core/Makefile.am Tue Aug 29 02:04:43 2006
@@ -1 +1 @@
-SUBDIRS = src test
+SUBDIRS = src
Modified: incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am Tue Aug 29 02:04:43 2006
@@ -6,7 +6,6 @@
tuscany/sca/model/*.h \
tuscany/sca/util/*.h \
tuscany/sca/cpp/*.h \
-tuscany/sca/ws/*.h \
tuscany/sca/extension/*.h
## To list the source files execute the following:
@@ -28,6 +27,8 @@
tuscany/sca/core/TuscanyRuntime.cpp \
tuscany/sca/extension/ImplementationExtension.cpp \
tuscany/sca/extension/InterfaceExtension.cpp \
+tuscany/sca/extension/ReferenceBindingExtension.cpp \
+tuscany/sca/extension/ServiceBindingExtension.cpp \
tuscany/sca/model/Binding.cpp \
tuscany/sca/model/Component.cpp \
tuscany/sca/model/ComponentType.cpp \
@@ -52,16 +53,12 @@
tuscany/sca/util/Library.cpp \
tuscany/sca/util/Logger.cpp \
tuscany/sca/util/LogWriter.cpp \
-tuscany/sca/util/Utils.cpp \
-tuscany/sca/ws/WSReferenceBinding.cpp \
-tuscany/sca/ws/WSServiceBinding.cpp \
-tuscany/sca/ws/WSServiceProxy.cpp
+tuscany/sca/util/Utils.cpp
-libtuscany_sca_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \
- -L$(top_builddir)/runtime/ws_reference/axis2c/src -ltuscany_sca_ws_reference
-
-AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG
+libtuscany_sca_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo
INCLUDES = -I$(top_builddir)/runtime/core/src \
-I${TUSCANY_SDOCPP}/include
-
+
+AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG
+
\ No newline at end of file
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp Tue Aug 29 02:04:43 2006
@@ -267,6 +267,52 @@
return implementationExtensions[extensionTypeQName];
}
+ // ======================================
+ // register a referenceBindingExtension
+ // ======================================
+ void SCARuntime::registerReferenceBindingExtension(ReferenceBindingExtension* extension)
+ {
+ LOGENTRY(1, "SCARuntime::registerReferenceBindingExtension");
+ if (extension)
+ {
+ cout << "register ref ext" << extension->getExtensionTypeQName();
+ referenceBindingExtensions[extension->getExtensionTypeQName()] = extension;
+ }
+ LOGEXIT(1, "SCARuntime::registerReferenceBindingExtension");
+ }
+
+ // ======================================
+ // find a referenceBindingExtension
+ // ======================================
+ ReferenceBindingExtension* SCARuntime::getReferenceBindingExtension(const string& extensionTypeQName)
+ {
+ cout << "get ref ext" << extensionTypeQName;
+ return referenceBindingExtensions[extensionTypeQName];
+ }
+
+ // ======================================
+ // register a serviceBindingExtension
+ // ======================================
+ void SCARuntime::registerServiceBindingExtension(ServiceBindingExtension* extension)
+ {
+ LOGENTRY(1, "SCARuntime::registerServiceBindingExtension");
+ if (extension)
+ {
+ cout << "register service ext" << extension->getExtensionTypeQName();
+ serviceBindingExtensions[extension->getExtensionTypeQName()] = extension;
+ }
+ LOGEXIT(1, "SCARuntime::registerServiceBindingExtension");
+ }
+
+ // ======================================
+ // find a serviceBindingExtension
+ // ======================================
+ ServiceBindingExtension* SCARuntime::getServiceBindingExtension(const string& extensionTypeQName)
+ {
+ cout << "get service ext" << extensionTypeQName;
+ return serviceBindingExtensions[extensionTypeQName];
+ }
+
// ===================================
// Return the top of the runtime model
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h Tue Aug 29 02:04:43 2006
@@ -24,6 +24,8 @@
#include "tuscany/sca/extension/InterfaceExtension.h"
#include "tuscany/sca/extension/ImplementationExtension.h"
+#include "tuscany/sca/extension/ReferenceBindingExtension.h"
+#include "tuscany/sca/extension/ServiceBindingExtension.h"
#include "tuscany/sca/model/Composite.h"
#include "tuscany/sca/model/Component.h"
#include "tuscany/sca/util/Library.h"
@@ -136,6 +138,28 @@
SCA_API ImplementationExtension* getImplementationExtension(const string& typeQname);
/**
+ * Register a reference binding extension
+ */
+ SCA_API void registerReferenceBindingExtension(ReferenceBindingExtension* extension);
+
+ /**
+ * Returns the reference binding extension associated with
+ * the specified qname
+ */
+ SCA_API ReferenceBindingExtension* getReferenceBindingExtension(const string& typeQname);
+
+ /**
+ * Register a service binding extension
+ */
+ SCA_API void registerServiceBindingExtension(ServiceBindingExtension* extension);
+
+ /**
+ * Returns the service binding extension associated with
+ * the specified qname
+ */
+ SCA_API ServiceBindingExtension* getServiceBindingExtension(const string& typeQname);
+
+ /**
* Register an interface extension
*/
SCA_API void registerInterfaceExtension(InterfaceExtension* extension);
@@ -200,6 +224,12 @@
typedef map<string, ImplementationExtension*> IMPLEMENTATION_EXTENSIONS_MAP;
IMPLEMENTATION_EXTENSIONS_MAP implementationExtensions;
+ typedef map<string, ReferenceBindingExtension*> REFERENCE_BINDING_EXTENSIONS_MAP;
+ REFERENCE_BINDING_EXTENSIONS_MAP referenceBindingExtensions;
+
+ typedef map<string, ServiceBindingExtension*> SERVICE_BINDING_EXTENSIONS_MAP;
+ SERVICE_BINDING_EXTENSIONS_MAP serviceBindingExtensions;
+
typedef map<string, InterfaceExtension*> INTERFACE_EXTENSIONS_MAP;
INTERFACE_EXTENSIONS_MAP interfaceExtensions;
@@ -217,4 +247,3 @@
typedef void (* TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE) ();
#endif // tuscany_sca_core_scaruntime_h
-
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp Tue Aug 29 02:04:43 2006
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "tuscany/sca/extension/ReferenceBindingExtension.h"
+#include "tuscany/sca/util/Logging.h"
+namespace tuscany
+{
+ namespace sca
+ {
+ // ===================================================================
+ // Constructor for the ReferenceBindingExtension class.
+ // ===================================================================
+ ReferenceBindingExtension::ReferenceBindingExtension()
+ {
+ LOGENTRY(1, "ReferenceBindingExtension::constructor");
+ LOGEXIT(1, "ReferenceBindingExtension::constructor");
+ }
+
+ // ===================================================================
+ // Destructor for the ReferenceBindingExtension class.
+ // ===================================================================
+ ReferenceBindingExtension::~ReferenceBindingExtension()
+ {
+ LOGENTRY(1, "ReferenceBindingExtension::destructor");;
+ LOGEXIT(1, "ReferenceBindingExtension::destructor");
+ }
+
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h Tue Aug 29 02:04:43 2006
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef tuscany_sca_extension_referencebindingextension_h
+#define tuscany_sca_extension_referencebindingextension_h
+
+#include "osoa/sca/export.h"
+#include <string>
+using std::string;
+
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/Reference.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/ReferenceBinding.h"
+
+#include "commonj/sdo/SDO.h"
+
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ class SCA_API ReferenceBindingExtension
+ {
+ public:
+ /**
+ * Default constructor
+ */
+ ReferenceBindingExtension();
+
+ /**
+ * Destructor
+ */
+ virtual ~ReferenceBindingExtension();
+
+ /**
+ * return the name of the extension (e.g. "cpp" "php")
+ */
+ virtual const string& getExtensionName() = 0;
+
+ /**
+ * return the QName of schema elemant for this binding extension
+ * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws")
+ */
+ virtual const string& getExtensionTypeQName() = 0;
+
+ /**
+ * Get a reference binding from a DataObject representing
+ * an SCDL binding element
+ */
+ virtual ReferenceBinding* getReferenceBinding(Composite* composite, Reference* reference, commonj::sdo::DataObjectPtr scdlBinding) = 0;
+
+ };
+
+
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_referencebindingextension_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp Tue Aug 29 02:04:43 2006
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "tuscany/sca/extension/ServiceBindingExtension.h"
+#include "tuscany/sca/util/Logging.h"
+namespace tuscany
+{
+ namespace sca
+ {
+ // ===================================================================
+ // Constructor for the ServiceBindingExtension class.
+ // ===================================================================
+ ServiceBindingExtension::ServiceBindingExtension()
+ {
+ LOGENTRY(1, "ServiceBindingExtension::constructor");
+ LOGEXIT(1, "ServiceBindingExtension::constructor");
+ }
+
+ // ===================================================================
+ // Destructor for the ServiceBindingExtension class.
+ // ===================================================================
+ ServiceBindingExtension::~ServiceBindingExtension()
+ {
+ LOGENTRY(1, "ServiceBindingExtension::destructor");;
+ LOGEXIT(1, "ServiceBindingExtension::destructor");
+ }
+
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h Tue Aug 29 02:04:43 2006
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef tuscany_sca_extension_servicebindingextension_h
+#define tuscany_sca_extension_servicebindingextension_h
+
+#include "osoa/sca/export.h"
+#include <string>
+using std::string;
+
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/Service.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/ServiceBinding.h"
+
+#include "commonj/sdo/SDO.h"
+
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ class SCA_API ServiceBindingExtension
+ {
+ public:
+ /**
+ * Default constructor
+ */
+ ServiceBindingExtension();
+
+ /**
+ * Destructor
+ */
+ virtual ~ServiceBindingExtension();
+
+ /**
+ * return the name of the extension (e.g. "cpp" "php")
+ */
+ virtual const string& getExtensionName() = 0;
+
+ /**
+ * return the QName of schema elemant for this binding extension
+ * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws")
+ */
+ virtual const string& getExtensionTypeQName() = 0;
+
+ /**
+ * Get a reference binding from a DataObject representing
+ * an SCDL binding element
+ */
+ virtual ServiceBinding* getServiceBinding(Composite* composite, Service* service, commonj::sdo::DataObjectPtr scdlBinding) = 0;
+
+ };
+
+
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_servicebindingextension_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
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=438022&r1=438021&r2=438022&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 Tue Aug 29 02:04:43 2006
@@ -31,17 +31,12 @@
#include "tuscany/sca/model/ServiceType.h"
#include "tuscany/sca/model/ReferenceType.h"
#include "tuscany/sca/core/SCARuntime.h"
-#include "tuscany/sca/ws/WSServiceBinding.h"
-#include "tuscany/sca/ws/WSReferenceBinding.h"
#include "commonj/sdo/TypeDefinitions.h"
#include "tuscany/sca/util/File.h"
using namespace commonj::sdo;
-using tuscany::sca::ws::WSServiceBinding;
-using tuscany::sca::ws::WSReferenceBinding;
-
namespace tuscany
{
@@ -342,8 +337,8 @@
ComponentType* componentType;
string componentTypeName;
string componentTypePath;
- string implementationType = impl->getType().getName();
+ string implementationType = impl->getType().getName();
string implTypeQname = impl->getType().getURI();
implTypeQname += "#";
implTypeQname += impl->getType().getName();
@@ -588,24 +583,26 @@
// Utils::printDO(binding);
- string uri = binding->getCString("uri");
-
// Determine the binding type
string bindingType = binding->getType().getName();
- if (bindingType == "WebServiceBinding")
+ string bindingTypeQname = binding->getType().getURI();
+ bindingTypeQname += "#";
+ bindingTypeQname += binding->getType().getName();
+
+ // Locate the extension that handles this binding type
+ ReferenceBindingExtension* bindingExtension = runtime->getReferenceBindingExtension(bindingTypeQname);
+ if (bindingExtension)
{
- string port = binding->getCString("port");
-
Reference* reference = compositeService->getReference();
- WSReferenceBinding* wsBinding = new WSReferenceBinding(reference, uri, port);
-
- reference->setBinding(wsBinding);
-
+ ReferenceBinding* referenceBinding = bindingExtension->getReferenceBinding(composite, reference, binding);
+ reference->setBinding(referenceBinding);
}
else
{
- string message = "Binding type not yet implemented. Binding is for compositeService: ";
- message = message + compositeServiceDO->getCString("name");
+ LOGERROR_1(0, "ModelLoader::addCompositeService: Unsupported binding type: %s", bindingTypeQname.c_str());
+
+ string message = "Binding type not supported: ";
+ message = message + bindingTypeQname;
throw SystemConfigurationException(message.c_str());
}
}
@@ -637,24 +634,26 @@
//Utils::printDO(binding);
- string uri = binding->getCString("uri");
-
// Determine the binding type
string bindingType = binding->getType().getName();
- if (bindingType == "WebServiceBinding")
- {
- string port = binding->getCString("port");
-
- Service* service = compositeReference->getService();
- WSServiceBinding* wsBinding = new WSServiceBinding(service, uri,port);
-
- service->setBinding(wsBinding);
-
+ string bindingTypeQname = binding->getType().getURI();
+ bindingTypeQname += "#";
+ bindingTypeQname += binding->getType().getName();
+
+ // Locate the extension that handles this binding type
+ ServiceBindingExtension* bindingExtension = runtime->getServiceBindingExtension(bindingTypeQname);
+ if (bindingExtension)
+ {
+ Service *service = compositeReference->getService();
+ ServiceBinding* serviceBinding = bindingExtension->getServiceBinding(composite, service, binding);
+ service->setBinding(serviceBinding);
}
else
{
- string message = "Binding type not yet implemented. Binding is for compositeReference: ";
- message = message + compositeReferenceDO->getCString("name");
+ LOGERROR_1(0, "ModelLoader::addCompositeReference: Unsupported binding type: %s", bindingTypeQname.c_str());
+
+ string message = "Binding type not supported: ";
+ message = message + bindingTypeQname;
throw SystemConfigurationException(message.c_str());
}
}
Modified: incubator/tuscany/cpp/sca/runtime/core/test/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/test/src/Makefile.am?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/test/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/core/test/src/Makefile.am Tue Aug 29 02:04:43 2006
@@ -5,7 +5,19 @@
tuscany_sca_test_SOURCES = TestSCA.cpp
tuscany_sca_test_LDADD = -L$(top_builddir)/runtime/core/src -ltuscany_sca \
- -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo
+ -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \
+ -L$(top_builddir)/runtime/extensions/ws_reference/axis2c/src -ltuscany_sca_ws_reference
+ -L$(AXIS2C_HOME)/lib \
+ -laxis2_util \
+ -laxis2_axiom \
+ -laxis2_wsdl \
+ -laxis2_engine \
+ -laxis2_parser \
+ -laxis2_minizip \
+ -lpthread \
+ -laxis2_http_sender \
+ -laxis2_http_receiver
+
INCLUDES = -I$(top_builddir)/runtime/core/test/MyValue \
-I$(top_builddir)/runtime/core/src \
Modified: incubator/tuscany/cpp/sca/runtime/extensions/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/Makefile.am?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/Makefile.am Tue Aug 29 02:04:43 2006
@@ -1 +1 @@
-SUBDIRS = cpp
+SUBDIRS = cpp ws_reference ws_service
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/Makefile.am?rev=438022&r1=438021&r2=438022&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/Makefile.am Tue Aug 29 02:04:43 2006
@@ -17,9 +17,8 @@
libtuscany_sca_cpp_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \
-L$(top_builddir)/runtime/core/src -ltuscany_sca
-
-AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG
-
INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \
-I${TUSCANY_SDOCPP}/include
+AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG
+
\ No newline at end of file
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 29 02:04:43 2006
@@ -0,0 +1,29 @@
+configure
+Makefile.in
+config.log
+depcomp
+config.guess
+config.h
+config.sub
+ltmain.sh
+Makefile
+config.status
+stamp-h1
+config.h.in
+libtool
+autom4te.cache
+missing
+aclocal.m4
+install-sh
+.deps
+*.dat
+.libs
+tmp
+bld
+.project
+.cdtproject
+.settings
+*_Proxy.cpp
+*_Proxy.h
+*_Wrapper.cpp
+*_Wrapper.h
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/Makefile.am?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/Makefile.am Tue Aug 29 02:04:43 2006
@@ -0,0 +1 @@
+SUBDIRS = axis2c
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 29 02:04:43 2006
@@ -0,0 +1,29 @@
+configure
+Makefile.in
+config.log
+depcomp
+config.guess
+config.h
+config.sub
+ltmain.sh
+Makefile
+config.status
+stamp-h1
+config.h.in
+libtool
+autom4te.cache
+missing
+aclocal.m4
+install-sh
+.deps
+*.dat
+.libs
+tmp
+bld
+.project
+.cdtproject
+.settings
+*_Proxy.cpp
+*_Proxy.h
+*_Wrapper.cpp
+*_Wrapper.h
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/Makefile.am?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/Makefile.am Tue Aug 29 02:04:43 2006
@@ -0,0 +1,5 @@
+SUBDIRS = src
+
+datadir=$(prefix)/extensions/ws_reference
+
+data_DATA = xsd/*.xsd
\ No newline at end of file
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 29 02:04:43 2006
@@ -0,0 +1,29 @@
+configure
+Makefile.in
+config.log
+depcomp
+config.guess
+config.h
+config.sub
+ltmain.sh
+Makefile
+config.status
+stamp-h1
+config.h.in
+libtool
+autom4te.cache
+missing
+aclocal.m4
+install-sh
+.deps
+*.dat
+.libs
+tmp
+bld
+.project
+.cdtproject
+.settings
+*_Proxy.cpp
+*_Proxy.h
+*_Wrapper.cpp
+*_Wrapper.h
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.cpp?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.cpp Tue Aug 29 02:04:43 2006
@@ -0,0 +1,370 @@
+/*
+ * Copyright 2004,2005 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 "osoa/sca/export.h"
+#if defined(WIN32) || defined (_WINDOWS)
+#pragma warning(disable: 4091)
+#endif
+
+#include <axis2_client.h>
+
+#include <axis2_error_default.h>
+#include <axis2_log_default.h>
+#include <axis2_defines.h>
+#include <axiom_soap_const.h>
+#include <platforms/axis2_platform_auto_sense.h>
+
+#include <sdo_axiom.h>
+#include "Axis2Client.h"
+
+
+#include <osoa/sca/sca.h>
+using namespace osoa::sca;
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/util/Logging.h"
+#include "model/WSServiceBinding.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Operation.h"
+#include "tuscany/sca/model/CompositeReference.h"
+#include "tuscany/sca/model/Service.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/WSDLDefinition.h"
+#include "tuscany/sca/model/WSDLOperation.h"
+
+using namespace tuscany::sca::ws;
+
+
+using namespace commonj::sdo;
+using namespace commonj::sdo_axiom;
+
+Axis2Client::Axis2Client(CompositeReference* compositeReference)
+ : compositeReference(compositeReference)
+{
+}
+
+Axis2Client::~Axis2Client()
+{
+}
+
+void Axis2Client::invoke(tuscany::sca::Operation& operation)
+{
+ LOGENTRY(1, "Axis2Client::invoke");
+
+ // From the service ws-binding, get the namespace of the wsdl endpoint
+ Service* service = compositeReference->getService();
+ WSServiceBinding* binding = (WSServiceBinding *)service->getBinding();
+
+ string portNamespace = binding->getWSDLNamespaceURL();
+
+ // Lookup the wsdl model from the composite, keyed on the namespace
+ // (the wsdl will have been loaded at startup, based on the information in the config file)
+ Composite* composite=compositeReference->getComposite();
+ WSDLDefinition* wsdlDefinition = composite->findWSDLDefinition(portNamespace);
+ if (wsdlDefinition == 0)
+ {
+ string msg = "WSDL not found for " + portNamespace;
+ throw SystemConfigurationException(msg.c_str());
+ }
+
+ const string& operationName = operation.getName();
+
+ // Match the operation in Operation to the operation in the wsdl port type.
+ const WSDLOperation& wsdlOperation = wsdlDefinition->findOperation(
+ binding->getServiceName(),
+ binding->getPortName(),
+ operationName);
+
+ // Initialize Axis2 stuff
+ axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+ axis2_log_t *log = axis2_log_create(allocator, NULL, "tuscany_client.log");
+ axis2_error_t *error = axis2_error_create(allocator);
+ axis2_env_t *env = axis2_env_create_with_error_log(allocator, error, log);
+ env->log->level = AXIS2_LOG_LEVEL_TRACE;
+ axis2_error_init();
+
+ axis2_char_t* address = (axis2_char_t*)wsdlOperation.getEndpoint().c_str();
+ axis2_char_t* opName = (axis2_char_t*)operationName.c_str();
+ axis2_char_t* soap_action = (axis2_char_t*)wsdlOperation.getSoapAction().c_str();
+ axis2_char_t* serviceName = (axis2_char_t*)binding->getServiceName().c_str();
+
+ // create OM from Operation and wsdlOperation
+ axiom_node_t* payload = createPayload(operation, wsdlOperation, env);
+
+ /* Create EPR with given address */
+ axis2_endpoint_ref_t* endpoint_ref = axis2_endpoint_ref_create(env, address);
+
+ /* Setup options */
+ axis2_options_t* options = axis2_options_create(env);
+ AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
+ int soap_version = AXIOM_SOAP11;
+ if (wsdlOperation.getSoapVersion() == WSDLOperation::SOAP12)
+ {
+ soap_version = AXIOM_SOAP12;
+ }
+
+ AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, soap_version);
+ AXIS2_OPTIONS_SET_ACTION(options, env, soap_action);
+
+ /* Create service client */
+
+ axis2_char_t* client_home = AXIS2_GETENV("AXIS2C_HOME");
+ if (!client_home)
+ {
+ throw SystemConfigurationException("Environment error: AXIS2C_HOME not set");
+ }
+ axis2_svc_client_t* svc_client = axis2_svc_client_create(env, client_home);
+ if (!svc_client)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "invoke FAILED: Error code:"
+ " %d :: %s", env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+
+ throw ServiceRuntimeException("Axis2Client: axis2_svc_client_create failed");
+ }
+
+ /* Set service client options */
+ AXIS2_SVC_CLIENT_SET_OPTIONS(svc_client, env, options);
+
+ /* Send request */
+ axiom_node_t* ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
+ if(ret_node)
+ {
+ setReturn(ret_node, operation, wsdlOperation, env);
+ }
+ else
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invoke failed: Error code:"
+ " %d :: %s", env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+ throw ServiceRuntimeException("Axis2Client: Invoke failed");
+ }
+
+ if (svc_client)
+ {
+ AXIS2_SVC_CLIENT_FREE(svc_client, env);
+ svc_client = NULL;
+ }
+
+ LOGEXIT(1, "Axis2Client::invoke");
+}
+
+axiom_node_t* Axis2Client::createPayload(Operation& operation,
+ const WSDLOperation& wsdlOp,
+ axis2_env_t* env)
+{
+ LOGENTRY(1, "Axis2Client::createPayload");
+ axiom_node_t* requestOM = NULL;
+
+ // map the operation request to the wsdl
+ if (wsdlOp.isDocumentStyle())
+ {
+ // Document style
+ // only support single part messages - WS-I compliant
+
+ // Build up the payload as an SDO
+
+ // Get the data factory for the composite (it will already have the typecreates loaded for the xsds)
+ DataFactoryPtr dataFactory = compositeReference->getComposite()->getDataFactory();
+ DataObjectPtr requestDO = dataFactory->create(wsdlOp.getInputTypeUri().c_str(),
+ wsdlOp.getInputTypeName().c_str());
+
+ // Each parameter in the operation should be a property on the request dataobject
+ for (int i=0; i<operation.getNParms(); i++)
+ {
+ Operation::Parameter& parm = operation.getParameter(i);
+ switch(parm.getType())
+ {
+ case Operation::BOOL:
+ {
+ requestDO->setBoolean(i, *(bool*)parm.getValue());
+ break;
+ }
+ case Operation::SHORT:
+ {
+ requestDO->setShort(i, *(short*)parm.getValue());
+ break;
+ }
+ case Operation::LONG:
+ {
+ requestDO->setLong(i, *(long*)parm.getValue());
+ break;
+ }
+ case Operation::USHORT:
+ {
+ requestDO->setInteger(i, *(unsigned short*)parm.getValue());
+ break;
+ }
+ case Operation::ULONG:
+ {
+ requestDO->setInteger(i, *(unsigned long*)parm.getValue());
+ break;
+ }
+ case Operation::FLOAT:
+ {
+ requestDO->setFloat(i, *(float*)parm.getValue());
+ break;
+ }
+ case Operation::DOUBLE:
+ {
+ requestDO->setDouble(i, *(double*)parm.getValue());
+ break;
+ }
+ case Operation::LONGDOUBLE:
+ {
+ requestDO->setDouble(i, *(long double*)parm.getValue());
+ break;
+ }
+ case Operation::CHARS:
+ {
+ requestDO->setCString(i, *(char**)parm.getValue());
+ break;
+ }
+ case Operation::STRING:
+ {
+ requestDO->setCString(i, (*(string*)parm.getValue()).c_str());
+ break;
+ }
+ case Operation::DATAOBJECT:
+ {
+ requestDO->setDataObject(i, *(DataObjectPtr*)parm.getValue());
+ break;
+ }
+ default: throw "unsupported parameter type";
+ }
+ }
+
+ // Create the Axiom object from the request dataobject
+ AxiomHelper myHelper;
+ requestOM = myHelper.toAxiomNode(requestDO);
+ }
+ else
+ {
+ // RPC
+ }
+
+ // Logging start
+ axiom_xml_writer_t* xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE, AXIS2_XML_PARSER_TYPE_BUFFER);
+ axiom_output_t* om_output = axiom_output_create( env, xml_writer);
+
+ AXIOM_NODE_SERIALIZE(requestOM, env, om_output);
+ axis2_char_t* buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(xml_writer, env);
+ LOGINFO_1(3, "Sending this OM node in XML : %s \n", buffer);
+
+ AXIOM_OUTPUT_FREE(om_output, env);
+ AXIS2_FREE((env)->allocator, buffer);
+ // Logging end
+
+ LOGEXIT(1, "Axis2Client::createPayload");
+
+ return requestOM;
+}
+
+void Axis2Client::setReturn(axiom_node_t* ret_node,
+ Operation& operation,
+ const WSDLOperation& wsdlOp,
+ axis2_env_t* env)
+{
+ LOGENTRY(1, "Axis2Client::setReturn");
+ /* Get the response value from the SOAP message */
+
+ // logging start
+ axiom_xml_writer_t* writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER);
+ axiom_output_t* om_output = axiom_output_create (env, writer);
+ AXIOM_NODE_SERIALIZE (ret_node, env, om_output);
+ axis2_char_t* buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(writer, env);
+ LOGINFO_1(3,"Received OM node in XML : %s\n", buffer);
+ AXIOM_OUTPUT_FREE(om_output, env);
+ AXIS2_FREE((env)->allocator, buffer);
+ // Logging end
+
+
+ if (wsdlOp.isDocumentStyle())
+ {
+ // Document style
+
+ DataFactoryPtr dataFactory = compositeReference->getComposite()->getDataFactory();
+ AxiomHelper myHelper;
+ DataObjectPtr returnDO = myHelper.toSdo(ret_node, dataFactory);
+
+ unsigned int index = 0;
+ switch(operation.getReturnType())
+ {
+ case Operation::BOOL:
+ {
+ *(bool*)operation.getReturnValue() = returnDO->getBoolean(index);
+ break;
+ }
+ case Operation::SHORT:
+ {
+ *(short*)operation.getReturnValue() = returnDO->getShort(index);
+ break;
+ }
+ case Operation::LONG:
+ {
+ *(long*)operation.getReturnValue() = returnDO->getLong(index);
+ break;
+ }
+ case Operation::USHORT:
+ {
+ *(unsigned short*)operation.getReturnValue() = (unsigned short)returnDO->getInteger(index);
+ break;
+ }
+ case Operation::ULONG:
+ {
+ *(unsigned long*)operation.getReturnValue() = (unsigned long)returnDO->getInteger(index);
+ break;
+ }
+ case Operation::FLOAT:
+ {
+ *(float*)operation.getReturnValue() = returnDO->getFloat(index);
+ break;
+ }
+ case Operation::DOUBLE:
+ {
+ *(double*)operation.getReturnValue() = returnDO->getDouble(index);
+ break;
+ }
+ case Operation::LONGDOUBLE:
+ {
+ *(long double*)operation.getReturnValue() = returnDO->getDouble(index);
+ break;
+ }
+ case Operation::CHARS:
+ {
+ *(char**)operation.getReturnValue() = strdup(returnDO->getCString(index));
+ break;
+ }
+ case Operation::STRING:
+ {
+ *(string*)operation.getReturnValue() = returnDO->getCString(index);
+ break;
+ }
+ case Operation::DATAOBJECT:
+ {
+ *(DataObjectPtr*)operation.getReturnValue() = returnDO->getDataObject(index);
+ break;
+ }
+ default:;
+ }
+ }
+ else
+ {
+ // RPC
+ }
+ LOGEXIT(1, "Axis2Client::setReturn");
+}
+
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.h?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.h Tue Aug 29 02:04:43 2006
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.
+ */
+
+#ifndef tuscany_sca_extension_ws_axis2client_h
+#define tuscany_sca_extension_ws_axis2client_h
+
+#include "osoa/sca/export.h"
+#include <axiom.h>
+
+#include "tuscany/sca/core/Operation.h"
+#include "tuscany/sca/model/CompositeReference.h"
+#include "tuscany/sca/model/WSDLOperation.h"
+
+using namespace tuscany::sca;
+using namespace tuscany::sca::model;
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+
+ class SCA_API Axis2Client
+ {
+ public:
+ Axis2Client(CompositeReference* externalService);
+ virtual ~Axis2Client();
+
+ virtual void invoke(Operation& operation);
+
+ private:
+ CompositeReference* compositeReference;
+
+ axiom_node_t* createPayload(Operation& operation,
+ const WSDLOperation& wsdlOp,
+ axis2_env_t* env);
+
+ void setReturn(axiom_node_t* returnNode,
+ Operation& operation,
+ const WSDLOperation& wsdlOp,
+ axis2_env_t* env);
+
+ };
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_ws_axis2client_h
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Axis2Client.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Makefile.am?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/Makefile.am Tue Aug 29 02:04:43 2006
@@ -0,0 +1,31 @@
+libdir=$(prefix)/extensions/ws_reference
+lib_LTLIBRARIES = libtuscany_sca_ws_reference.la
+
+noinst_HEADERS = *.h model/*.h
+
+libtuscany_sca_ws_reference_la_SOURCES = \
+WSServiceBindingExtension.cpp \
+model/WSServiceBinding.cpp \
+WSServiceWrapper.cpp \
+Axis2Client.cpp
+
+libtuscany_sca_ws_reference_la_LIBADD = \
+ -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \
+ -L$(top_builddir)/runtime/core/src -ltuscany_sca
+ -L$(AXIS2C_HOME)/lib \
+ -laxis2_util \
+ -laxis2_axiom \
+ -laxis2_wsdl \
+ -laxis2_engine \
+ -laxis2_parser \
+ -laxis2_minizip \
+ -lpthread \
+ -laxis2_http_sender \
+ -laxis2_http_receiver
+
+INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \
+ -I${TUSCANY_SDOCPP}/include \
+ -I${AXIS2C_HOME}/include
+
+AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG
+
\ No newline at end of file
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.cpp?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.cpp Tue Aug 29 02:04:43 2006
@@ -0,0 +1,96 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+#include "WSServiceBindingExtension.h"
+#include "model/WSServiceBinding.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/core/SCARuntime.h"
+
+extern "C"
+{
+ #if defined(WIN32) || defined(_WINDOWS)
+ __declspec(dllexport)
+ #endif
+ void tuscany_sca_extension_initialize()
+ {
+ tuscany::sca::ws::WSServiceBindingExtension::initialize();
+ }
+}
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+ // ===================================================================
+ // Constructor for the WSServiceBinding class.
+ // ===================================================================
+ WSServiceBindingExtension::WSServiceBindingExtension()
+ {
+ LOGENTRY(1, "WSServiceBindingExtension::constructor");
+ LOGEXIT(1, "WSServiceBindingExtension::constructor");
+ }
+
+ // ===================================================================
+ // Destructor for the WSServiceBindingExtension class.
+ // ===================================================================
+ WSServiceBindingExtension::~WSServiceBindingExtension()
+ {
+ LOGENTRY(1, "WSServiceBindingExtension::destructor");;
+ LOGEXIT(1, "WSServiceBindingExtension::destructor");
+ }
+
+ const string WSServiceBindingExtension::extensionName("ws");
+ const string WSServiceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding");
+
+
+ // ===================================================================
+ // loadModelElement - load the info from binding.ws
+ // ===================================================================
+ ServiceBinding* WSServiceBindingExtension::getServiceBinding(Composite *composite, Service* service, DataObjectPtr scdlBinding)
+ {
+ string bindingType = scdlBinding->getType().getName();
+ if (bindingType == "WebServiceBinding")
+ {
+ string uri = scdlBinding->getCString("uri");
+ string port = scdlBinding->getCString("port");
+
+ WSServiceBinding* serviceBinding = new WSServiceBinding(service, uri, port);
+
+ return serviceBinding;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+
+ void WSServiceBindingExtension::initialize()
+ {
+ LOGENTRY(1, "WSServiceBindingExtension::initialize");;
+ SCARuntime::getInstance()->registerServiceBindingExtension(new WSServiceBindingExtension());
+ LOGEXIT(1, "WSServiceBindingExtension::initialize");;
+ }
+
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.h?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.h Tue Aug 29 02:04:43 2006
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef tuscany_sca_extension_wsservicebindingextension_h
+#define tuscany_sca_extension_wsservicebindingextension_h
+
+#include "tuscany/sca/extension/ServiceBindingExtension.h"
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+
+ class WSServiceBindingExtension : public ServiceBindingExtension
+ {
+ public:
+ /**
+ * Default constructor
+ */
+ WSServiceBindingExtension();
+
+ /**
+ * Destructor
+ */
+ virtual ~WSServiceBindingExtension();
+
+ /**
+ * return the name of the extension
+ */
+ virtual const string& getExtensionName() {return extensionName;}
+
+ /**
+ * return the QName of schema elemant for this implementation extension
+ * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws")
+ */
+ virtual const string& getExtensionTypeQName() {return typeQName;}
+
+ virtual ServiceBinding* getServiceBinding(Composite* composite, Service* service, DataObjectPtr scdlBinding);
+
+ static void initialize();
+
+ private:
+ static const string extensionName;
+ static const string typeQName;
+
+ };
+
+
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif //tuscany_sca_extension_wsservicebindingextension_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceBindingExtension.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.cpp?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.cpp Tue Aug 29 02:04:43 2006
@@ -0,0 +1,80 @@
+/*
+ *
+ * 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$ */
+#if defined(WIN32) || defined (_WINDOWS)
+#pragma warning(disable: 4091)
+#endif
+
+#include "osoa/sca/sca.h"
+#include "tuscany/sca/util/Logging.h"
+#include "Axis2Client.h"
+#include "WSServiceWrapper.h"
+#include "tuscany/sca/core/Operation.h"
+#include "tuscany/sca/model/Service.h"
+#include "tuscany/sca/model/ServiceType.h"
+
+using namespace tuscany::sca;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+
+ WSServiceWrapper::WSServiceWrapper(Service* service) : ServiceWrapper(service)
+ {
+ }
+
+ WSServiceWrapper::~WSServiceWrapper()
+ {
+ }
+
+ ///
+ /// This method will be called when a web service call needs to be made.
+ ///
+ void WSServiceWrapper::invoke(Operation& operation)
+ {
+ LOGENTRY(1, "WSServiceWrapper::invoke");
+
+ const string& operationName = operation.getName();
+
+ LOGINFO_2(2,"Service: %s, Operation: %s", getService()->getType()->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));
+ }
+
+ // Create the Axis2 client that will handle the Web Service invocation
+ Service* service = getService();
+ CompositeReference* compositeReference = (CompositeReference*)service->getComponent();
+
+ Axis2Client client(compositeReference);
+ client.invoke(operation);
+
+ LOGEXIT(1, "WSServiceWrapper::invoke");
+ }
+
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
+
+
+
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.h?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.h Tue Aug 29 02:04:43 2006
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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$ */
+
+#ifndef tuscany_sca_extension_ws_wsservicewrapper_h
+#define tuscany_sca_extension_ws_wsservicewrapper_h
+#include "osoa/sca/export.h"
+
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "tuscany/sca/core/Operation.h"
+#include "tuscany/sca/model/Service.h"
+
+using namespace tuscany::sca::model;
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+
+ namespace ws
+ {
+
+ class SCA_API WSServiceWrapper : public ServiceWrapper
+ {
+ public:
+
+ /**
+ * Constructor.
+ * @param target The service wrapper represents a Web service.
+ */
+ WSServiceWrapper(Service* service);
+
+ /**
+ * Destructor
+ */
+ virtual ~WSServiceWrapper();
+
+ /**
+ * All business method calls on the target service are performed through
+ * this invoke method.
+ * @param operation The details of the method, paramaters and return value for the
+ * business method to be called on the target service.
+ */
+ virtual void invoke(Operation& operation);
+ };
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_ws_wsservicewrapper_h
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/WSServiceWrapper.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.cpp?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.cpp Tue Aug 29 02:04:43 2006
@@ -0,0 +1,132 @@
+/*
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "model/WSServiceBinding.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "WSServiceWrapper.h"
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+
+ // Constructor
+ WSServiceBinding::WSServiceBinding(Service* service, const string& uri, const string& port)
+ : ServiceBinding(service, uri), port(port)
+ {
+ parsePort();
+
+ serviceWrapper = new WSServiceWrapper(service);
+ }
+
+ void WSServiceBinding::parsePort()
+ {
+ // 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 = "";
+ }
+ }
+
+ // Destructor
+ WSServiceBinding::~WSServiceBinding()
+ {
+ }
+
+ ServiceWrapper* WSServiceBinding::getServiceWrapper()
+ {
+ return serviceWrapper;
+ }
+
+ } // End namespace ws
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.h?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.h Tue Aug 29 02:04:43 2006
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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$ */
+
+#ifndef tuscany_sca_extension_ws_model_wsservicebinding_h
+#define tuscany_sca_extension_ws_model_wsservicebinding_h
+
+#include "tuscany/sca/model/ServiceBinding.h"
+#include "tuscany/sca/model/Service.h"
+
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace ws
+ {
+ /**
+ * Information about a web service binding for service or a reference.
+ */
+ class WSServiceBinding : public model::ServiceBinding
+ {
+ 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")
+ */
+ WSServiceBinding(model::Service* service, const string& uri, const string& port);
+
+ /**
+ * Destructor.
+ */
+ virtual ~WSServiceBinding();
+
+ /**
+ * Returns the type of binding.
+ */
+ virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"; };
+
+ /**
+ * Create a wrapper for the service configured by this
+ * binding.
+ */
+ virtual ServiceWrapper* getServiceWrapper();
+
+ /**
+ * Return the part of the port definition describing the wsdl
+ * namespace.
+ * @return The wsdl namespace.
+ */
+ string getWSDLNamespaceURL() const { return wsdlNamespaceURL; };
+
+ /**
+ * Return the service part of the port definition.
+ * @return The service to use.
+ */
+ string getServiceName() const { return serviceName; };
+
+ /**
+ * Return the port name part of the port definition.
+ * @return The port name to use.
+ */
+ string getPortName() const { return portName; };
+
+ private:
+
+ /**
+ * Parse the port specification.
+ */
+ void parsePort();
+
+ /**
+ * 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;
+
+ /**
+ * The wrapper for the service configured by this binding.
+ */
+ ServiceWrapper* serviceWrapper;
+
+ };
+
+ } // End namespace model
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_ws_model_wsservicebinding_h
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/src/model/WSServiceBinding.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 29 02:04:43 2006
@@ -0,0 +1,29 @@
+configure
+Makefile.in
+config.log
+depcomp
+config.guess
+config.h
+config.sub
+ltmain.sh
+Makefile
+config.status
+stamp-h1
+config.h.in
+libtool
+autom4te.cache
+missing
+aclocal.m4
+install-sh
+.deps
+*.dat
+.libs
+tmp
+bld
+.project
+.cdtproject
+.settings
+*_Proxy.cpp
+*_Proxy.h
+*_Wrapper.cpp
+*_Wrapper.h
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/sca-binding-webservice.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/sca-binding-webservice.xsd?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/sca-binding-webservice.xsd (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/sca-binding-webservice.xsd Tue Aug 29 02:04:43 2006
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ elementFormDefault="qualified">
+
+ <element name="binding.ws" type="sca:WebServiceBinding" substitutionGroup="sca:binding"/>
+ <complexType name="WebServiceBinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="port" type="anyURI" use="optional" />
+ <anyAttribute namespace="##any" processContents="lax" />
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/sca-binding-webservice.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_reference/axis2c/xsd/sca-binding-webservice.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_service/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 29 02:04:43 2006
@@ -0,0 +1,29 @@
+configure
+Makefile.in
+config.log
+depcomp
+config.guess
+config.h
+config.sub
+ltmain.sh
+Makefile
+config.status
+stamp-h1
+config.h.in
+libtool
+autom4te.cache
+missing
+aclocal.m4
+install-sh
+.deps
+*.dat
+.libs
+tmp
+bld
+.project
+.cdtproject
+.settings
+*_Proxy.cpp
+*_Proxy.h
+*_Wrapper.cpp
+*_Wrapper.h
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_service/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_service/Makefile.am?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_service/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_service/Makefile.am Tue Aug 29 02:04:43 2006
@@ -0,0 +1 @@
+SUBDIRS = axis2c
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 29 02:04:43 2006
@@ -0,0 +1,29 @@
+configure
+Makefile.in
+config.log
+depcomp
+config.guess
+config.h
+config.sub
+ltmain.sh
+Makefile
+config.status
+stamp-h1
+config.h.in
+libtool
+autom4te.cache
+missing
+aclocal.m4
+install-sh
+.deps
+*.dat
+.libs
+tmp
+bld
+.project
+.cdtproject
+.settings
+*_Proxy.cpp
+*_Proxy.h
+*_Wrapper.cpp
+*_Wrapper.h
Added: incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/Makefile.am?rev=438022&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/Makefile.am Tue Aug 29 02:04:43 2006
@@ -0,0 +1,5 @@
+SUBDIRS = src
+
+datadir=$(prefix)/extensions/ws_service
+
+data_DATA = xsd/*.xsd
\ No newline at end of file
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/ws_service/axis2c/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 29 02:04:43 2006
@@ -0,0 +1,29 @@
+configure
+Makefile.in
+config.log
+depcomp
+config.guess
+config.h
+config.sub
+ltmain.sh
+Makefile
+config.status
+stamp-h1
+config.h.in
+libtool
+autom4te.cache
+missing
+aclocal.m4
+install-sh
+.deps
+*.dat
+.libs
+tmp
+bld
+.project
+.cdtproject
+.settings
+*_Proxy.cpp
+*_Proxy.h
+*_Wrapper.cpp
+*_Wrapper.h
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org