You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2006/06/20 16:51:18 UTC
svn commit: r415680 [1/3] - in
/incubator/tuscany/cpp/sca/samples/Calculator: ./ CalculatorModule/ Client/
WSClient/
Author: edslattery
Date: Tue Jun 20 07:51:16 2006
New Revision: 415680
URL: http://svn.apache.org/viewvc?rev=415680&view=rev
Log: (empty)
Added:
incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp (with props)
incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h (with props)
incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp (with props)
incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h (with props)
incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.cpp (with props)
incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.i
incubator/tuscany/cpp/sca/samples/Calculator/WSClient/WSClient.dsp (with props)
incubator/tuscany/cpp/sca/samples/Calculator/WSClient/WSClient.plg
incubator/tuscany/cpp/sca/samples/Calculator/WSClient/axis2_Calculator_stub.cpp (with props)
incubator/tuscany/cpp/sca/samples/Calculator/WSClient/axis2_Calculator_stub.h (with props)
Modified:
incubator/tuscany/cpp/sca/samples/Calculator/Calculator.dsw
incubator/tuscany/cpp/sca/samples/Calculator/Calculator.ncb
incubator/tuscany/cpp/sca/samples/Calculator/Calculator.opt
incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/Calculator.wsdl
incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorModule.plg
incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/sca.module
incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.dsp
incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.plg
incubator/tuscany/cpp/sca/samples/Calculator/Client/readme.txt
incubator/tuscany/cpp/sca/samples/Calculator/pack_deploy.cmd
Modified: incubator/tuscany/cpp/sca/samples/Calculator/Calculator.dsw
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/Calculator.dsw?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/Calculator.dsw (original)
+++ incubator/tuscany/cpp/sca/samples/Calculator/Calculator.dsw Tue Jun 20 07:51:16 2006
@@ -39,6 +39,18 @@
###############################################################################
+Project: "WSClient"=.\WSClient\WSClient.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Global:
Package=<5>
Modified: incubator/tuscany/cpp/sca/samples/Calculator/Calculator.ncb
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/Calculator.ncb?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/sca/samples/Calculator/Calculator.opt
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/Calculator.opt?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/Calculator.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/Calculator.wsdl?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/Calculator.wsdl (original)
+++ incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/Calculator.wsdl Tue Jun 20 07:51:16 2006
@@ -1,145 +1,145 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://ws.apache.org/axis2/c/samplesmath"
- targetNamespace="http://ws.apache.org/axis2/c/samplesmath">
- <types>
- <xs:schema targetNamespace="http://ws.apache.org/axis2/c/samplesmath"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://ws.apache.org/axis2/c/samplesmath"
- elementFormDefault="qualified">
-
- <xs:element name="add">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="param1" type="xs:float" minOccurs="1"/>
- <xs:element name="param2" type="xs:float" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="sub">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="param1" type="xs:float" minOccurs="1"/>
- <xs:element name="param2" type="xs:float" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="mul">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="param1" type="xs:float" minOccurs="1"/>
- <xs:element name="param2" type="xs:float" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="div">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="param1" type="xs:float" minOccurs="1"/>
- <xs:element name="param2" type="xs:float" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
-<!-- The data that axis2c math client expects to be returned. -->
-<!-- SDOCPP currently doesn't support this XML. Jira TUSCANY-xxx -->
-<!-- <xs:element name="result"> -->
-<!-- <xs:simpleType> -->
-<!-- <xs:restriction base="xs:float"/> -->
-<!-- </xs:simpleType> -->
-<!-- </xs:element> -->
- <xs:element name="result">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="data" type="xs:float" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- </xs:schema>
- </types>
-
- <message name="addRequestMsg">
- <part name="body" element="tns:add"/>
- </message>
- <message name="subRequestMsg">
- <part name="body" element="tns:sub"/>
- </message>
- <message name="mulRequestMsg">
- <part name="body" element="tns:mul"/>
- </message>
- <message name="divRequestMsg">
- <part name="body" element="tns:div"/>
- </message>
-
- <message name="calculatorResponseMsg">
- <part name="body" element="tns:result"/>
- </message>
-
- <portType name="CalculatorServicePortType">
- <operation name="add">
- <input message="tns:addRequestMsg"/>
- <output message="tns:calculatorResponseMsg"/>
- </operation>
- <operation name="sub">
- <input message="tns:subRequestMsg"/>
- <output message="tns:calculatorResponseMsg"/>
- </operation>
- <operation name="mul">
- <input message="tns:mulRequestMsg"/>
- <output message="tns:calculatorResponseMsg"/>
- </operation>
- <operation name="div">
- <input message="tns:divRequestMsg"/>
- <output message="tns:calculatorResponseMsg"/>
- </operation>
- </portType>
-
- <binding name="CalculatorServiceBinding" type="tns:CalculatorServicePortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="add">
- <soap:operation soapAction="CalculatorService#add"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="sub">
- <soap:operation soapAction="CalculatorService#sub"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="mul">
- <soap:operation soapAction="CalculatorService#nul"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="div">
- <soap:operation soapAction="CalculatorService#div"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
-
- <service name="CalculatorService">
- <port name="CalculatorServicePort" binding="tns:CalculatorServiceBinding">
- <soap:address location="http://localhost/axis/CalculatorService"/>
- </port>
- </service>
-</definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="tuscany/c/Calculator"
+ targetNamespace="tuscany/c/Calculator">
+ <types>
+ <xs:schema targetNamespace="tuscany/c/Calculator"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="tuscany/c/Calculator"
+ elementFormDefault="qualified">
+
+ <xs:element name="add">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="sub">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="mul">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="div">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+<!-- The data that axis2c math client expects to be returned. -->
+<!-- SDOCPP currently doesn't support this XML. Jira TUSCANY-xxx -->
+<!-- <xs:element name="result"> -->
+<!-- <xs:simpleType> -->
+<!-- <xs:restriction base="xs:float"/> -->
+<!-- </xs:simpleType> -->
+<!-- </xs:element> -->
+ <xs:element name="result">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="data" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </xs:schema>
+ </types>
+
+ <message name="addRequestMsg">
+ <part name="body" element="tns:add"/>
+ </message>
+ <message name="subRequestMsg">
+ <part name="body" element="tns:sub"/>
+ </message>
+ <message name="mulRequestMsg">
+ <part name="body" element="tns:mul"/>
+ </message>
+ <message name="divRequestMsg">
+ <part name="body" element="tns:div"/>
+ </message>
+
+ <message name="calculatorResponseMsg">
+ <part name="body" element="tns:result"/>
+ </message>
+
+ <portType name="CalculatorServicePortType">
+ <operation name="add">
+ <input message="tns:addRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ <operation name="sub">
+ <input message="tns:subRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ <operation name="mul">
+ <input message="tns:mulRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ <operation name="div">
+ <input message="tns:divRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ </portType>
+
+ <binding name="CalculatorServiceBinding" type="tns:CalculatorServicePortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="add">
+ <soap:operation soapAction="CalculatorService#add"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="sub">
+ <soap:operation soapAction="CalculatorService#sub"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="mul">
+ <soap:operation soapAction="CalculatorService#nul"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="div">
+ <soap:operation soapAction="CalculatorService#div"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="CalculatorService">
+ <port name="CalculatorServicePort" binding="tns:CalculatorServiceBinding">
+ <soap:address location="http://localhost/axis/CalculatorService"/>
+ </port>
+ </service>
+</definitions>
Added: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp?rev=415680&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp (added)
+++ incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp Tue Jun 20 07:51:16 2006
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+#include "CalculatorImpl_CalculatorService_Proxy.h"
+
+#include "osoa/sca/sca.h"
+using namespace osoa::sca;
+using namespace tuscany::sca;
+
+extern "C"
+{
+
+ #if defined(WIN32) || defined(_WINDOWS)
+ __declspec(dllexport)
+ #endif
+ CalculatorImpl_CalculatorService_Proxy* CalculatorImpl_CalculatorService_Proxy_Factory(ServiceWrapper* target)
+ {
+ return new CalculatorImpl_CalculatorService_Proxy(target);
+ }
+
+ #if defined(WIN32) || defined(_WINDOWS)
+ __declspec(dllexport)
+ #endif
+ void CalculatorImpl_CalculatorService_Proxy_Destructor(void* proxy)
+ {
+ delete (CalculatorImpl_CalculatorService_Proxy*)proxy;
+ }
+}
+
+CalculatorImpl_CalculatorService_Proxy::CalculatorImpl_CalculatorService_Proxy(ServiceWrapper* targ) : target(targ)
+{
+}
+
+CalculatorImpl_CalculatorService_Proxy::~CalculatorImpl_CalculatorService_Proxy()
+{
+ if (target)
+ delete target;
+}
+
+float CalculatorImpl_CalculatorService_Proxy::add( float arg0, float arg1)
+{
+ Operation operation("add");
+ operation.addParameter(&arg0);
+ operation.addParameter(&arg1);
+ float ret;
+ operation.setReturnValue(&ret);
+ target->invoke(operation);
+ return ret;
+}
+
+float CalculatorImpl_CalculatorService_Proxy::sub( float arg0, float arg1)
+{
+ Operation operation("sub");
+ operation.addParameter(&arg0);
+ operation.addParameter(&arg1);
+ float ret;
+ operation.setReturnValue(&ret);
+ target->invoke(operation);
+ return ret;
+}
+
+float CalculatorImpl_CalculatorService_Proxy::mul( float arg0, float arg1)
+{
+ Operation operation("mul");
+ operation.addParameter(&arg0);
+ operation.addParameter(&arg1);
+ float ret;
+ operation.setReturnValue(&ret);
+ target->invoke(operation);
+ return ret;
+}
+
+float CalculatorImpl_CalculatorService_Proxy::div( float arg0, float arg1)
+{
+ Operation operation("div");
+ operation.addParameter(&arg0);
+ operation.addParameter(&arg1);
+ float ret;
+ operation.setReturnValue(&ret);
+ target->invoke(operation);
+ return ret;
+}
+
+
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h?rev=415680&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h (added)
+++ incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h Tue Jun 20 07:51:16 2006
@@ -0,0 +1,37 @@
+/*
+ * 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 CalculatorImpl_CalculatorService_Proxy_h
+#define CalculatorImpl_CalculatorService_Proxy_h
+
+#include "Calculator.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+
+class CalculatorImpl_CalculatorService_Proxy : public Calculator
+{
+public:
+ CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*);
+ virtual ~CalculatorImpl_CalculatorService_Proxy();
+ virtual float add( float arg1, float arg2);
+ virtual float sub( float arg1, float arg2);
+ virtual float mul( float arg1, float arg2);
+ virtual float div( float arg1, float arg2);
+private:
+ tuscany::sca::ServiceWrapper* target;
+};
+
+#endif // CalculatorImpl_CalculatorService_Proxy_h
+
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp?rev=415680&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp (added)
+++ incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp Tue Jun 20 07:51:16 2006
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+#include "CalculatorImpl_CalculatorService_Wrapper.h"
+
+#include "osoa/sca/sca.h"
+using namespace osoa::sca;
+using namespace tuscany::sca;
+
+extern "C"
+{
+
+ #if defined(WIN32) || defined(_WINDOWS)
+ __declspec(dllexport)
+ #endif
+ CalculatorImpl_CalculatorService_Wrapper* CalculatorImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target)
+ {
+ return new CalculatorImpl_CalculatorService_Wrapper(target);
+ }
+}
+
+CalculatorImpl_CalculatorService_Wrapper::CalculatorImpl_CalculatorService_Wrapper(Service* target) : ComponentServiceWrapper(target)
+{
+ impl = (CalculatorImpl*)getImplementation();
+}
+
+CalculatorImpl_CalculatorService_Wrapper::~CalculatorImpl_CalculatorService_Wrapper()
+{
+ releaseImplementation();
+}
+
+void* CalculatorImpl_CalculatorService_Wrapper::newImplementation()
+{
+ return new CalculatorImpl;
+}
+
+void CalculatorImpl_CalculatorService_Wrapper::deleteImplementation()
+{
+ delete impl;
+}
+
+void CalculatorImpl_CalculatorService_Wrapper::invokeService(Operation& operation)
+{
+ const string& operationName = operation.getName();
+
+ if (operationName == "add")
+ {
+ float& p0 = *( float*)operation.getParameterValue(0);
+ float& p1 = *( float*)operation.getParameterValue(1);
+ *(float*)operation.getReturnValue() = impl->add(p0, p1);
+ return;
+ }
+ if (operationName == "sub")
+ {
+ float& p0 = *( float*)operation.getParameterValue(0);
+ float& p1 = *( float*)operation.getParameterValue(1);
+ *(float*)operation.getReturnValue() = impl->sub(p0, p1);
+ return;
+ }
+ if (operationName == "mul")
+ {
+ float& p0 = *( float*)operation.getParameterValue(0);
+ float& p1 = *( float*)operation.getParameterValue(1);
+ *(float*)operation.getReturnValue() = impl->mul(p0, p1);
+ return;
+ }
+ if (operationName == "div")
+ {
+ float& p0 = *( float*)operation.getParameterValue(0);
+ float& p1 = *( float*)operation.getParameterValue(1);
+ *(float*)operation.getReturnValue() = impl->div(p0, p1);
+ return;
+ }
+
+
+ throw ServiceRuntimeException("Invalid operation");
+
+}
+
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h?rev=415680&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h (added)
+++ incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h Tue Jun 20 07:51:16 2006
@@ -0,0 +1,36 @@
+/*
+ * 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 CalculatorImpl_CalculatorService_Wrapper_h
+#define CalculatorImpl_CalculatorService_Wrapper_h
+
+#include "CalculatorImpl.h"
+#include "tuscany/sca/core/ComponentServiceWrapper.h"
+
+class CalculatorImpl_CalculatorService_Wrapper : public tuscany::sca::ComponentServiceWrapper
+{
+public:
+ CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target);
+ virtual ~CalculatorImpl_CalculatorService_Wrapper();
+ virtual void invokeService(tuscany::sca::Operation& operation);
+ virtual void* newImplementation();
+ virtual void deleteImplementation();
+private:
+ CalculatorImpl* impl;
+};
+
+#endif // CalculatorImpl_CalculatorService_Wrapper_h
+
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorModule.plg
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorModule.plg?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorModule.plg (original)
+++ incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/CalculatorModule.plg Tue Jun 20 07:51:16 2006
@@ -6,29 +6,6 @@
--------------------Configuration: CalculatorModule - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF28.tmp" with contents
-[
-/nologo /MDd /W3 /Gm /GX /ZI /I "c:\apache\test_checkout\sdo/include" /I "c:\apache\test_checkout\sca/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CALCULATORMODULE_EXPORTS" /Fp"Debug/CalculatorModule.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\apache\test_checkout\sca\samples\Calculator\CalculatorModule\CalculatorImpl.cpp"
-"C:\apache\test_checkout\sca\samples\Calculator\CalculatorModule\CalculatorImpl_CalculatorService_Proxy.cpp"
-"C:\apache\test_checkout\sca\samples\Calculator\CalculatorModule\CalculatorImpl_CalculatorService_Wrapper.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF28.tmp"
-Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF29.tmp" with contents
-[
-kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sca.lib tuscany_sdo.lib /nologo /dll /incremental:yes /pdb:"Debug/CalculatorModule.pdb" /debug /machine:I386 /out:"Debug/CalculatorModule.dll" /implib:"Debug/CalculatorModule.lib" /pdbtype:sept /libpath:"c:\apache\test_checkout\sdo/lib" /libpath:"c:\apache\test_checkout\sca/lib"
-.\Debug\CalculatorImpl.obj
-.\Debug\CalculatorImpl_CalculatorService_Proxy.obj
-.\Debug\CalculatorImpl_CalculatorService_Wrapper.obj
-]
-Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF29.tmp"
-<h3>Output Window</h3>
-Compiling...
-CalculatorImpl.cpp
-CalculatorImpl_CalculatorService_Proxy.cpp
-CalculatorImpl_CalculatorService_Wrapper.cpp
-Linking...
- Creating library Debug/CalculatorModule.lib and object Debug/CalculatorModule.exp
Modified: incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/sca.module
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/sca.module?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/sca.module (original)
+++ incubator/tuscany/cpp/sca/samples/Calculator/CalculatorModule/sca.module Tue Jun 20 07:51:16 2006
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="ASCII"?>
<module xmlns="http://www.osoa.org/xmlns/sca/0.9"
xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
- xmlns:cs="http://ws.apache.org/axis2/c/samplesmath/"
+ xmlns:cs="tuscany/c/Calculator/"
name="CalculatorModule">
<!-- Expose as a web service -->
<entryPoint name="WSCalculatorEntrypoint" multiplicity="1..1">
<interface.wsdl interface="Calculator.wsdl" callbackInterface=""></interface.wsdl>
- <binding.ws port="http://ws.apache.org/axis2/c/samplesmath#wsdl.endpoint(CalculatorService/CalculatorServicePort)"></binding.ws>
+ <binding.ws port="tuscany/c/Calculator#wsdl.endpoint(CalculatorService/CalculatorServicePort)"></binding.ws>
<reference>CalculatorServiceComponent</reference>
</entryPoint>
Modified: incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.dsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.dsp?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.dsp (original)
+++ incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.dsp Tue Jun 20 07:51:16 2006
@@ -62,6 +62,7 @@
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "$(TUSCANY_SDOCPP)/include" /I "$(TUSCANY_SCACPP)/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
@@ -72,7 +73,8 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib tuscany_sca.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"$(TUSCANY_SDOCPP)/lib" /libpath:"$(TUSCANY_SCACPP)/lib"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib tuscany_sca.lib /nologo /subsystem:console /pdb:"Debug/Client.pdb" /debug /machine:I386 /out:"Debug/Calc.exe" /pdbtype:sept /libpath:"$(TUSCANY_SDOCPP)/lib" /libpath:"$(TUSCANY_SCACPP)/lib"
+# SUBTRACT LINK32 /pdb:none
!ENDIF
Modified: incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.plg
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.plg?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.plg (original)
+++ incubator/tuscany/cpp/sca/samples/Calculator/Client/Client.plg Tue Jun 20 07:51:16 2006
@@ -6,27 +6,19 @@
--------------------Configuration: Client - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF2D.tmp" with contents
+Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1AE.tmp" with contents
[
-/nologo /MD /W3 /Gm /GX /ZI /Od /I "c:\apache\test_checkout\sdo/include" /I "c:\apache\test_checkout\sca/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/Client.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\apache\test_checkout\sca\samples\Calculator\Client\Calc.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF2D.tmp"
-Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF2E.tmp" with contents
-[
-kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib tuscany_sca.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/Client.pdb" /debug /machine:I386 /out:"Debug/Client.exe" /pdbtype:sept /libpath:"c:\apache\test_checkout\sdo/lib" /libpath:"c:\apache\test_checkout\sca/lib"
+kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib tuscany_sca.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/Client.pdb" /debug /machine:I386 /out:"Debug/Calc.exe" /pdbtype:sept /libpath:"c:\apache\apache_checkout\cpp\sdo\deploy/lib" /libpath:"c:\apache\apache_checkout\cpp\sca/lib"
.\Debug\Calc.obj
]
-Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSPF2E.tmp"
+Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP1AE.tmp"
<h3>Output Window</h3>
-Compiling...
-Calc.cpp
Linking...
<h3>Results</h3>
-Client.exe - 0 error(s), 0 warning(s)
+Calc.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>
Modified: incubator/tuscany/cpp/sca/samples/Calculator/Client/readme.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/Client/readme.txt?rev=415680&r1=415679&r2=415680&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/Client/readme.txt (original)
+++ incubator/tuscany/cpp/sca/samples/Calculator/Client/readme.txt Tue Jun 20 07:51:16 2006
@@ -36,7 +36,7 @@
- Run the SCA generation tool to create the proxy and wrapper classes.
Either Tools->SCA Gen if you have added SCA Gen as an external tool
- dir Hello Or run from the command line:
+ Or run from the command line:
scagen -dir <projectDirectory> -output <projectDirectory>
where the projectDirectory is the directory with the sca.module file.
Added: incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.cpp?rev=415680&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.cpp (added)
+++ incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.cpp Tue Jun 20 07:51:16 2006
@@ -0,0 +1,181 @@
+/*
+ * 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 "axis2_Calculator_stub.h"
+#include <stdio.h>
+#include <axiom.h>
+#include <axis2_util.h>
+#include <axiom_soap.h>
+#include <axis2_client.h>
+
+axiom_node_t *
+build_om_programatically(const axis2_env_t *env,
+ const axis2_char_t *operation,
+ const axis2_char_t *param1,
+ const axis2_char_t *param2);
+
+int main(int argc, char** argv)
+{
+ axis2_stub_t *stub = NULL;
+ axiom_node_t *node = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+ const axis2_env_t *env = NULL;
+ const axis2_char_t *address = NULL;
+ const axis2_char_t *client_home = NULL;
+ axiom_node_t *ret_node = NULL;
+
+ const axis2_char_t *operation = "add";
+ const axis2_char_t *param1 = "40";
+ const axis2_char_t *param2 = "8";
+
+ env = axis2_env_create_all( "Calculator_blocking.log", AXIS2_LOG_LEVEL_TRACE);
+
+ client_home = AXIS2_GETENV("AXIS2C_HOME");
+ if (!client_home)
+ client_home = "../../deploy";
+
+ address = "http://localhost:9090/axis2/services/Calculator";
+ if (argc > 1 )
+ operation = argv[1];
+ if (AXIS2_STRCMP(operation, "-h") == 0)
+ {
+ printf("Usage : %s [operation] [param1] [param2] [endpoint_url]\n", argv[0]);
+ printf("use -h for help\n");
+ printf("default operation add\n");
+ printf("default param1 %s\n", param1);
+ printf("default param2 %s\n", param2);
+ printf("default endpoint_url %s\n", address);
+ printf("NOTE: command line arguments must appear in given order, with trailing ones being optional\n");
+ return 0;
+ }
+ if (argc > 2 )
+ param1 = argv[2];
+ if (argc > 3 )
+ param2 = argv[3];
+ if (argc > 4 )
+ address = argv[4];
+
+ printf ("Using endpoint : %s\n", address);
+ printf ("\nInvoking operation %s with params %s and %s\n", operation, param1, param2);
+
+ node = build_om_programatically(env, operation, param1, param2);
+ stub =
+ axis2_Calculator_stub_create_with_endpoint_uri_and_client_home(env, address, client_home);
+ /* create node and invoke Calculator */
+ ret_node = axis2_Calculator_stub_add(stub, env, node);
+ if(ret_node)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = AXIOM_NODE_TO_STRING(ret_node, env);
+ if(om_str)
+ {
+ printf("\nOM returned = %s\n", om_str);
+ }
+
+ if (AXIOM_NODE_GET_NODE_TYPE(ret_node, env) == AXIOM_ELEMENT)
+ {
+ axis2_char_t *result = NULL;
+ axiom_node_t *result_node = (axiom_node_t*)AXIOM_NODE_GET_FIRST_CHILD(ret_node, env);
+ axiom_element_t *data_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(result_node, env);
+
+ result = AXIOM_ELEMENT_GET_TEXT(data_ele, env, result_node);
+ printf( "\nResult = %s\n", result);
+ }
+ else
+ {
+ axiom_xml_writer_t *writer = NULL;
+ axiom_output_t *om_output = NULL;
+ axis2_char_t *buffer = NULL;
+ writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
+ om_output = axiom_output_create (env, writer);
+
+ AXIOM_NODE_SERIALIZE (ret_node, env, om_output);
+ buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(writer, env);
+ printf ("\nReceived invalid OM as result : %s\n", buffer);
+ if(NULL != buffer)
+ {
+ AXIS2_FREE(env->allocator, buffer);
+ buffer = NULL;
+ }
+ if(NULL != om_output)
+ {
+ AXIOM_OUTPUT_FREE(om_output, env);
+ om_output = NULL;
+ }
+ }
+ }
+ else
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
+ " %d :: %s", env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+ printf("Calculator stub invoke FAILED!\n");
+ }
+ if (stub)
+ {
+ AXIS2_STUB_FREE(stub, env);
+ }
+ return status;
+}
+
+axiom_node_t *
+build_om_programatically(const axis2_env_t *env,
+ const axis2_char_t *operation,
+ const axis2_char_t *param1,
+ const axis2_char_t *param2)
+{
+ axiom_node_t *Calculator_om_node = NULL;
+ axiom_element_t* Calculator_om_ele = NULL;
+ axiom_node_t* text_om_node = NULL;
+ axiom_element_t * text_om_ele = NULL;
+ axiom_namespace_t *ns1 = NULL;
+
+
+ axiom_xml_writer_t *xml_writer = NULL;
+ axiom_output_t *om_output = NULL;
+ axis2_char_t *buffer = NULL;
+
+ ns1 = axiom_namespace_create (env, "tuscany/c/Calculator", "ns1");
+
+ Calculator_om_ele = axiom_element_create(env, NULL, operation, ns1, &Calculator_om_node);
+
+ text_om_ele = axiom_element_create(env, Calculator_om_node, "param1", NULL, &text_om_node);
+ AXIOM_ELEMENT_SET_TEXT(text_om_ele, env, param1, text_om_node);
+
+ text_om_ele = axiom_element_create(env, Calculator_om_node, "param2", NULL, &text_om_node);
+ AXIOM_ELEMENT_SET_TEXT(text_om_ele, env, param2, text_om_node);
+
+ xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
+ om_output = axiom_output_create( env, xml_writer);
+
+ AXIOM_NODE_SERIALIZE(Calculator_om_node, env, om_output);
+ buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(xml_writer, env);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "\nSending OM node in XML : %s \n", buffer);
+ if(NULL != buffer)
+ {
+ AXIS2_FREE(env->allocator, buffer);
+ buffer = NULL;
+ }
+ if(NULL != om_output)
+ {
+ AXIOM_OUTPUT_FREE(om_output, env);
+ om_output = NULL;
+ }
+
+ return Calculator_om_node;
+}
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/Calculator/WSClient/Calculator_Client.cpp
------------------------------------------------------------------------------
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