diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-16 06:23:13 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-16 06:23:13 +0000 |
commit | 8759a126a1bb9eec550c37b5b14642b0cfeb797b (patch) | |
tree | bc4744f903d38710e61a9e8ca6766132e5926201 /sca-cpp/branches/cpp-M1/sca/samples/MyValue | |
parent | fd1aa20dd751f242e2df5ee61c84dfbd7c0ebb83 (diff) |
Cleaning up SVN structure, moving branch under sca-cpp/branches.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@880612 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/branches/cpp-M1/sca/samples/MyValue')
24 files changed, 1176 insertions, 0 deletions
diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Client/Makefile.am b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Client/Makefile.am new file mode 100644 index 0000000000..b1586cc752 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Client/Makefile.am @@ -0,0 +1,11 @@ +prgbindir=$(prefix)/samples/bin +prgbin_PROGRAMS = MyValueClient + +MyValueClient_SOURCES = MyValueClient.cpp + +MyValueClient_LDADD = -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -lxml2 + +INCLUDES = -I.. \ + -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Client/MyValueClient.cpp b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Client/MyValueClient.cpp new file mode 100755 index 0000000000..1e5c038e2e --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Client/MyValueClient.cpp @@ -0,0 +1,179 @@ +/* + * + * 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. + */ +#pragma warning(disable: 4786) + +#include "commonj/sdo/Logger.h" +#include "commonj/sdo/SDO.h" +#include "commonj/sdo/HelperProvider.h" +#include "osoa/sca/sca.h" +#include "tuscany/sca/util/Logger.h" +#include "tuscany/sca/util/Utils.h" +#include <iostream> + +using namespace std; +using namespace osoa::sca; +using namespace tuscany::sca; +using namespace commonj::sdo; +using namespace tuscany::sca::ws; + +void usage(); + +// +// MyValueClient is a sample application that invokes operations on the +// MyValueService Web Service. +// +int main(int argc, char* argv[]) +{ + + // + // Schema file for the types used by MyValueService + // + char *pszXSD; + + // + // The WebService endpoint uri. + // + char *pszEndpoint; + + // + // TargetNamespace + // + const char *pszTargetNamespace; + + // + // SOAPAction + // + // Axis 1.5: SoapAction must be <serviceName>#<operationName>. + const char *pcszSoapAction = "MyValueService#getMyValue"; + + // + // Operation Name + // + const char *pcszOperationName = "getMyValue"; + + // + // Operation Response Name + // + const char *pcszOperationResponseName = "getMyValueResponse"; + + + // Get the input parameters. + if (argc == 3) + { + // Schema file. + pszXSD = argv[1]; + // Web Service endpoint. + pszEndpoint = argv[2]; + } + else + { + usage(); + } + + // The current version of SDO does not support the embedded schema in the wsdl file, + // so we have to load an external schema. + XSDHelperPtr xsdHelper = HelperProvider::getXSDHelper(); + + try + { + cout << "define file: " << pszXSD <<endl; + pszTargetNamespace = xsdHelper->defineFile(pszXSD); + } + catch (SDORuntimeException ex) + { + cout << ex << endl; + exit(1); + } + cout << "define file done: " << pszTargetNamespace <<endl; + + + // Create an SDO for the request + DataFactoryPtr factory = xsdHelper->getDataFactory(); + DataObjectPtr requestDO = 0; + + try + { + // Create the root element for the operation and then add the parameters + // we need to invoke the operation. + requestDO = factory->create(pszTargetNamespace, pcszOperationName); + requestDO->setCString("customerID", "12345"); + } + catch (SDORuntimeException e) + { + cout << "SDORuntimeException: " << e << endl; + exit(1); + } + + // + // Create an SDOStub that will use the request SDO to invoke the operation. + // + SDOStub *stub = new SDOStub(); + stub->setEndpoint(pszEndpoint); + stub->setOperationName(pcszOperationName); + stub->setTargetNamespace(pszTargetNamespace); + stub->setOperationResponseName(pcszOperationResponseName); + stub->setSoapAction(pcszSoapAction); + // DEBUG - Don't let the soap transport timeout while debugging. + stub->setTransportTimeout(0); + // DEBUG + + try + { + // Invoke the operation. + DataObjectPtr responseDO = stub->invoke(requestDO, factory); + // Print the response. + if (responseDO != 0) + { + cout << "MyValueClient: response DataObject = " << endl; + Utils::printDO(responseDO); + cout << endl; + float fValue = responseDO->getFloat("myValue"); + cout << "MyValueClient: myValue = " << fValue; + } + else + { + cout << "MyValueClient: MyValueService did not return a result" << endl; + } + } + catch (SDORuntimeException& e) + { + cout << "SDORuntimeException: " << e << endl; + } + catch (ServiceRuntimeException& e) + { + cout << "ServiceRuntimeException: " << e << endl; + } + catch(exception& e) + { + cout << "Exception: " << e.what() << endl; + } + + + return 0; +} + +// +// Print usage message. +// +void usage() +{ + cout << "MyValueClient.exe: Invoke operations on MyValueService Web Service" << endl; + cout << "Usage: MyValueClient XSD endpoint" << endl; + cout << "where XSD = path and name of XSD file that defines the MyValue types" << endl; + cout << " endpoint = web service endpoint" << endl; + exit(1); +} diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Makefile.am b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Makefile.am new file mode 100644 index 0000000000..7541093280 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/Makefile.am @@ -0,0 +1,23 @@ +SUBDIRS = MyValueModule Client + +deploy_dir = $(top_builddir)/samples/runtime +deploy_module = $(deploy_dir)/modules/MyValueModule + +install-exec-local: + cp MyValueSubsystem/sca.subsystem $(deploy_dir)/subsystems/MyValueSubsystem + cp MyValueModule/sca.module $(deploy_module) + cp MyValueModule/CustomerInfo.fragment $(deploy_module) + cp MyValueModule/Tuscany-model.config $(deploy_module) + cp MyValueModule/CustomerInfo/CustomerInfoImpl.componentType $(deploy_module)/CustomerInfo + cp MyValueModule/CustomerInfo/.libs/libCustomerInfo.so $(deploy_module)/CustomerInfo + cp MyValueModule/CustomerInfo/CustomerInfo.h $(deploy_module)/CustomerInfo + cp MyValueModule/CustomerInfo/CustomerInfoImpl.h $(deploy_module)/CustomerInfo + cp MyValueModule/MyValue/MyValueImpl.componentType $(deploy_module)/MyValue + cp MyValueModule/MyValue/MyValue.h $(deploy_module)/MyValue + cp MyValueModule/MyValue/MyValueImpl.h $(deploy_module)/MyValue + cp MyValueModule/MyValue/MyValueService.wsdl $(deploy_module)/MyValue + cp MyValueModule/MyValue/.libs/libMyValue.so $(deploy_module)/MyValue + cp MyValueModule/StockQuoteService/StockQuoteService.h $(deploy_module)/StockQuoteService + cp MyValueModule/StockQuoteService/StockQuoteService.wsdl $(deploy_module)/StockQuoteService + + diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo.fragment b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo.fragment new file mode 100755 index 0000000000..b7f79799b5 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo.fragment @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+
+<moduleFragment xmlns="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+ xmlns:mvs="http://www.myvalue.org/MyValueService/"
+ name="CustomerInfoComponent">
+
+
+ <component name="CustomerInfoComponent">
+ <implementation.cpp dll="CustomerInfo/libCustomerInfo.so" header="CustomerInfo/CustomerInfoImpl.h"></implementation.cpp>
+ <properties>
+ <v:Fred>x</v:Fred>
+ <v:Joe>23</v:Joe>
+ <Joe>42</Joe>
+ </properties>
+ <references>
+ </references>
+ </component>
+
+</moduleFragment>
+
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfo.h b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfo.h new file mode 100755 index 0000000000..766fc55fe6 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfo.h @@ -0,0 +1,30 @@ +/* + * + * 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 CustomerInfo_h +#define CustomerInfo_h + +class CustomerInfo +{ +public: + virtual const char* getCustomerInformation(const char* customerID) = 0; + +}; + +#endif diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.componentType b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.componentType new file mode 100755 index 0000000000..52988cb90a --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.componentType @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+
+<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <service name="CustomerInfoService">
+ <interface.cpp header="CustomerInfo/CustomerInfo.h">
+ </interface.cpp>
+ </service>
+
+ <property name="Fred" type="xs:string"/>
+ <property name="Joe" type="xs:integer" many="true"/>
+
+</componentType>
+
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.cpp b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.cpp new file mode 100755 index 0000000000..ed3ff5e2ff --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.cpp @@ -0,0 +1,79 @@ +/* + * + * 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 "CustomerInfoImpl.h" +#include <ostream> +#include <string.h> +#include "osoa/sca/sca.h" +#include "commonj/sdo/DataObjectInstance.h" +using namespace osoa::sca; +using namespace commonj::sdo; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CustomerInfoImpl::CustomerInfoImpl() +{ + cout << "Construct CustomerInfoImpl" << endl; + +} + +CustomerInfoImpl::~CustomerInfoImpl() +{ + cout << "Destroy CustomerInfoImpl" << endl; +} + +////////////////////////////////////////////////////////////////////// +// Other methods +////////////////////////////////////////////////////////////////////// +const char* CustomerInfoImpl::getCustomerInformation(const char* customerID) +{ + cout << "In getCustomerInformation with customerid: " << customerID << endl; + + + + ComponentContext myContext = ComponentContext::getCurrent(); + + DataObjectInstance properties = myContext.getProperties(); + DataObjectInstance props2 = properties; + if (properties) + { + const char* fredVal = properties->getCString("Fred"); + cout << "Property Fred value: " << fredVal <<endl; + + + DataObjectList& joeList = properties->getList("Joe"); + for (int i=0; i<joeList.size();i++) + { + cout << "Property Joe value " << i << ": " << joeList.getInteger(i) <<endl; + } + } + + if (!strcmp("12345", customerID)) + { + return "IBM"; + } + else + { + throw "Wobbler"; + } + + +} diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.h b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.h new file mode 100755 index 0000000000..c943b1d666 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/CustomerInfoImpl.h @@ -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. + */ + +/* $Rev$ $Date$ */ + +#ifndef CustomerInfoImpl_h +#define CustomerInfoImpl_h + +#include "CustomerInfo.h" + + + +class CustomerInfoImpl : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; + +#endif diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/Makefile.am b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/Makefile.am new file mode 100644 index 0000000000..78161c429c --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/CustomerInfo/Makefile.am @@ -0,0 +1,15 @@ +lib_LTLIBRARIES = libCustomerInfo.la + +libCustomerInfo_la_SOURCES = \ +CustomerInfoImpl.cpp \ +CustomerInfoImpl_CustomerInfoService_Proxy.cpp \ +CustomerInfoImpl_CustomerInfoService_Wrapper.cpp + +libCustomerInfo_la_LIBADD = -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo + +INCLUDES = -I.. \ + -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include + +install:
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/Makefile.am b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/Makefile.am new file mode 100644 index 0000000000..7d57c06f3d --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/Makefile.am @@ -0,0 +1,10 @@ +SUBDIRS = CustomerInfo MyValue + +BUILT_SOURCES = scagen + +scagen: + cd $(top_builddir)/bin && \ + ./scagen.sh -dir $(prefix)/samples/MyValue/MyValueModule -output $(prefix)/samples/MyValue/MyValueModule + mv CustomerInfoImpl_* CustomerInfo + mv MyValueImpl_* MyValue + diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/Makefile.am b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/Makefile.am new file mode 100644 index 0000000000..85e1077998 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/Makefile.am @@ -0,0 +1,17 @@ +lib_LTLIBRARIES = libMyValue.la + +libMyValue_la_SOURCES = \ +MyValueImpl.cpp \ +MyValueImpl_customerInfo_Proxy.cpp \ +MyValueImpl_MyValueService_Proxy.cpp \ +MyValueImpl_MyValueService_Wrapper.cpp \ +MyValueImpl_stockQuote_Proxy.cpp + +libMyValue_la_LIBADD = -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo + +INCLUDES = -I.. \ + -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include + +install:
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValue.h b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValue.h new file mode 100755 index 0000000000..3efa7ecc61 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValue.h @@ -0,0 +1,30 @@ +/* + * + * 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 MyValue_h +#define MyValue_h + +#include "commonj/sdo/SDO.h" +using commonj::sdo::DataObjectPtr; + +class MyValue +{ +public: + virtual DataObjectPtr getMyValue(DataObjectPtr inDataObject) = 0; +}; + +#endif diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.componentType b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.componentType new file mode 100755 index 0000000000..16530400b5 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.componentType @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+
+<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9">
+
+ <service name="MyValueService">
+ <interface.cpp header="MyValue/MyValue.h">
+ </interface.cpp>
+ </service>
+
+ <reference name="customerInfo">
+ <interface.cpp header="CustomerInfo/CustomerInfo.h">
+ </interface.cpp>
+ </reference>
+
+ <reference name="stockQuote">
+ <interface.cpp header="StockQuoteService/StockQuoteService.h">
+ </interface.cpp>
+ </reference>
+
+</componentType>
+
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.cpp b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.cpp new file mode 100755 index 0000000000..4a2d64ea6d --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.cpp @@ -0,0 +1,143 @@ +/* + * + * 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. + */ + +// +// MyValueImpl.cpp: implementation of the MyValueImpl class. +// + +#include "commonj/sdo/HelperProvider.h" +#include "commonj/sdo/SDO.h" +#include "osoa/sca/sca.h" +#include "MyValueImpl.h" +#include "CustomerInfo/CustomerInfo.h" +#include "StockQuoteService/StockQuoteService.h" +#include <iostream> + +using namespace std; +using namespace osoa::sca; +using namespace commonj::sdo; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +MyValueImpl::MyValueImpl() +{ + cout << "Construct MyValueImpl" << endl; + +} + +MyValueImpl::~MyValueImpl() +{ + cout << "Destroy MyValueImpl" << endl; +} + +////////////////////////////////////////////////////////////////////// +// Other methods +////////////////////////////////////////////////////////////////////// +DataObjectPtr MyValueImpl::getMyValue(DataObjectPtr inDataObject) +{ + DataObjectPtr responseDO = 0; + + string customerID = inDataObject->getCString("customerID"); + cout << "In getMyValue with customerid: " << customerID << endl; + + // Get the CustomerInfo service. + ComponentContext myContext = ComponentContext::getCurrent(); + CustomerInfo* customerInfoService = (CustomerInfo*)myContext.getService("customerInfo"); + + if (customerInfoService == 0) + { + cout << "Unable to find customer info service" << endl; + + return responseDO; + } + + // Get the name of the stock for customer 'customerID' from the customerInfoService. + const char * stock; + try + { + stock = customerInfoService->getCustomerInformation(customerID.c_str()); + } + catch(const char* x) + { + cout << "Exception caught: " << x <<endl; + throw; + } + + + // Check that we get the same stock back when iterating over the customerInfo services. + ServiceList serviceList = myContext.getServices("customerInfo"); + for (int i=0; i<serviceList.size();i++) + { + CustomerInfo* service = (CustomerInfo*)(serviceList[i]); + stock = service->getCustomerInformation(customerID.c_str()); + cout << "Stock from getServices " << i << " : " << stock <<endl; + + } + + // Use a second SCA reference to get the stock price for the customer's stock. + StockQuoteService* stockQuoteService = (StockQuoteService*)myContext.getService("stockQuote"); + + if (stockQuoteService == 0) + { + cout << "Unable to find stock quote service" << endl; + + return responseDO; + } + + // Create a data object representing the requests (use dynamic API until static is available) + DataObjectPtr stockQuoteRequestDO; + DataFactoryPtr factory; + try + { + // Create the request DO for the StockQuoteService. + factory = myContext.getDataFactory(); + stockQuoteRequestDO = factory->create("http://swanandmokashi.com", "GetQuotes"); + stockQuoteRequestDO->setCString("QuoteTicker", stock); + + // Invoke the StockQuoteService + DataObjectPtr stockQuoteResponseDO = stockQuoteService->GetStockQuotes(stockQuoteRequestDO); + + // DEBUG (Print the response from the StockQuoteService) + XMLHelperPtr xmlHelper = HelperProvider::getXMLHelper(factory);; + XMLDocumentPtr responseDoc = + xmlHelper->createDocument(stockQuoteResponseDO, "http://swanandmokashi.com", "GetQuotesResponse"); + responseDoc->setXMLDeclaration(false); + char *responseXML = xmlHelper->save(responseDoc); + cout << "Response XML from StockQuoteService = " << endl; + cout << responseXML << endl; + cout << endl; + // DEBUG + + // Create the MyValueService response DataObject using the results of the StockQuoteService. + responseDO = factory->create("http://www.myvalue.org/MyValueService/", "getMyValueResponse"); + DataObjectPtr getQuotesResultDO = stockQuoteResponseDO->getDataObject("GetQuotesResult"); + DataObjectList& quoteList = getQuotesResultDO->getList("Quote"); + float fQuote = quoteList[0]->getFloat("StockQuote"); + + responseDO->setFloat("myValue", fQuote); + } + catch (SDORuntimeException sdoE) + { + cout << sdoE; + } + + return responseDO; + +} + diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.h b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.h new file mode 100755 index 0000000000..05aa7066c1 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueImpl.h @@ -0,0 +1,32 @@ +/* + * + * 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 MyValueImpl_h +#define MyValueImpl_h + +#include "MyValue.h" + + +class MyValueImpl : public MyValue +{ +public: + MyValueImpl(); + virtual ~MyValueImpl(); + virtual DataObjectPtr getMyValue(DataObjectPtr inDataObject); +}; + +#endif diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueService.wsdl b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueService.wsdl new file mode 100755 index 0000000000..3bc1a12d5c --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueService.wsdl @@ -0,0 +1,65 @@ +<?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://www.myvalue.org/MyValueService/"
+ targetNamespace="http://www.myvalue.org/MyValueService/">
+ <types>
+ <xs:schema targetNamespace="http://www.myvalue.org/MyValueService/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://www.myvalue.org/MyValueService/"
+ elementFormDefault="qualified">
+
+ <xs:element name="getMyValue">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="customerID" type="xs:string" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="getMyValueResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="myValue" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </xs:schema>
+ </types>
+
+ <message name="getMyValueRequestMsg">
+ <part name="body" element="tns:getMyValue"/>
+ </message>
+
+ <message name="getMyValueResponseMsg">
+ <part name="body" element="tns:getMyValueResponse"/>
+ </message>
+
+ <portType name="MyValueServicePortType">
+ <operation name="getMyValue">
+ <input message="tns:getMyValueRequestMsg"/>
+ <output message="tns:getMyValueResponseMsg"/>
+ </operation>
+ </portType>
+
+ <binding name="MyValueServiceBinding" type="tns:MyValueServicePortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getMyValue">
+ <soap:operation soapAction="MyValueService#getMyValue"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="MyValueService">
+ <port name="MyValueServicePort" binding="tns:MyValueServiceBinding">
+ <soap:address location="http://localhost/axis/MyValueService"/>
+ </port>
+ </service>
+</definitions>
diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueService.xsd b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueService.xsd new file mode 100755 index 0000000000..bf41ea511a --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/MyValue/MyValueService.xsd @@ -0,0 +1,39 @@ + +<!-- + 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. + --> + +<xs:schema targetNamespace="http://www.myvalue.org/MyValueService/" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://www.myvalue.org/MyValueService/" + elementFormDefault="qualified"> + + <xs:element name="getMyValue"> + <xs:complexType> + <xs:sequence> + <xs:element name="customerID" type="xs:string" minOccurs="1"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="getMyValueResponse"> + <xs:complexType> + <xs:sequence> + <xs:element name="myValue" type="xs:float" minOccurs="1"/> + </xs:sequence> + </xs:complexType> + </xs:element> + +</xs:schema> diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/StockQuoteService/StockQuoteService.h b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/StockQuoteService/StockQuoteService.h new file mode 100755 index 0000000000..7da4069bd1 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/StockQuoteService/StockQuoteService.h @@ -0,0 +1,32 @@ +/* + * + * 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 StockQuoteService_h +#define StockQuoteService_h +#include <string> +#include "commonj/sdo/SDO.h" +using std::string; +class StockQuoteService +{ +public: + virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr request) = 0; + +}; + +#endif // StockQuoteService_h diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/StockQuoteService/StockQuoteService.wsdl b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/StockQuoteService/StockQuoteService.wsdl new file mode 100755 index 0000000000..4917cde583 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/StockQuoteService/StockQuoteService.wsdl @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="utf-8" ?>
+<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://swanandmokashi.com"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ targetNamespace="http://swanandmokashi.com"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified"
+ targetNamespace="http://swanandmokashi.com"
+ xmlns:s="http://www.w3.org/2001/XMLSchema">
+ <s:element name="GetQuotes">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+ name="QuoteTicker" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetQuotesResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+ name="GetQuotesResult" type="s0:ArrayOfQuote" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfQuote">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded"
+ name="Quote" type="s0:Quote" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="Quote">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+ name="CompanyName" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="StockTicker" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="StockQuote" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="LastUpdated" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="Change"
+ type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="OpenPrice" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="DayHighPrice" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="DayLowPrice" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="Volume"
+ type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="MarketCap" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+ name="YearRange" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="ArrayOfQuote" nillable="true"
+ type="s0:ArrayOfQuote" />
+ </s:schema>
+ </types>
+ <message name="GetQuotesSoapIn">
+ <part name="parameters" element="s0:GetQuotes" />
+ </message>
+ <message name="GetQuotesSoapOut">
+ <part name="parameters" element="s0:GetQuotesResponse" />
+ </message>
+ <message name="GetQuotesHttpGetIn">
+ <part name="QuoteTicker" type="s:string" />
+ </message>
+ <message name="GetQuotesHttpGetOut">
+ <part name="Body" element="s0:ArrayOfQuote" />
+ </message>
+ <message name="GetQuotesHttpPostIn">
+ <part name="QuoteTicker" type="s:string" />
+ </message>
+ <message name="GetQuotesHttpPostOut">
+ <part name="Body" element="s0:ArrayOfQuote" />
+ </message>
+ <portType name="StockQuotesSoap">
+ <operation name="GetStockQuotes">
+ <input name="GetQuotes" message="s0:GetQuotesSoapIn" />
+ <output name="GetQuotes" message="s0:GetQuotesSoapOut" />
+ </operation>
+ </portType>
+ <portType name="StockQuotesHttpGet">
+ <operation name="GetStockQuotes">
+ <input name="GetQuotes" message="s0:GetQuotesHttpGetIn" />
+ <output name="GetQuotes" message="s0:GetQuotesHttpGetOut" />
+ </operation>
+ </portType>
+ <portType name="StockQuotesHttpPost">
+ <operation name="GetStockQuotes">
+ <input name="GetQuotes" message="s0:GetQuotesHttpPostIn" />
+ <output name="GetQuotes" message="s0:GetQuotesHttpPostOut" />
+ </operation>
+ </portType>
+ <binding name="StockQuotesSoap" type="s0:StockQuotesSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <operation name="GetStockQuotes">
+ <soap:operation
+ soapAction="http://swanandmokashi.com/GetQuotes" style="document" />
+ <input name="GetQuotes">
+ <soap:body use="literal" />
+ </input>
+ <output name="GetQuotes">
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="StockQuotesHttpGet" type="s0:StockQuotesHttpGet">
+ <http:binding verb="GET" />
+ <operation name="GetStockQuotes">
+ <http:operation location="/GetQuotes" />
+ <input name="GetQuotes">
+ <http:urlEncoded />
+ </input>
+ <output name="GetQuotes">
+ <mime:mimeXml part="Body" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="StockQuotesHttpPost" type="s0:StockQuotesHttpPost">
+ <http:binding verb="POST" />
+ <operation name="GetStockQuotes">
+ <http:operation location="/GetQuotes" />
+ <input name="GetQuotes">
+ <mime:content type="application/x-www-form-urlencoded" />
+ </input>
+ <output name="GetQuotes">
+ <mime:mimeXml part="Body" />
+ </output>
+ </operation>
+ </binding>
+ <service name="StockQuotes">
+ <port name="StockQuotesSoap" binding="s0:StockQuotesSoap">
+ <soap:address
+ location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx" />
+ </port>
+ <port name="StockQuotesHttpGet"
+ binding="s0:StockQuotesHttpGet">
+ <http:address
+ location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx" />
+ </port>
+ <port name="StockQuotesHttpPost"
+ binding="s0:StockQuotesHttpPost">
+ <http:address
+ location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx" />
+ </port>
+ </service>
+</definitions>
diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/Tuscany-model.config b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/Tuscany-model.config new file mode 100755 index 0000000000..2667f62990 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/Tuscany-model.config @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ 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.
+ -->
+
+<tuscany-model xmlns="http://org.apache.tuscany/xmlns/cpp/1.0">
+ <wsdl>
+ <file name="StockQuoteService/StockQuoteService.wsdl"/>
+ <file name="MyValue/MyValueService.wsdl"/>
+ </wsdl>
+ <xsd>
+ </xsd>
+</tuscany-model>
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/sca.module b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/sca.module new file mode 100755 index 0000000000..bda42e04bc --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueModule/sca.module @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+ xmlns:mvs="http://www.myvalue.org/MyValueService/"
+ name="MyValueModule">
+
+ <!-- Expose as a web service -->
+ <entryPoint name="MyValueService" multiplicity="1..1">
+ <interface.wsdl interface="MyValue/MyValueService.wsdl" callbackInterface=""></interface.wsdl>
+ <binding.ws port="mvs:MyValueServiceBinding"></binding.ws>
+ <reference>MyValueServiceComponent</reference>
+ </entryPoint>
+
+ <component name="MyValueServiceComponent">
+ <implementation.cpp dll="MyValue/libMyValue.so" header="MyValue/MyValueImpl.h"></implementation.cpp>
+ <properties>
+ </properties>
+ <references>
+ <customerInfo>CustomerInfoComponent</customerInfo>
+ <stockQuote>StockQuoteService</stockQuote>
+ </references>
+ </component>
+
+ <externalService name="StockQuoteService">
+ <interface.cpp header="StockQuoteService/StockQuoteService.h"/>
+ <binding.ws port="http://swanandmokashi.com#wsdl.endpoint(StockQuotes/StockQuotesSoap)"/>
+ </externalService>
+
+ <!--wire>
+ <source.uri>MyValueServiceComponent/customerInfo</source.uri>
+ <target.uri>CustomerInfoComponent</target.uri>
+ </wire-->
+
+</module>
+
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueSubsystem/sca.subsystem b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueSubsystem/sca.subsystem new file mode 100755 index 0000000000..ae858ea331 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/MyValueSubsystem/sca.subsystem @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+
+<subsystem xmlns="http://www.osoa.org/xmlns/sca/0.9"
+
+ name="MyValueSubsystem">
+
+ <moduleComponent name="MyValue" module="MyValueModule">
+
+ </moduleComponent>
+
+</subsystem>
+
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/runMyValueClient.sh b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/runMyValueClient.sh new file mode 100755 index 0000000000..e5feeda1f0 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/runMyValueClient.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +# 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. + + +APFULLDIR=`pwd` + +export SCA4CPP_HOME="$APFULLDIR" +if [ x$SCA4CPP = x ]; then +export TUSCANY_SCACPP="$SCA4CPP_HOME" +fi +echo "Using SCA installed at $SCA4CPP_HOME" + +if [ x$AXISCPP_DEPLOY = x ]; then +echo "AXISCPP_DEPLOY not set" +exit; +fi +echo "Using Axis C++ installed at $AXISCPP_DEPLOY" + +if [ x$XERCES_DEPLOY = x ]; then +echo "XERCES_DEPLOY not set" +exit; +fi +echo "Using Xerces C++ installed at $XERCES_DEPLOY" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set"exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +TEST_ROOT=$SCA4CPP_HOME/runtime/core/test + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH:$AXISCPP_DEPLOY/lib:$XERCES_DEPLOY/lib + +export TUSCANY_SCACPP_SYSTEM_ROOT=$TEST_ROOT/testSCASystem +export TUSCANY_SCACPP_DEFAULT_MODULE=SubSystem1 + +cd $TUSCANY_SCACPP/bin/test +./tuscany_sca_test diff --git a/sca-cpp/branches/cpp-M1/sca/samples/MyValue/server.wsdd b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/server.wsdd new file mode 100755 index 0000000000..8b80b4b6ec --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sca/samples/MyValue/server.wsdd @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- The Entity, wspath in the following internal subset allows setting a path for the webservices location -->
+<!--<!DOCTYPE vars [ <!ENTITY wspath "/Apache2.0.54/Apache2/Axis/webservices/"> ]>-->
+
+<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:C="http://xml.apache.org/axis/wsdd/providers/C" xmlns:CPP="http://xml.apache.org/axis/wsdd/providers/CPP">
+ <globalConfiguration>
+ </globalConfiguration>
+
+ <service name="MyValueService" provider="CPP:DOCUMENT" description="MyValueService">
+ <requestFlow>
+ <handler name="SCAWSHandler" type="C:\Apache2.0.54\Apache2\Axis\handlers\tuscany_sca_axis_handler.dll">
+ <parameter name="targetNamespace" value="http://www.myvalue.org/MyValueService/"/>
+ <parameter name="scaEntryPoint" value="MyValueSubsystem/MyValue/MyValueService"/>
+ </handler>
+ </requestFlow>
+
+ <parameter name="className" value="C:\Apache2.0.54\Apache2\Axis\webservices\tuscany_sca_axis_wrapper.dll"/>
+ <parameter name="allowedMethods" value="getMyValue "/>
+ </service>
+
+</deployment>
|