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/11/20 09:50:11 UTC

svn commit: r477110 [2/2] - in /incubator/tuscany/cpp/sca: ./ runtime/extensions/ runtime/extensions/rest/ runtime/extensions/rest/interface/ runtime/extensions/rest/interface/src/ runtime/extensions/rest/interface/src/tuscany/ runtime/extensions/rest/...

Added: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/Makefile.am?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/Makefile.am Mon Nov 20 00:50:08 2006
@@ -0,0 +1 @@
+SUBDIRS = src
\ No newline at end of file

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/Makefile.am
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/Makefile.am
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 20 00:50:08 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/rest/service/httpd/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/Makefile.am?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/Makefile.am Mon Nov 20 00:50:08 2006
@@ -0,0 +1,33 @@
+libdir=$(prefix)/extensions/rest/service/lib
+lib_LTLIBRARIES = \
+libtuscany_sca_rest_service.la \
+libtuscany_sca_mod_rest.la
+
+noinst_HEADERS = \
+tuscany/sca/rest/*.h \
+tuscany/sca/rest/model/*.h
+
+libtuscany_sca_rest_service_la_SOURCES = \
+tuscany/sca/rest/RESTReferenceBindingExtension.cpp \
+tuscany/sca/rest/model/RESTReferenceBinding.cpp \
+tuscany/sca/rest/RESTServiceProxy.cpp
+
+libtuscany_sca_rest_service_la_LIBADD = \
+  -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \
+  -L$(top_builddir)/runtime/core/src -ltuscany_sca
+
+rootdir=$(prefix)/extensions/rest/service
+
+libtuscany_sca_mod_rest_la_SOURCES = \
+tuscany/sca/rest/ModREST.cpp
+
+libtuscany_sca_mod_rest_la_LIBADD = \
+  -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \
+  -L$(top_builddir)/runtime/core/src -ltuscany_sca
+
+INCLUDES = -I$(top_builddir)/runtime/core/src \
+  -I${TUSCANY_SDOCPP}/include \
+  -I${APR_INCLUDE} \
+  -I${HTTPD_INCLUDE}
+                   
+AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/Makefile.am
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/Makefile.am
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 20 00:50:08 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

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 20 00:50:08 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

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 20 00:50:08 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/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp Mon Nov 20 00:50:08 2006
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "apr_strings.h"
+#include "apr_fnmatch.h"
+#include "apr_strings.h"
+#include "apr_lib.h"
+
+#define APR_WANT_STRFUNC
+#include "apr_want.h"
+
+#include "ap_config.h"
+#include "httpd.h"
+#include "http_config.h"
+#include "http_core.h"
+#include "http_request.h"
+#include "http_protocol.h"
+#include "http_log.h"
+#include "http_main.h"
+#include "util_script.h"
+
+#include "mod_core.h"
+
+
+extern "C"
+{                                                                                   
+
+/* Configuration structure populated by apache2.conf */
+typedef struct rest_config_rec
+{
+    char * home;
+    char * root;
+    char * path;
+    char * component;
+} rest_config_rec_t;
+
+extern module AP_MODULE_DECLARE_DATA rest_module;
+
+static const char *rest_set_home(cmd_parms *cmd, void *dummy, 
+                        const char *arg);
+                        
+static const char *rest_set_path(cmd_parms *cmd, void *dummy, 
+                        const char *arg);
+                        
+static const char *rest_set_root(cmd_parms *cmd, void *dummy, 
+                        const char *arg);
+                        
+static const char *rest_set_component(cmd_parms *cmd, void *dummy, 
+                        const char *arg);
+
+static void* rest_create_svr(apr_pool_t *p, server_rec *s);
+
+
+static const char *rest_set_home(cmd_parms *cmd, void *dummy, 
+                        const char *arg)
+{
+    rest_config_rec_t *conf = (rest_config_rec_t*)ap_get_module_config(
+                        cmd->server->module_config, &rest_module);
+    conf->home = apr_pstrdup(cmd->pool, arg);
+    return NULL;
+}
+
+static const char *rest_set_path(cmd_parms *cmd, void *dummy, 
+                        const char *arg)
+{
+    rest_config_rec_t *conf = (rest_config_rec_t*)ap_get_module_config(
+                        cmd->server->module_config, &rest_module);
+    conf->path = apr_pstrdup(cmd->pool, arg);
+    return NULL;
+}
+
+static const char *rest_set_root(cmd_parms *cmd, void *dummy, 
+                        const char *arg)
+{
+    rest_config_rec_t *conf = (rest_config_rec_t*)ap_get_module_config(
+                        cmd->server->module_config, &rest_module);
+    conf->root = apr_pstrdup(cmd->pool, arg);
+    return NULL;
+}
+
+static const char *rest_set_component(cmd_parms *cmd, void *dummy, 
+                        const char *arg)
+{
+    rest_config_rec_t *conf = (rest_config_rec_t*)ap_get_module_config(
+                        cmd->server->module_config, &rest_module);
+    conf->component = apr_pstrdup(cmd->pool, arg);
+    return NULL;
+}
+
+
+static const command_rec rest_module_cmds[] = 
+{
+    AP_INIT_TAKE1("TuscanyHome", (const char*(*)())rest_set_home, NULL, ACCESS_CONF,
+                  "Tuscany home directory"),
+    AP_INIT_TAKE1("TuscanyPath", (const char*(*)())rest_set_path, NULL, ACCESS_CONF,
+                  "Tuscany SCA composite search path"),
+    AP_INIT_TAKE1("TuscanyRoot", (const char*(*)())rest_set_root, NULL, ACCESS_CONF,
+                  "Tuscany root SCA configuration path"),
+    AP_INIT_TAKE1("TuscanyComponent", (const char*(*)())rest_set_component, NULL, ACCESS_CONF,
+                  "SCA component name"),
+    {NULL}
+};
+
+
+static int rest_handler(request_rec *r)
+{
+    return OK;
+}
+
+static int rest_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
+                       server_rec *s)
+{
+    return OK;
+}
+
+static void rest_child_init(apr_pool_t* p, server_rec* svr_rec)
+{
+    rest_config_rec_t *conf = (rest_config_rec_t*)ap_get_module_config(
+                        svr_rec->module_config, &rest_module); 
+
+    
+    if(false)
+    {
+        fprintf(stderr, "[Tuscany] Due to one or more errors mod_rest loading"
+                        " failed. Causing apache2 to stop loading\n");
+        exit(APEXIT_CHILDFATAL);
+    }
+}
+
+static void register_hooks(apr_pool_t *p)
+{
+    ap_hook_handler(rest_handler, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_post_config(rest_init, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_child_init(rest_child_init, NULL, NULL, APR_HOOK_MIDDLE);
+}
+
+static void* rest_create_svr(apr_pool_t *p, server_rec *s)
+{
+    rest_config_rec_t* conf = (rest_config_rec_t* )apr_palloc(p, sizeof(*conf));
+    conf->home = NULL;
+    conf->path = NULL;
+    conf->root = NULL;
+    conf->component = NULL;
+    return conf;
+}
+
+module AP_MODULE_DECLARE_DATA rest_module =
+{
+    STANDARD20_MODULE_STUFF,
+    NULL,                       /* dir config creater */
+    NULL,                       /* dir merger --- default is to override */
+    rest_create_svr,        /* server config */
+    NULL,                       /* merge server config */
+    rest_module_cmds,         /* command table */
+    register_hooks              /* register_hooks */
+};
+
+
+}

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp Mon Nov 20 00:50:08 2006
@@ -0,0 +1,91 @@
+/*
+* 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 "RESTReferenceBindingExtension.h"
+#include "model/RESTReferenceBinding.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::rest::RESTReferenceBindingExtension::initialize();
+    }
+}
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace rest
+        {
+            // ===================================================================
+            // Constructor for the RESTReferenceBinding class. 
+            // ===================================================================
+            RESTReferenceBindingExtension::RESTReferenceBindingExtension()
+            { 
+                logentry();
+            }
+            
+            // ===================================================================
+            // Destructor for the RESTReferenceBindingExtension class.
+            // ===================================================================
+            RESTReferenceBindingExtension::~RESTReferenceBindingExtension()
+            { 
+                logentry();
+            }
+
+            const string RESTReferenceBindingExtension::extensionName("rest");
+            const string RESTReferenceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTBinding");
+
+            // ===================================================================
+            // loadModelElement - load the info from binding.rest
+            // ===================================================================
+            ReferenceBinding* RESTReferenceBindingExtension::getReferenceBinding(Composite *composite, Reference* reference, DataObjectPtr scdlBinding)
+            {
+                string bindingType = scdlBinding->getType().getName();
+                if (bindingType == "RESTBinding")
+                {
+                    string uri = scdlBinding->getCString("uri");
+
+                    RESTReferenceBinding* serviceBinding = new RESTReferenceBinding(reference, uri);
+                    
+                    return serviceBinding;
+                }
+                else
+                {
+                    return NULL;
+                }
+            }
+
+           void RESTReferenceBindingExtension::initialize()
+            { 
+                logentry();
+                SCARuntime::getInstance()->registerReferenceBindingExtension(new RESTReferenceBindingExtension());
+            }
+
+        } // End namespace rest
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h Mon Nov 20 00:50:08 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_rest_restreferencebindingextension_h
+#define tuscany_sca_extension_rest_restreferencebindingextension_h
+
+#include "tuscany/sca/extension/ReferenceBindingExtension.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace rest
+        {
+            
+            class RESTReferenceBindingExtension : public ReferenceBindingExtension 
+            {
+            public:
+            /**
+            * Default constructor
+                */
+                RESTReferenceBindingExtension();
+                
+                /**
+                * Destructor
+                */
+                virtual ~RESTReferenceBindingExtension();            
+                
+                /**
+                * 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.rest")
+                */
+                virtual const string& getExtensionTypeQName() {return typeQName;}
+                
+                virtual ReferenceBinding* getReferenceBinding(Composite* composite, Reference *reference, DataObjectPtr scdlBinding);
+                
+                static void initialize();
+
+            private:
+                static const string extensionName;
+                static const string typeQName;
+                
+            };
+            
+            
+        } // End namespace rest
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_rest_restreferencebindingextension_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp Mon Nov 20 00:50:08 2006
@@ -0,0 +1,568 @@
+/*
+ *
+ *  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 "RESTServiceProxy.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/model/Reference.h"
+#include "tuscany/sca/model/ReferenceType.h"
+#include "tuscany/sca/model/Service.h"
+#include "tuscany/sca/model/ServiceType.h"
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/ComponentType.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/ServiceBinding.h"
+#include "model/RESTReferenceBinding.h"
+
+#include "commonj/sdo/SDO.h"
+using namespace commonj::sdo;
+
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace rest
+        {
+            
+            // ============================
+            // Constructor: Create a proxy
+            // ============================
+            RESTServiceProxy::RESTServiceProxy(Reference* reference)
+                : ServiceProxy(reference)
+            {
+                logentry();
+    
+                // Get the target service wrapper
+                RESTReferenceBinding* referenceBinding = (RESTReferenceBinding*)reference->getBinding();
+                serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper();
+                
+                // Define the SOAP Body type and element to allow a SOAP body to
+                // be loaded in a DataObject
+                DataFactoryPtr dataFactory = reference->getComponent()->getComposite()->getDataFactory();
+                try {
+                    const Type& bodyType = dataFactory->getType("http://www.w3.org/2003/05/soap-envelope", "Body");
+                } catch (SDORuntimeException&)
+                {
+                    
+                    // Define the SOAP 1.2 Body type
+                    dataFactory->addType("http://www.w3.org/2003/05/soap-envelope", "RootType", false, false, false);                
+                    dataFactory->addType("http://www.w3.org/2003/05/soap-envelope", "Body", false, true, false);                
+                    dataFactory->addPropertyToType(
+                        "http://www.w3.org/2003/05/soap-envelope", "RootType",
+                        "Body",
+                        "http://www.w3.org/2003/05/soap-envelope", "Body",
+                        false, false, true);
+    
+                    // Define the SOAP 1.1 Body type
+                    dataFactory->addType("http://schemas.xmlsoap.org/soap/envelope/", "RootType", false, false, false);
+                    dataFactory->addType("http://schemas.xmlsoap.org/soap/envelope/", "Body", false, true, false);
+                    dataFactory->addPropertyToType(
+                        "http://schemas.xmlsoap.org/soap/envelope/", "RootType",
+                        "Body",
+                        "http://schemas.xmlsoap.org/soap/envelope/", "Body",
+                        false, false, true);
+                }
+                
+            }
+            
+            // ==========
+            // Destructor
+            // ==========
+            RESTServiceProxy::~RESTServiceProxy()
+            {
+                logentry();
+            }
+            
+            ///
+            /// This method will be called to process an operation invocation.
+            ///
+            DataObjectPtr RESTServiceProxy::invoke(const string& operationName, DataObjectPtr inputDataObject)
+            {
+                logentry();
+    
+                Reference* reference = getReference();
+                Component* component = reference->getComponent();
+                Composite* composite = component ->getComposite();
+            
+                RESTReferenceBinding* referenceBinding = (RESTReferenceBinding*)reference->getBinding();
+                DataFactoryPtr dataFactoryPtr = reference->getComponent()->getComposite()->getDataFactory();
+                                    
+//                const char* outputTypeURI = "";
+//                const char* outputTypeName = "";
+//
+//                LOGINFO_2(4, "RESTServiceProxy has got WSDLOperation with inputType: %s#%s",
+//                    wsdlOperation.getInputTypeUri().c_str(), 
+//                    wsdlOperation.getInputTypeName().c_str());
+//                LOGINFO_2(4, "RESTServiceProxy has got WSDLOperation with outputType: %s#%s",
+//                    outputTypeURI, 
+//                    outputTypeName);
+//                LOGINFO_2(4, "RESTServiceProxy has got WSDLOperation with documentStyle=%d and wrapped=%d",        
+//                    documentStyle,
+//                    wrappedStyle);
+//                
+//                if (documentStyle)
+//                {
+//                    if (wrappedStyle)
+//                    {
+//
+//                        // Create new Operation object and set parameters and return value
+//                        Operation operation(wsdlOperation.getOperationName().c_str());
+//                    
+//                        // Go through the input data object to set the operation parameters
+//                        PropertyList pl = inputDataObject->getInstanceProperties();
+//                    
+//                        for(int i=0; i<pl.size(); i++)
+//                        {
+//                            const char* name = pl[i].getName();
+//                    
+//                            switch (pl[i].getTypeEnum()) 
+//                            {
+//                            case Type::BooleanType:
+//                                {
+//                                    bool* boolData = new bool;
+//                                    *boolData = inputDataObject->getBoolean(pl[i]);
+//                                    operation.addParameter(boolData);
+//                                }
+//                                break;
+//                            case Type::ByteType:
+//                                {
+//                                    char* byteData = new char;
+//                                    *byteData = inputDataObject->getByte(pl[i]);
+//                                    operation.addParameter(byteData);
+//                                }
+//                                break;
+//                            case Type::BytesType:
+//                                {
+//                                    int len = inputDataObject->getLength(pl[i]);
+//                                    char* bytesData = new char[len+1];
+//                                    int bytesWritten = inputDataObject->getBytes(pl[i], bytesData, len);
+//                                    // Ensure the bytes end with the null char. Not sure if this is neccessary
+//                                    if(bytesWritten <= len)
+//                                    {
+//                                        bytesData[bytesWritten] = 0;
+//                                    }
+//                                    else
+//                                    {
+//                                        bytesData[len] = 0;
+//                                    }
+//                                    operation.addParameter(&bytesData);
+//                                }
+//                                break;
+//                            case Type::CharacterType:
+//                                {
+//                                    // This code should work but won't be used as there is no mapping from an XSD type to the SDO CharacterType
+//                                    wchar_t* charData = new wchar_t;
+//                                    *charData = inputDataObject->getCharacter(pl[i]);
+//                                    operation.addParameter(charData);
+//                                }
+//                                break;
+//                            case Type::DoubleType:
+//                                {
+//                                    long double* doubleData = new long double;
+//                                    *doubleData = inputDataObject->getDouble(pl[i]);
+//                                    operation.addParameter(doubleData);
+//                                }
+//                                break;
+//                            case Type::FloatType:
+//                                {
+//                                    float* floatData = new float;
+//                                    *floatData = inputDataObject->getFloat(pl[i]);
+//                                    operation.addParameter(floatData); 
+//                                }
+//                                break;
+//                            case Type::IntegerType:
+//                                {
+//                                    long* intData = new long;
+//                                    *intData = inputDataObject->getInteger(pl[i]);
+//                                    operation.addParameter(intData);
+//                                }
+//                                break;
+//                            case Type::ShortType:
+//                                {
+//                                    short* shortData = new short;
+//                                    *shortData = inputDataObject->getShort(pl[i]);
+//                                    operation.addParameter(shortData);
+//                                }
+//                                break;
+//                            case Type::StringType:
+//                                {
+//                                    string* stringData;
+//                                    if(inputDataObject->isSet(pl[i]))
+//                                    {
+//                                        stringData = new string(inputDataObject->getCString(pl[i]));                                        
+//                                    }
+//                                    else
+//                                    {
+//                                        // The data is not set, so pass an empty string as the parameter
+//                                        stringData = new string();
+//                                    }
+//                                    operation.addParameter(stringData);
+//                                }
+//                                break;
+//                            case Type::DataObjectType:
+//                                {
+//                                    DataObjectPtr dataObjectData = inputDataObject->getDataObject(pl[i]);
+//                    
+//                                    if(!dataObjectData)
+//                                    {
+//                                        LOGINFO_1(4, "SDO DataObject parameter named %s was null", name);
+//                                    }
+//                                    operation.addParameter(&dataObjectData);
+//                                }
+//                                break;
+//                            case Type::OpenDataObjectType:
+//                                {         
+//                                    /*
+//                                     * This code deals with xsd:any element parameters
+//                                     * Get each element as a DataObject and add in to the parameter list
+//                                     */
+//                    
+//                                    DataObjectList& dataObjectList = inputDataObject->getList(pl[i]);
+//                                    
+//                                    for(int j=0; j<dataObjectList.size(); j++)
+//                                    {
+//                                        DataObjectPtr dataObjectData = dataObjectList[j];
+//                                        if(!dataObjectData)
+//                                        {
+//                                            
+//                                            // Add a null DataObject ptr
+//                                            LOGINFO_2(4, "SDO OpenDataObject parameter named %s[%d] was null", name, j);
+//                                            operation.addParameter(&dataObjectData);
+//                                        }
+//                                        else
+//                                        {
+//                                            
+//                                            SequencePtr sequence = dataObjectData->getSequence();
+//                                            if (sequence->size()!=0)
+//                                            {
+//                                                // Add a text element        
+//                                                if (sequence->isText(0))
+//                                                {                                        
+//                                                    string* stringData = new string(sequence->getCStringValue(0));
+//                                                    operation.addParameter(stringData);
+//                                                }
+//                                                else
+//                                                {
+//                                                    // Add a complex element DataObject
+//                                                    DataObjectPtr dob = sequence->getDataObjectValue(0);
+//                                                    if(!dob)
+//                                                    {
+//                                                        LOGINFO_1(4, "SDO DataObject parameter named %s was null", name);
+//                                                    }
+//                                                    operation.addParameter(&dob);
+//                                                }
+//                                            }
+//                                            else
+//                                            {
+//                                                // Empty content, add an empty string
+//                                                LOGINFO_2(4, "SDO OpenDataObject parameter named %s[%d] was empty", name, j);
+//                                                string* stringData = new string(""); 
+//                                                operation.addParameter(stringData);
+//                                            }
+//                                        }                       
+//                                    }
+//                                }
+//                                break;
+//                            case Type::DateType:
+//                                LOGERROR_1(0, "SDO DateType parameters are not yet supported (%s)", name);
+//                                return NULL;
+//                            case Type::LongType:
+//                                LOGERROR_1(0, "SDO LongType (int64_t) parameters are not yet supported (%s)", name);
+//                                return NULL;
+//                                break;
+//                            case Type::UriType:
+//                                LOGERROR_1(0, "SDO UriType parameters are not yet supported (%s)", name);
+//                                return NULL;
+//                                break;
+//                            case Type::BigDecimalType:
+//                                LOGERROR_1(0, "SDO BigDecimalType parameters are not yet supported (%s)", name);
+//                                return NULL;
+//                                break;
+//                            case Type::BigIntegerType:
+//                                LOGERROR_1(0, "SDO BigIntegerType parameters are not yet supported (%s)", name);
+//                                return NULL;
+//                                break;
+//                            default:
+//                                LOGERROR_1(0, "Unknown SDO type parameter named %s has been found. Unknown types are not yet supported", name);
+//                                return NULL;
+//                            }         
+//                        }
+//                                
+//                        try
+//                        {
+//                            
+//                            // Call into the target service wrapper
+//                            serviceWrapper->invoke(operation);
+//                    
+//                            // Set the data in the outputDataObject to be returned
+//                            DataObjectPtr outputDataObject;
+//                            try
+//                            {
+//                                
+//                                // Create the output wrapper
+//                                const Type& outputType = dataFactoryPtr->getType(outputTypeURI, outputTypeName);
+//                                outputDataObject = dataFactoryPtr->create(outputType);
+//                            }
+//                            catch (SDORuntimeException&)
+//                            {
+//                                // The output wrapper type is not known, create an open DataObject 
+//                                outputDataObject = dataFactoryPtr->create(Type::SDOTypeNamespaceURI, "OpenDataObject");
+//                            }
+//                            
+//                            setOutputData(operation, outputDataObject, dataFactoryPtr);                            
+//
+//                            return outputDataObject;
+//
+//                        }
+//                      catch(SDORuntimeException& ex)
+//                      {   
+//                            // TODO: Return more error information than just a null DataObject
+//                            LOGERROR_2(0, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText());
+//                            return NULL;
+//                      }  
+//                      catch(TuscanyRuntimeException& ex)
+//                      {   
+//                            // TODO: Return more error information than just a null DataObject
+//                            LOGERROR_2(0, "%s has been caught: %s\n", ex.getEClassName(), ex.getMessageText());
+//                            return NULL;
+//                      }  
+//                    }
+//                    else
+//                    {
+//                        LOGERROR(0, "CompositeServices with non-wrapped document style WSDL Operations are not yet supported");
+//                        return NULL;
+//                    }
+//                }
+//                else
+//                {
+//                    // RPC style
+//                    LOGERROR(0, "CompositeServices with RPC style WSDL Operations are not yet supported");
+//                    return NULL;
+//                }
+
+                return NULL;
+            }
+            
+            
+            void RESTServiceProxy::setOutputData(Operation operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr)
+            {    
+                logentry();
+
+                // Go through data object to set the return value
+                PropertyList pl = outputDataObject->getType().getProperties();
+            
+                if(pl.size() == 0)
+                {
+                    if(outputDataObject->getType().isOpenType() && outputDataObject->getType().isDataObjectType())
+                    {
+                        /*
+                         * This code deals with returning xsd:any elements
+                         */
+                        DataObjectList& l = outputDataObject->getList("return");
+                        Operation::ParameterType resultType = operation.getReturnType();
+                        switch(resultType)
+                        {
+                        case Operation::BOOL: 
+                            {
+                                l.append(*(bool*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::SHORT: 
+                            {
+                                l.append(*(short*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::INT: 
+                            {
+                                l.append(*(long*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::LONG: 
+                            {
+                                l.append(*(long*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::USHORT: 
+                            {
+                                l.append(*(short*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::UINT: 
+                            {
+                                l.append(*(long*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::ULONG: 
+                            {
+                                l.append(*(long*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::FLOAT: 
+                            {
+                                l.append(*(float*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::DOUBLE: 
+                            {
+                                l.append(*(long double*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::LONGDOUBLE: 
+                            {
+                                l.append(*(long double*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::CHARS: 
+                            {
+                                l.append(*(char**)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::STRING: 
+                            {
+                                l.append((*(string*)operation.getReturnValue()).c_str());
+                                break;
+                            }
+                        case Operation::DATAOBJECT: 
+                            {
+                                l.append(*(DataObjectPtr*)operation.getReturnValue());
+                                break;
+                            }
+                        default:
+                            {
+                                string msg = "Unsupported parameter type";
+                                msg += resultType;
+                                throwException(ServiceDataException, msg.c_str()); 
+                            }
+                        }
+                    }
+                    else
+                    {
+                        loginfo("No return values defined");
+                    }
+                }
+                else {
+            
+                    // Should only be one return value.. This goes through all return values
+                    for(int i=0; i<pl.size(); i++)
+                    {
+                        const char* name = pl[i].getName();
+    
+                        Operation::ParameterType resultType = operation.getReturnType();
+                        switch(resultType)
+                        {
+                        case Operation::BOOL: 
+                            {
+                                outputDataObject->setBoolean(pl[i], *(bool*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::SHORT: 
+                            {
+                                outputDataObject->setShort(pl[i], *(short*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::INT: 
+                            {
+                                outputDataObject->setInteger(pl[i], *(int*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::LONG: 
+                            {
+                                outputDataObject->setInteger(pl[i], *(long*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::USHORT: 
+                            {
+                                outputDataObject->setInteger(pl[i], *(unsigned short*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::UINT: 
+                            {
+                                outputDataObject->setInteger(pl[i], *(unsigned int*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::ULONG: 
+                            {
+                                outputDataObject->setInteger(pl[i], *(unsigned long*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::FLOAT: 
+                            {
+                                outputDataObject->setFloat(pl[i], *(float*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::DOUBLE: 
+                            {
+                                outputDataObject->setDouble(pl[i], *(double*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::LONGDOUBLE: 
+                            {
+                                outputDataObject->setDouble(pl[i], *(long double*)operation.getReturnValue());
+                                break;
+                            }
+                        case Operation::CHARS: 
+                            {
+                                if(*(char**)operation.getReturnValue() != NULL)
+                                {
+                                    outputDataObject->setCString(pl[i], *(char**)operation.getReturnValue());
+                                }
+                                else
+                                {
+                                    loginfo("Null return value, leaving property %s unset", pl[i].getName());
+                                }
+                                break;
+                            }
+                        case Operation::STRING: 
+                            {
+                                outputDataObject->setCString(pl[i], (*(string*)operation.getReturnValue()).c_str());                                
+                                break;
+                            }
+                        case Operation::DATAOBJECT: 
+                            {
+
+                                if(*(DataObjectPtr*)operation.getReturnValue() != NULL)
+                                {
+                                    outputDataObject->setDataObject(pl[i], *(DataObjectPtr*)operation.getReturnValue());
+                                }
+                                else
+                                {
+                                    loginfo("Null return value, so leaving property %s unset", pl[i].getName());
+                                }
+                                
+                                break;
+                            }
+                        default:
+                            {
+                                string msg = "Unsupported parameter type";
+                                msg += resultType;
+                                throwException(ServiceDataException, msg.c_str()); 
+                            }
+                        }
+                    }
+                }
+            }
+    
+        } // End namespace rest        
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h Mon Nov 20 00:50:08 2006
@@ -0,0 +1,93 @@
+/*
+ *
+ *  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_rest_restserviceproxy_h
+#define tuscany_sca_extension_rest_restserviceproxy_h
+
+#include "tuscany/sca/core/ServiceProxy.h" 
+#include "tuscany/sca/core/ServiceWrapper.h" 
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/Reference.h"
+#include "tuscany/sca/model/Service.h"
+#include "model/RESTReferenceBinding.h"
+#include "commonj/sdo/SDO.h"
+
+using namespace tuscany::sca::model;
+
+using commonj::sdo::DataObjectPtr;
+using commonj::sdo::DataFactoryPtr;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace rest
+        {
+            
+            /**
+             * Holds a proxy for a given component and reference.
+             * The proxy which is held inside a ServiceProxy will be specific to the programming
+             * interface expected by the client. In this particular case the client is an Axis2 
+             * Web service skeleton.
+             */
+            class RESTServiceProxy : public ServiceProxy
+            {
+            public:
+                /**
+                 * Create a new service proxy for a reference. The proxy will contain a pointer to
+                 * the target ServiceWrapper.
+                 * @param reference The reference on the source component.
+                 * @param target The wrapper of the service which is wired to this reference.
+                 */
+                RESTServiceProxy(Reference* reference);
+    
+                /**
+                 * Create a new service proxy for a service. The proxy will contain a pointer to
+                 * the target ServiceWrapper.
+                 * @param reference The service on the target component.
+                 * @param target The wrapper of the target service.
+                 */
+                RESTServiceProxy(Service* service);
+    
+                /**
+                 * Destructor.
+                 */
+                virtual ~RESTServiceProxy();
+    
+                /**
+                 * Invoke the specified operation
+                 */
+                DataObjectPtr invoke(const string& operationName, DataObjectPtr inputDataObject);    
+    
+            private:
+
+                void setOutputData(Operation operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr);
+                
+                /**
+                 * The target service wrapper
+                 */
+                 ServiceWrapper* serviceWrapper;
+            
+            };
+            
+        } // End namespace rest
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_rest_restserviceproxy_h

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 20 00:50:08 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/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp Mon Nov 20 00:50:08 2006
@@ -0,0 +1,57 @@
+/*
+ *
+ *  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 "tuscany/sca/rest/model/RESTReferenceBinding.h"
+#include "tuscany/sca/core/ServiceProxy.h"
+#include "tuscany/sca/rest/RESTServiceProxy.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace rest
+        {
+
+            // Constructor
+            RESTReferenceBinding::RESTReferenceBinding(Reference* reference, const string& uri)
+                : ReferenceBinding(reference, uri)
+            {
+            }
+            
+            // Destructor
+            RESTReferenceBinding::~RESTReferenceBinding()
+            {
+            }
+            
+            void RESTReferenceBinding::configure(ServiceBinding *binding)
+            {
+                targetServiceBinding = binding;
+                
+                serviceProxy = new RESTServiceProxy(getReference());
+            }
+            
+            ServiceProxy* RESTReferenceBinding::getServiceProxy()
+            {
+                return serviceProxy;
+            }
+                
+        } // End namespace rest
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h Mon Nov 20 00:50:08 2006
@@ -0,0 +1,93 @@
+/*
+ *
+ *  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_rest_model_restreferencebinding_h
+#define tuscany_sca_extension_rest_model_restreferencebinding_h
+
+#include "tuscany/sca/model/ReferenceBinding.h"
+
+using namespace tuscany::sca::model;
+
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace rest
+        {
+            /**
+             * Information about a web service binding for service or a reference.
+             */
+            class RESTReferenceBinding : public ReferenceBinding
+            {    
+            public:
+
+                /**
+                 * Constructor.
+                 * @param uri The uri of the binding.
+                 */
+                RESTReferenceBinding(Reference* reference, const string&uri);  
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~RESTReferenceBinding();
+                            
+                /**
+                 * Returns the type of binding.
+                 */                
+                virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#RESTBinding"; };
+                            
+                 /**
+                  * Configure this binding from a service binding.
+                  */
+                  virtual void configure(ServiceBinding* serviceBinding);
+                                
+                /**
+                 * Create a proxy representing the reference to the
+                 * client component.
+                 */
+                 virtual ServiceProxy* getServiceProxy();
+                                
+                 /**
+                  * Returns the target service binding.
+                  */
+                  ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; };
+                                
+            private:
+            
+                /**
+                 * The proxy representing the reference to the client
+                 * component.
+                 */
+                ServiceProxy* serviceProxy;
+                
+                /**
+                 * The service binding of the target
+                 */
+                ServiceBinding* targetServiceBinding; 
+            };
+            
+        } // End namespace rest
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_rest_model_restreferencebinding_h

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 20 00:50:08 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/rest/xsd/sca-binding-rest.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-binding-rest.xsd?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-binding-rest.xsd (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-binding-rest.xsd Mon Nov 20 00:50:08 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.rest" type="sca:RESTBinding" substitutionGroup="sca:binding"/>
+    <complexType name="RESTBinding">
+        <complexContent>
+            <extension base="sca:Binding">
+                <sequence>
+                    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+                </sequence>
+                <anyAttribute namespace="##any" processContents="lax" />
+            </extension>
+        </complexContent>
+    </complexType>
+    
+</schema>

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-binding-rest.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-binding-rest.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-interface-rest.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-interface-rest.xsd?view=auto&rev=477110
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-interface-rest.xsd (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-interface-rest.xsd Mon Nov 20 00:50:08 2006
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+     
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+<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="interface.rest" type="sca:RESTInterface" substitutionGroup="sca:interface"/>
+    <complexType name="RESTInterface">
+        <complexContent>
+            <extension base="sca:Interface">
+                <sequence>
+                    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+                </sequence>
+                <anyAttribute namespace="##any" processContents="lax" />
+            </extension>
+        </complexContent>
+    </complexType>
+    
+</schema>

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-interface-rest.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/extensions/rest/xsd/sca-interface-rest.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org