diff options
Diffstat (limited to '')
26 files changed, 527 insertions, 372 deletions
diff --git a/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/META-INF/sca-contribution.xml index 764030c28e..4064565d41 100644 --- a/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/META-INF/sca-contribution.xml +++ b/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -28,7 +28,8 @@ <import.java package="scatours.trip"/> <import.java package="scatours.tripbooking"/> <import.java package="scatours.travelcatalog"/> - <import.java package="payment.creditcard.ws.impl"/> + <import.java package="payment.creditcard"/> + <import.java package="payment"/> <import.java package="scatours.emailgateway"/> <import.java package="scatours.paymentprocess"/> <import.java package="scatours.shoppingcart"/> diff --git a/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.composite b/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.composite index 53fac26d3e..ae8d4b7ff6 100644 --- a/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.composite +++ b/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.composite @@ -142,37 +142,26 @@ <implementation.java class="scatours.shoppingcart.ShoppingCartImpl"/> <service name="ShoppingCart"> </service> - <!--reference name="paymentProcess"> - <binding.ws uri="http://localhost:8083/PaymentProcess" /> - </reference--> + <reference name="payment"> + <binding.ws uri="http://localhost:8080/Payment" /> + </reference> </component> - <!--component name="PaymentProcessComponent"> - <implementation.bpel process="pp:PaymentProcess"/> - <service name="paymentProcessPartnerLink"> - <interface.wsdl interface="http://www.example.org/PaymentProcess/#wsdl.interface(PaymentProcess)" /> - <binding.ws uri="http://localhost:8080/PaymentProcess" wsdlElement="http://www.example.org/PaymentProcess/#wsdl.service(PaymentProcessService)"/> + <component name="PaymentComponent"> + <implementation.java class="payment.PaymentImpl" /> + <service name="Payment"> + <binding.ws uri="http://localhost:8080/Payment" /> </service> - <reference name="creditCardPaymentPartnerLink"> - <binding.ws uri="http://localhost:8081/CreditCardPayment"/> + <reference name="creditCardPayment"> + <binding.ws uri="http://localhost:8080/CreditCardPayment" /> </reference> - <reference name="emailGatewayPartnerLink"> - <binding.ws uri="http://localhost:8082/EmailGateway"/> - </reference> - </component> - - <component name="CreditCardPaymentWS"> - <implementation.java class="payment.creditcard.ws.impl.CreditCardPaymentWSImpl" /> - <service name="CreditCardPayment"> - <binding.ws uri="http://localhost:8081/CreditCardPayment" /> - </service> - </component> + </component> - <component name="EmailGateway"> - <implementation.java class="scatours.emailgateway.EmailGatewayImpl" /> - <service name="EmailGateway"> - <binding.ws uri="http://localhost:8082/EmailGateway" /> + <component name="CreditCardPaymentComponent"> + <implementation.java class="payment.creditcard.CreditCardPaymentImpl" /> + <service name="CreditCardPayment"> + <binding.ws uri="http://localhost:8080/CreditCardPayment" /> </service> - </component--> + </component> </composite> diff --git a/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.html b/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.html index f4206548c0..b8e27e87fc 100644 --- a/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.html +++ b/sandbox/travelsample/chapter-05/ui-contribution/src/main/resources/scatours.html @@ -322,7 +322,8 @@ function checkout() { scaToursCart.checkout(cartId); - document.getElementById('searchResponse').innerHTML = ""; + document.getElementById('packagedTripItems').innerHTML = ""; + document.getElementById('bespokeTripItems').innerHTML = ""; document.getElementById('cartItems').innerHTML = "Thank you for shopping with SCA Tours"; document.getElementById('cartPrice').innerHTML = ""; searchResponseItems = null; diff --git a/sandbox/travelsample/chapter-06/node/build.xml b/sandbox/travelsample/chapter-06/node/build.xml index 05d7479267..0ccfcedee1 100644 --- a/sandbox/travelsample/chapter-06/node/build.xml +++ b/sandbox/travelsample/chapter-06/node/build.xml @@ -22,14 +22,15 @@ <target name="compile"> <mkdir dir="target/classes"/> <javac destdir="target/classes" debug="on" source="1.5" target="1.5"> - <src path="src"/> + <src path="src\main\java"/> <classpath> <fileset refid="tuscany.jars"/> <fileset refid="3rdparty.jars"/> </classpath> </javac> <copy todir="target/classes"> - <fileset dir="." excludes="**/*.java, pom.xml, build.xml, target"/> + <fileset dir="src\main\resources"/> + <fileset dir="src\main\resources"/> </copy> <jar destfile="target/scatours-chapter-06-node.jar" basedir="target/classes"> <manifest> @@ -57,83 +58,78 @@ </target> <fileset id="tuscany.jars" dir="../../modules"> - <include name="tuscany-assembly-1.4.jar"/> - <include name="tuscany-assembly-xml-1.4.jar"/> - <include name="tuscany-assembly-xsd-1.4.jar"/> - <include name="tuscany-binding-atom-1.4.jar"/> - <include name="tuscany-binding-atom-abdera-1.4.jar"/> - <include name="tuscany-binding-ejb-1.4.jar"/> - <include name="tuscany-binding-ejb-runtime-1.4.jar"/> - <include name="tuscany-binding-http-1.4.jar"/> - <include name="tuscany-binding-http-runtime-1.4.jar"/> - <include name="tuscany-binding-jsonrpc-1.4.jar"/> - <include name="tuscany-binding-jsonrpc-runtime-1.4.jar"/> - <include name="tuscany-binding-sca-1.4.jar"/> - <include name="tuscany-binding-sca-axis2-1.4.jar"/> - <include name="tuscany-binding-sca-xml-1.4.jar"/> - <include name="tuscany-binding-ws-1.4.jar"/> - <include name="tuscany-binding-ws-axis2-1.4.jar"/> - <include name="tuscany-binding-ws-axis2-policy-1.4.jar"/> - <include name="tuscany-binding-ws-wsdlgen-1.4.jar"/> - <include name="tuscany-binding-ws-xml-1.4.jar"/> - <include name="tuscany-contribution-1.4.jar"/> - <include name="tuscany-contribution-impl-1.4.jar"/> - <include name="tuscany-contribution-java-1.4.jar"/> - <include name="tuscany-contribution-namespace-1.4.jar"/> - <include name="tuscany-contribution-resource-1.4.jar"/> - <include name="tuscany-contribution-xml-1.4.jar"/> - <include name="tuscany-core-1.4.jar"/> - <include name="tuscany-core-databinding-1.4.jar"/> - <include name="tuscany-core-spi-1.4.jar"/> - <include name="tuscany-data-api-1.4.jar"/> - <include name="tuscany-databinding-1.4.jar"/> - <include name="tuscany-databinding-axiom-1.4.jar"/> - <include name="tuscany-databinding-jaxb-1.4.jar"/> - <include name="tuscany-databinding-jaxb-axiom-1.4.jar"/> - <include name="tuscany-databinding-json-1.4.jar"/> - <include name="tuscany-databinding-sdo-1.4.jar"/> - <include name="tuscany-definitions-1.4.jar"/> - <include name="tuscany-definitions-xml-1.4.jar"/> - <include name="tuscany-domain-manager-1.4.jar"/> - <include name="tuscany-endpoint-1.4.jar"/> - <include name="tuscany-extensibility-1.4.jar"/> - <include name="tuscany-host-embedded-1.4.jar"/> - <include name="tuscany-host-http-1.4.jar"/> - <include name="tuscany-host-jetty-1.4.jar"/> - <include name="tuscany-implementation-bpel-1.4.jar"/> - <include name="tuscany-implementation-bpel-ode-1.4.jar"/> - <include name="tuscany-implementation-ejb-1.4.jar"/> - <include name="tuscany-implementation-java-1.4.jar"/> - <include name="tuscany-implementation-java-runtime-1.4.jar"/> - <include name="tuscany-implementation-java-xml-1.4.jar"/> - <include name="tuscany-implementation-node-1.4.jar"/> - <include name="tuscany-implementation-node-runtime-1.4.jar"/> - <include name="tuscany-implementation-resource-1.4.jar"/> - <include name="tuscany-implementation-resource-runtime-1.4.jar"/> - <include name="tuscany-implementation-widget-1.4.jar"/> - <include name="tuscany-implementation-widget-runtime-1.4.jar"/> - <include name="tuscany-interface-1.4.jar"/> - <include name="tuscany-interface-java-1.4.jar"/> - <include name="tuscany-interface-java-jaxws-1.4.jar"/> - <include name="tuscany-interface-java-xml-1.4.jar"/> - <include name="tuscany-interface-wsdl-1.4.jar"/> - <include name="tuscany-interface-wsdl-xml-1.4.jar"/> - <include name="tuscany-monitor-1.4.jar"/> - <include name="tuscany-node-api-1.4.jar"/> - <include name="tuscany-node-impl-1.4.jar"/> - <include name="tuscany-node-launcher-1.4.jar"/> - <include name="tuscany-node-manager-1.4.jar"/> - <include name="tuscany-policy-1.4.jar"/> - <include name="tuscany-policy-security-1.4.jar"/> - <include name="tuscany-policy-xml-1.4.jar"/> - <include name="tuscany-policy-xml-ws-1.4.jar"/> - <include name="tuscany-sca-api-1.4.jar"/> - <include name="tuscany-sca-api-extension-1.4.jar"/> - <include name="tuscany-workspace-1.4.jar"/> - <include name="tuscany-workspace-impl-1.4.jar"/> - <include name="tuscany-workspace-xml-1.4.jar"/> - <include name="tuscany-xsd-1.4.jar"/> - <include name="tuscany-xsd-xml-1.4.jar"/> + <include name="tuscany-assembly-1.5-SNAPSHOT.jar"/> + <include name="tuscany-assembly-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-assembly-xsd-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-atom-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-atom-abdera-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-http-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-http-runtime-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-jsonrpc-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-jsonrpc-runtime-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-sca-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-sca-axis2-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-sca-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-axis2-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-axis2-policy-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-wsdlgen-1.5-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-contribution-1.5-SNAPSHOT.jar"/> + <include name="tuscany-contribution-impl-1.5-SNAPSHOT.jar"/> + <include name="tuscany-contribution-java-1.5-SNAPSHOT.jar"/> + <include name="tuscany-contribution-namespace-1.5-SNAPSHOT.jar"/> + <include name="tuscany-contribution-resource-1.5-SNAPSHOT.jar"/> + <include name="tuscany-contribution-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-core-1.5-SNAPSHOT.jar"/> + <include name="tuscany-core-databinding-1.5-SNAPSHOT.jar"/> + <include name="tuscany-core-spi-1.5-SNAPSHOT.jar"/> + <include name="tuscany-data-api-1.5-SNAPSHOT.jar"/> + <include name="tuscany-databinding-1.5-SNAPSHOT.jar"/> + <include name="tuscany-databinding-axiom-1.5-SNAPSHOT.jar"/> + <include name="tuscany-databinding-jaxb-1.5-SNAPSHOT.jar"/> + <include name="tuscany-databinding-jaxb-axiom-1.5-SNAPSHOT.jar"/> + <include name="tuscany-databinding-json-1.5-SNAPSHOT.jar"/> + <include name="tuscany-definitions-1.5-SNAPSHOT.jar"/> + <include name="tuscany-definitions-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-domain-manager-1.5-SNAPSHOT.jar"/> + <include name="tuscany-endpoint-1.5-SNAPSHOT.jar"/> + <include name="tuscany-extensibility-1.5-SNAPSHOT.jar"/> + <include name="tuscany-host-embedded-1.5-SNAPSHOT.jar"/> + <include name="tuscany-host-http-1.5-SNAPSHOT.jar"/> + <include name="tuscany-host-jetty-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-java-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-java-runtime-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-java-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-node-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-node-runtime-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-resource-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-resource-runtime-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-spring-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-widget-1.5-SNAPSHOT.jar"/> + <include name="tuscany-implementation-widget-runtime-1.5-SNAPSHOT.jar"/> + <include name="tuscany-interface-1.5-SNAPSHOT.jar"/> + <include name="tuscany-interface-java-1.5-SNAPSHOT.jar"/> + <include name="tuscany-interface-java-jaxws-1.5-SNAPSHOT.jar"/> + <include name="tuscany-interface-java-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-interface-wsdl-1.5-SNAPSHOT.jar"/> + <include name="tuscany-interface-wsdl-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-monitor-1.5-SNAPSHOT.jar"/> + <include name="tuscany-node-api-1.5-SNAPSHOT.jar"/> + <include name="tuscany-node-impl-1.5-SNAPSHOT.jar"/> + <include name="tuscany-node-launcher-1.5-SNAPSHOT.jar"/> + <include name="tuscany-node-manager-1.5-SNAPSHOT.jar"/> + <include name="tuscany-policy-1.5-SNAPSHOT.jar"/> + <include name="tuscany-policy-security-1.5-SNAPSHOT.jar"/> + <include name="tuscany-policy-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-policy-xml-ws-1.5-SNAPSHOT.jar"/> + <include name="tuscany-sca-api-1.5-SNAPSHOT.jar"/> + <include name="tuscany-sca-api-extension-1.5-SNAPSHOT.jar"/> + <include name="tuscany-workspace-1.5-SNAPSHOT.jar"/> + <include name="tuscany-workspace-impl-1.5-SNAPSHOT.jar"/> + <include name="tuscany-workspace-xml-1.5-SNAPSHOT.jar"/> + <include name="tuscany-xsd-1.5-SNAPSHOT.jar"/> + <include name="tuscany-xsd-xml-1.5-SNAPSHOT.jar"/> </fileset> <fileset id="3rdparty.jars" dir="../../lib"> <include name="XmlSchema-1.4.2.jar"/> @@ -146,13 +142,12 @@ <include name="abdera-parser-0.4.0-incubating.jar"/> <include name="abdera-server-0.4.0-incubating.jar"/> <include name="activation-1.1.jar"/> - <include name="activeio-2.0-r118.jar"/> <include name="annogen-0.1.0.jar"/> + <include name="aopalliance-1.0.jar"/> <include name="asm-all-3.1.jar"/> <include name="axiom-api-1.2.7.jar"/> <include name="axiom-dom-1.2.7.jar"/> <include name="axiom-impl-1.2.7.jar"/> - <include name="axion-1.0-M3-dev.jar"/> <include name="axis-ant-1.4.jar"/> <include name="axis2-adb-1.4.1.jar"/> <include name="axis2-codegen-1.4.1.jar"/> @@ -161,59 +156,26 @@ <include name="axis2-mtompolicy-1.4.1.jar"/> <include name="backport-util-concurrent-3.1.jar"/> <include name="bcprov-jdk13-132.jar"/> - <include name="cglib-nodep-2.1_3.jar"/> - <include name="common-2.2.3.jar"/> + <include name="cglib-nodep-2.2.jar"/> <include name="commons-codec-1.3.jar"/> <include name="commons-collections-3.1.jar"/> <include name="commons-discovery-0.2.jar"/> <include name="commons-fileupload-1.2.jar"/> <include name="commons-httpclient-3.1.jar"/> <include name="commons-io-1.4.jar"/> - <include name="commons-jexl-1.1.jar"/> - <include name="commons-lang-2.1.jar"/> <include name="commons-logging-1.1.1.jar"/> - <include name="commons-primitives-1.0.jar"/> <include name="derby-10.3.1.4.jar"/> - <include name="dom4j-1.6.1.jar"/> - <include name="ecore-2.2.3.jar"/> - <include name="ecore-change-2.2.3.jar"/> - <include name="ecore-xmi-2.2.3.jar"/> <include name="geronimo-activation_1.1_spec-1.0.1.jar"/> - <include name="geronimo-common-1.2-beta.jar"/> - <include name="geronimo-commonj_1.1_spec-1.0.jar"/> - <include name="geronimo-connector-1.2-beta.jar"/> - <include name="geronimo-core-1.2-beta.jar"/> - <include name="geronimo-deployment-1.2-beta.jar"/> - <include name="geronimo-ejb_3.0_spec-1.0.jar"/> - <include name="geronimo-interceptor-1.2-beta.jar"/> - <include name="geronimo-j2ee-1.2-beta.jar"/> - <include name="geronimo-j2ee-connector_1.5_spec-1.1.jar"/> - <include name="geronimo-j2ee-jacc_1.0_spec-1.1.jar"/> - <include name="geronimo-j2ee-management_1.0_spec-1.1.jar"/> <include name="geronimo-javamail_1.4_spec-1.2.jar"/> <include name="geronimo-jms_1.1_spec-1.1.jar"/> - <include name="geronimo-jpa_3.0_spec-1.0.jar"/> - <include name="geronimo-jta_1.0.1B_spec-1.0.jar"/> - <include name="geronimo-kernel-1.2-beta.jar"/> - <include name="geronimo-management-1.2-beta.jar"/> - <include name="geronimo-naming-1.2-beta.jar"/> - <include name="geronimo-security-1.2-beta.jar"/> - <include name="geronimo-spec-j2ee-connector-1.5-rc4.jar"/> - <include name="geronimo-spec-jta-1.0.1B-rc4.jar"/> <include name="geronimo-stax-api_1.0_spec-1.0.1.jar"/> - <include name="geronimo-system-1.2-beta.jar"/> - <include name="geronimo-transaction-1.2-beta.jar"/> - <include name="geronimo-util-1.2-beta.jar"/> - <include name="howl-1.0.1-1.jar"/> <include name="htmlparser-1.0.5.jar"/> <include name="httpcore-4.0-beta1.jar"/> <include name="httpcore-nio-4.0-beta1.jar"/> - <include name="javacc-3.2.jar"/> <include name="jaxb-api-2.1.jar"/> <include name="jaxb-impl-2.1.7.jar"/> <include name="jaxen-1.1.1.jar"/> <include name="jaxws-api-2.1.jar"/> - <include name="jdom-1.0.jar"/> <include name="jettison-1.0.1.jar"/> <include name="jetty-6.1.7.jar"/> <include name="jetty-util-6.1.7.jar"/> @@ -221,54 +183,29 @@ <include name="jsr181-api-1.0-MR1.jar"/> <include name="jsr250-api-1.0.jar"/> <include name="junit-4.5.jar"/> - <include name="log4j-1.2.13.jar"/> + <include name="log4j-1.2.15.jar"/> <include name="mail-1.4.jar"/> <include name="mex-1.41-impl.jar"/> <include name="neethi-2.0.4.jar"/> - <include name="ode-bpel-api-1.1.1.jar"/> - <include name="ode-bpel-compiler-1.1.1.jar"/> - <include name="ode-bpel-dao-1.1.1.jar"/> - <include name="ode-bpel-epr-1.1.1.jar"/> - <include name="ode-bpel-obj-1.1.1.jar"/> - <include name="ode-bpel-runtime-1.1.1.jar"/> - <include name="ode-bpel-schemas-1.1.1.jar"/> - <include name="ode-bpel-store-1.1.1.jar"/> - <include name="ode-dao-jpa-1.1.1.jar"/> - <include name="ode-jacob-1.1.1.jar"/> - <include name="ode-jacob-ap-1.1.1.jar"/> - <include name="ode-scheduler-simple-1.1.1.jar"/> - <include name="ode-utils-1.1.1.jar"/> - <include name="openjpa-all-0.9.7-incubating.jar"/> - <include name="openjpa-persistence-0.9.7-incubating.jar"/> <include name="opensaml-1.1.jar"/> <include name="rampart-core-1.4.jar"/> <include name="rampart-policy-1.4.jar"/> <include name="rampart-trust-1.4.jar"/> - <include name="regexp-1.3.jar"/> - <include name="saxon-8.7.jar"/> - <include name="saxon-dom-8.7.jar"/> - <include name="saxon-xpath-8.7.jar"/> - <include name="serp-1.12.0.jar"/> <include name="servlet-api-2.5.jar"/> + <include name="spring-beans-2.5.5.jar"/> + <include name="spring-context-2.5.5.jar"/> + <include name="spring-core-2.5.5.jar"/> <include name="stax-api-1.0-2.jar"/> - <include name="tranql-connector-1.1.jar"/> - <include name="tuscany-sdo-api-r2.1-1.1.1.jar"/> - <include name="tuscany-sdo-impl-1.1.1.jar"/> - <include name="tuscany-sdo-lib-1.1.1.jar"/> <include name="woden-api-1.0M8.jar"/> <include name="woden-impl-dom-1.0M8.jar"/> <include name="wsdl4j-1.6.2.jar"/> <include name="wss4j-1.5.4.jar"/> <include name="wstx-asl-3.2.4.jar"/> <include name="xalan-2.7.0.jar"/> - <include name="xbean-naming-2.7.jar"/> <include name="xercesImpl-2.8.1.jar"/> <include name="xml-apis-1.3.03.jar"/> - <include name="xml-resolver-1.1.jar"/> <include name="xmlParserAPIs-2.6.0.jar"/> - <include name="xmlbeans-2.3.0.jar"/> <include name="xmlsec-1.4.2.jar"/> - <include name="xsd-2.2.3.jar"/> </fileset> </project> diff --git a/sandbox/travelsample/chapter-06/node/pom.xml b/sandbox/travelsample/chapter-06/node/pom.xml index 61c8b43b94..5319b87630 100644 --- a/sandbox/travelsample/chapter-06/node/pom.xml +++ b/sandbox/travelsample/chapter-06/node/pom.xml @@ -22,7 +22,7 @@ <parent> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-sca</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <!--relativePath>../../pom.xml</relativePath--> </parent> <artifactId>scatours-chapter-06-node</artifactId> @@ -32,103 +32,89 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-node-api</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-node-launcher</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-domain-manager</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-node-runtime</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-widget-runtime</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-resource-runtime</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-binding-http-runtime</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-binding-ws-axis2</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-binding-sca-axis2</artifactId> - <version>1.4</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-ejb-runtime</artifactId> - <version>1.4</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-ejb</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-bpel-ode</artifactId> - <version>1.4</version> + <artifactId>tuscany-implementation-spring</artifactId> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> @@ -147,7 +133,7 @@ <plugin> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-maven-ant-generator</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <executions> <execution> <configuration> @@ -159,6 +145,42 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <!-- http://jira.codehaus.org/browse/SUREFIRE-322 --> + <version>2.3.1</version> + <configuration> + <useFile>false</useFile> + <trimStackTrace>false</trimStackTrace> + <useSystemClassLoader>true</useSystemClassLoader> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack</id> + <phase>test-compile</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.apache.ode</groupId> + <artifactId>ode-dao-jpa-ojpa-derby</artifactId> + <version>1.1</version> + <type>zip</type> + <overWrite>true</overWrite> + <outputDirectory>${project.build.directory}/test-classes/</outputDirectory> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> </project> diff --git a/sandbox/travelsample/chapter-06/node/src/main/java/scatours/LaunchNode.java b/sandbox/travelsample/chapter-06/node/src/main/java/scatours/LaunchBPELExampleNode.java index 777963c13e..e87b0ca44e 100644 --- a/sandbox/travelsample/chapter-06/node/src/main/java/scatours/LaunchNode.java +++ b/sandbox/travelsample/chapter-06/node/src/main/java/scatours/LaunchBPELExampleNode.java @@ -24,11 +24,10 @@ import java.io.IOException; import org.apache.tuscany.sca.node.SCAContribution; import org.apache.tuscany.sca.node.SCANode; import org.apache.tuscany.sca.node.SCANodeFactory; -import org.apache.tuscany.sca.node.launcher.NodeLauncher; -public class LaunchNode { +public class LaunchBPELExampleNode { public static void main(String[] args) throws Exception { - LaunchNode.launchFromFileSystemDir(); + LaunchBPELExampleNode.launchFromFileSystemDir(); } // OK for development but you must launch the node from this module @@ -45,11 +44,12 @@ public class LaunchNode { new SCAContribution("trip", "../../shared-contributions/trip-contribution/target/classes"), new SCAContribution("tripbooking", "../../shared-contributions/tripbooking-contribution/target/classes"), new SCAContribution("travelcatalog", "../../shared-contributions/travelcatalog-contribution/target/classes"), - new SCAContribution("payment", "../../shared-contributions/payment-contribution/target/classes"), + new SCAContribution("creditcardpayment", "../../shared-contributions/creditcard-payment-jaxb-contribution/target/classes"), new SCAContribution("emailgateway", "../../shared-contributions/emailgateway-contribution/target/classes"), new SCAContribution("shoppingcart", "../../shared-contributions/shoppingcart-contribution/target/classes"), new SCAContribution("scatours", "../../shared-contributions/scatours-contribution/target/classes"), - new SCAContribution("ui", "../ui-contribution/target/classes")); + new SCAContribution("payment", "../payment-bpel-contribution/target/classes"), + new SCAContribution("ui", "../ui-bpel-contribution/target/classes")); node.start(); System.out.println("Node started - Press enter to shutdown."); diff --git a/sandbox/travelsample/chapter-06/node/src/main/java/scatours/LaunchSpringExampleNode.java b/sandbox/travelsample/chapter-06/node/src/main/java/scatours/LaunchSpringExampleNode.java new file mode 100644 index 0000000000..45c9be4bce --- /dev/null +++ b/sandbox/travelsample/chapter-06/node/src/main/java/scatours/LaunchSpringExampleNode.java @@ -0,0 +1,66 @@ +/* + * 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. + */ + +package scatours; + +import java.io.IOException; + +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class LaunchSpringExampleNode { + public static void main(String[] args) throws Exception { + LaunchSpringExampleNode.launchFromFileSystemDir(); + } + + // OK for development but you must launch the node from this module + public static void launchFromFileSystemDir(){ + SCANode node = null; + + try { + node = SCANodeFactory.newInstance().createSCANode("scatours.composite", + new SCAContribution("common", "../../shared-contributions/common-contribution/target/classes"), + new SCAContribution("currency", "../../shared-contributions/currency-contribution/target/classes"), + new SCAContribution("hotel", "../../shared-contributions/hotel-contribution/target/classes"), + new SCAContribution("flight", "../../shared-contributions/flight-contribution/target/classes"), + new SCAContribution("car", "../../shared-contributions/car-contribution/target/classes"), + new SCAContribution("trip", "../../shared-contributions/trip-contribution/target/classes"), + new SCAContribution("tripbooking", "../../shared-contributions/tripbooking-contribution/target/classes"), + new SCAContribution("travelcatalog", "../../shared-contributions/travelcatalog-contribution/target/classes"), + new SCAContribution("creditcardpayment", "../../shared-contributions/creditcard-payment-jaxb-contribution/target/classes"), + new SCAContribution("emailgateway", "../../shared-contributions/emailgateway-contribution/target/classes"), + new SCAContribution("shoppingcart", "../../shared-contributions/shoppingcart-contribution/target/classes"), + new SCAContribution("scatours", "../../shared-contributions/scatours-contribution/target/classes"), + new SCAContribution("payment", "../payment-spring-annotation-contribution/target/classes"), + new SCAContribution("ui", "../ui-spring-contribution/target/classes")); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) {} + + node.stop(); + + } catch (Exception ex) { + System.out.println(ex.toString()); + } + } +} diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/pom.xml b/sandbox/travelsample/chapter-06/payment-bpel-contribution/pom.xml index db486b6727..e30d8b7ff2 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/pom.xml +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/pom.xml @@ -22,7 +22,7 @@ <parent> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-sca</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <!--relativePath>../../pom.xml</relativePath--> </parent> <artifactId>scatours-chapter-06-payment-bpel-contribution</artifactId> @@ -32,55 +32,55 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-node-api</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-node-impl</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-bpel-ode</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-binding-ws-axis2</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-host-jetty</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>scatours-emailgateway-contribution</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>scatours-creditcard-payment-jaxb-contribution</artifactId> - <version>1.4</version> + <version>1.5-SNAPSHOT</version> <scope>test</scope> </dependency> @@ -169,7 +169,7 @@ <version>1.1</version> <type>zip</type> <overWrite>true</overWrite> - <outputDirectory>${project.build.directory}/test-classes/</outputDirectory> + <outputDirectory>${project.build.directory}/classes/</outputDirectory> </artifactItem> </artifactItems> </configuration> diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/CreditCardPayment.wsdl b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/CreditCardPayment.wsdl index a90c73cdfb..22ef6de317 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/CreditCardPayment.wsdl +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/CreditCardPayment.wsdl @@ -18,17 +18,17 @@ * under the License. --> <wsdl:definitions name="CreditCardPayment" - targetNamespace="http://www.example.org/CreditCardPayment/" + targetNamespace="http://www.tuscanyscatours.com/CreditCardPayment/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:tns="http://www.example.org/CreditCardPayment/" + xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://www.example.org/CreditCardPayment/" - xmlns:tns="http://www.example.org/CreditCardPayment/" + targetNamespace="http://www.tuscanyscatours.com/CreditCardPayment/" + xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/" elementFormDefault="unqualified"> <xsd:element name="authorize" type="tns:AuthorizeType"/> @@ -96,7 +96,7 @@ <wsdl:binding name="CreditCardPaymentBinding" type="tns:CreditCardPayment"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="authorize"> - <soap:operation soapAction="http://www.example.org/CreditCardPayment/authorize" /> + <soap:operation soapAction="http://www.tuscanyscatours.com/CreditCardPayment/authorize" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/EmailGateway.wsdl b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/EmailGateway.wsdl index d9a5e36bc0..a097d9b7e4 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/EmailGateway.wsdl +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/EmailGateway.wsdl @@ -18,17 +18,17 @@ * under the License. --> <wsdl:definitions name="EmailGateway" - targetNamespace="http://www.example.org/EmailGateway/" + targetNamespace="http://www.tuscanyscatours.com/EmailGateway/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:tns="http://www.example.org/EmailGateway/" + xmlns:tns="http://www.tuscanyscatours.com/EmailGateway/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://www.example.org/EmailGateway/" - xmlns:tns="http://www.example.org/EmailGateway/"> + targetNamespace="http://www.tuscanyscatours.com/EmailGateway/" + xmlns:tns="http://www.tuscanyscatours.com/EmailGateway/"> <xsd:element name="sendEmail" type="tns:SendEmailType"/> <xsd:complexType name="SendEmailType"> @@ -68,7 +68,7 @@ <wsdl:binding name="EmailGatwayBinding" type="tns:EmailGateway"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="sendEmail"> - <soap:operation soapAction="http://www.example.org/EmailGateway/sendEmail" /> + <soap:operation soapAction="http://www.tuscanyscatours.com/EmailGateway/sendEmail" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml index 6ce6568b62..725c95a2bd 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -18,6 +18,6 @@ * under the License. --> <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"> - <export.java package="scatours.payment"/> - <export namespace="http://www.example.org/Payment"/> + <export namespace="http://www.tuscanyscatours.com/Payment"/> + <export namespace="http://www.tuscanyscatours.com/Payment/"/> </contribution>
\ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/Payment.wsdl b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/Payment.wsdl index 399b550334..e2c4062f2e 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/Payment.wsdl +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/Payment.wsdl @@ -18,51 +18,51 @@ * under the License. --> <wsdl:definitions name="Payment" - targetNamespace="http://www.example.org/Payment/" + targetNamespace="http://www.tuscanyscatours.com/Payment/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:tns="http://www.example.org/Payment/" + xmlns:tns="http://www.tuscanyscatours.com/Payment/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://www.example.org/Payment/" - xmlns:tns="http://www.example.org/Payment/"> + targetNamespace="http://www.tuscanyscatours.com/Payment/" + xmlns:tns="http://www.tuscanyscatours.com/Payment/"> - <xsd:complexType name="MakePaymentType"> + <xsd:complexType name="MakePaymentMemberType"> <xsd:sequence> <xsd:element name="CustomerId" type="xsd:string"></xsd:element> <xsd:element name="Amount" type="xsd:float"></xsd:element> </xsd:sequence> </xsd:complexType> - <xsd:element name="makePayment" type="tns:MakePaymentType"/> + <xsd:element name="makePaymentMember" type="tns:MakePaymentMemberType"/> - <xsd:complexType name="MakePaymentResponseType"> + <xsd:complexType name="MakePaymentMemberResponseType"> <xsd:sequence> <xsd:element name="Status" type="xsd:string"></xsd:element> </xsd:sequence> </xsd:complexType> - <xsd:element name="makePaymentResponse" type="tns:MakePaymentResponseType"/> + <xsd:element name="makePaymentMemberResponse" type="tns:MakePaymentMemberResponseType"/> </xsd:schema> </wsdl:types> - <wsdl:message name="MakePaymentRequest"> - <wsdl:part name="parameters" element="tns:makePayment"></wsdl:part> + <wsdl:message name="MakePaymentMemberRequest"> + <wsdl:part name="parameters" element="tns:makePaymentMember"></wsdl:part> </wsdl:message> - <wsdl:message name="MakePaymentResponse"> - <wsdl:part name="parameters" element="tns:makePaymentResponse"></wsdl:part> + <wsdl:message name="MakePaymentMemberResponse"> + <wsdl:part name="parameters" element="tns:makePaymentMemberResponse"></wsdl:part> </wsdl:message> <wsdl:portType name="Payment"> - <wsdl:operation name="makePayment"> - <wsdl:input message="tns:MakePaymentRequest"></wsdl:input> - <wsdl:output message="tns:MakePaymentResponse"></wsdl:output> + <wsdl:operation name="makePaymentMember"> + <wsdl:input message="tns:MakePaymentMemberRequest"></wsdl:input> + <wsdl:output message="tns:MakePaymentMemberResponse"></wsdl:output> </wsdl:operation> </wsdl:portType> <wsdl:binding name="PaymentBinding" type="tns:Payment"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="makePayment"> - <soap:operation soapAction="http://www.example.org/Payment/makePayment" /> + <wsdl:operation name="makePaymentMember"> + <soap:operation soapAction="http://www.tuscanyscatours.com/Payment/makePayment" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> @@ -73,7 +73,7 @@ </wsdl:binding> <wsdl:service name="PaymentService"> <wsdl:port name="PaymentPort" binding="tns:PaymentBinding"> - <soap:address location="http://localhost:8083/Payment" /> + <soap:address location="http://localhost:8080/Payment" /> </wsdl:port> </wsdl:service> diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/payment.bpel b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/payment.bpel index 25c10d43a7..8f11d76888 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/payment.bpel +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/main/resources/payment.bpel @@ -17,29 +17,29 @@ ~ under the License. --> <process name="Payment" - targetNamespace="http://www.example.org/Payment" + targetNamespace="http://www.tuscanyscatours.com/Payment" xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" xmlns:tns="http://tuscany.apache.org/Payment" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:pp="http://www.example.org/Payment/" - xmlns:ccp="http://www.example.org/CreditCardPayment/" - xmlns:eg="http://www.example.org/EmailGateway/" + xmlns:pp="http://www.tuscanyscatours.com/Payment/" + xmlns:ccp="http://www.tuscanyscatours.com/CreditCardPayment/" + xmlns:eg="http://www.tuscanyscatours.com/EmailGateway/" queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"> <import location="Payment.wsdl" importType="http://schemas.xmlsoap.org/wsdl/" - namespace="http://www.example.org/Payment/"/> + namespace="http://www.tuscanyscatours.com/Payment/"/> <import location="CreditCardPayment.wsdl" importType="http://schemas.xmlsoap.org/wsdl/" - namespace="http://www.example.org/CreditCardPayment/"/> + namespace="http://www.tuscanyscatours.com/CreditCardPayment/"/> <import location="EmailGateway.wsdl" importType="http://schemas.xmlsoap.org/wsdl/" - namespace="http://www.example.org/EmailGateway/"/> + namespace="http://www.tuscanyscatours.com/EmailGateway/"/> <partnerLinks> <partnerLink name="paymentPartnerLink" partnerLinkType="pp:PaymentLinkType" myRole="forward" /> @@ -48,8 +48,8 @@ </partnerLinks> <variables> - <variable name="makePaymentRequestMessage" messageType="pp:MakePaymentRequest"/> - <variable name="makePaymentResponseMessage" messageType="pp:MakePaymentResponse"/> + <variable name="makePaymentMemberRequestMessage" messageType="pp:MakePaymentMemberRequest"/> + <variable name="makePaymentMemberResponseMessage" messageType="pp:MakePaymentMemberResponse"/> <variable name="authorizeRequestMessage" messageType="ccp:AuthorizeRequest"/> <variable name="authorizeResponseMessage" messageType="ccp:AuthorizeResponse"/> <variable name="sendEmailRequestMessage" messageType="eg:SendEmailRequest"/> @@ -60,8 +60,8 @@ <receive name="start" partnerLink="paymentPartnerLink" portType="pp:Payment" - operation="makePayment" - variable="makePaymentRequestMessage" + operation="makePaymentMember" + variable="makePaymentMemberRequestMessage" createInstance="yes"/> <!-- set up call to payments service --> @@ -69,7 +69,7 @@ <copy> <from> <literal> - <authorize xmlns="http://www.example.org/CreditCardPayment/"> + <authorize xmlns="http://www.tuscanyscatours.com/CreditCardPayment/"> <CreditCard xmlns=""> <CreditCardType>Visa</CreditCardType> <CreditCardNumber>12345678</CreditCardNumber> @@ -93,11 +93,11 @@ <to>$authorizeRequestMessage.parameters</to> </copy> <copy> - <from>$makePaymentRequestMessage.parameters/CustomerId/text()</from> + <from>$makePaymentMemberRequestMessage.parameters/CustomerId/text()</from> <to>$authorizeRequestMessage.parameters/CreditCard/CardOwner/Name</to> </copy> <copy> - <from>$makePaymentRequestMessage.parameters/Amount/text()</from> + <from>$makePaymentMemberRequestMessage.parameters/Amount/text()</from> <to>$authorizeRequestMessage.parameters/Amount</to> </copy> </assign> @@ -114,7 +114,7 @@ <copy> <from> <literal> - <sendEmail xmlns="http://www.example.org/EmailGateway/"> + <sendEmail xmlns="http://www.tuscanyscatours.com/EmailGateway/"> <Email xmlns=""> <To>Default</To> <Title>Payment Confirmation</Title> @@ -126,7 +126,7 @@ <to>$sendEmailRequestMessage.parameters</to> </copy> <copy> - <from>$makePaymentRequestMessage.parameters/CustomerId/text()</from> + <from>$makePaymentMemberRequestMessage.parameters/CustomerId/text()</from> <to>$sendEmailRequestMessage.parameters/Email/To</to> </copy> </assign> @@ -144,12 +144,12 @@ <copy> <from> <literal> - <makePaymentResponse xmlns="http://www.example.org/Payment"> + <makePaymentMemberResponse xmlns="http://www.tuscanyscatours.com/Payment"> <Status xmlns="">OK</Status> - </makePaymentResponse> + </makePaymentMemberResponse> </literal> </from> - <to>$makePaymentResponseMessage.parameters</to> + <to>$makePaymentMemberResponseMessage.parameters</to> </copy> </assign> @@ -157,8 +157,8 @@ <reply name="end" partnerLink="paymentPartnerLink" portType="pp:Payment" - operation="makePayment" - variable="makePaymentResponseMessage"> + operation="makePaymentMember" + variable="makePaymentMemberResponseMessage"> </reply> </sequence> </process> diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/PaymentTestCase.java b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/PaymentTestCase.java index 395bc0d3d4..a69c16a726 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/PaymentTestCase.java @@ -37,25 +37,28 @@ public class PaymentTestCase { @BeforeClass public static void setUpBeforeClass() throws Exception { - - creditCardNode = SCANodeFactory.newInstance().createSCANode("creditcard.composite", - new SCAContribution("creditcard", "../../shared-contributions/creditcardpayment-contribution/target/test-classes")); - emailGatewayNode = SCANodeFactory.newInstance().createSCANode("emailgateway.composite", - new SCAContribution("creditcard", "../../shared-contributions/emailgateway-contribution/target/test-classes")); - paymentNode = SCANodeFactory.newInstance().createSCANode("payment.composite", - new SCAContribution("payment", "./target/test-classes")); - - creditCardNode.start(); - emailGatewayNode.start(); - paymentNode.start(); + try { + creditCardNode = SCANodeFactory.newInstance().createSCANode("creditcard.composite", + new SCAContribution("creditcard", "../../shared-contributions/creditcard-payment-jaxb-contribution/target/test-classes")); + emailGatewayNode = SCANodeFactory.newInstance().createSCANode("emailgateway.composite", + new SCAContribution("creditcard", "../../shared-contributions/emailgateway-contribution/target/test-classes")); + paymentNode = SCANodeFactory.newInstance().createSCANode("payment.composite", + new SCAContribution("payment-bpel", "./target/classes"), + new SCAContribution("payment-bpel-test", "./target/test-classes")); + + creditCardNode.start(); + emailGatewayNode.start(); + paymentNode.start(); + } catch (Exception ex) { + ex.printStackTrace(); + } } @Test public void testPayment() { SCAClient client = (SCAClient) paymentNode; Payment payment = client.getService(Payment.class, "PaymentClient"); - //[nash] Following line is disabled because of NPE problem - //System.out.println("Result = " + payment.makePayment("Fred", 100.00f)); + System.out.println("Result = " + payment.makePaymentMember("Fred", 100.00f)); } @AfterClass diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/client/PaymentClientImpl.java b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/client/PaymentClientImpl.java index 06a99e4326..eaa7498e84 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/client/PaymentClientImpl.java +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/java/scatours/payment/client/PaymentClientImpl.java @@ -29,9 +29,9 @@ public class PaymentClientImpl implements Payment { @Reference protected Payment payment; - public String makePayment(String customerId, float amount) { + public String makePaymentMember(String customerId, float amount) { // Delegate the external web service - return payment.makePayment(customerId, amount); + return payment.makePaymentMember(customerId, amount); } } diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..4984ef0252 --- /dev/null +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ +<?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. +--> +<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"> + <import namespace="http://www.tuscanyscatours.com/Payment"/> + <import namespace="http://www.tuscanyscatours.com/Payment/"/> +</contribution>
\ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/resources/payment.composite b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/resources/payment.composite index 039192527b..b747b0382a 100644 --- a/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/resources/payment.composite +++ b/sandbox/travelsample/chapter-06/payment-bpel-contribution/src/test/resources/payment.composite @@ -19,8 +19,8 @@ --> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - xmlns:pp="http://www.example.org/Payment" - targetNamespace="http://www.example.org/Payment" + xmlns:pp="http://www.tuscanyscatours.com/Payment" + targetNamespace="http://www.tuscanyscatours.com/Payment" name="payment"> <component name="PaymentClient"> @@ -33,8 +33,8 @@ <component name="Payment"> <implementation.bpel process="pp:Payment"/> <service name="paymentPartnerLink"> - <interface.wsdl interface="http://www.example.org/Payment/#wsdl.interface(Payment)" /> - <binding.ws uri="http://localhost:8083/Payment" wsdlElement="http://www.example.org/Payment/#wsdl.service(PaymentService)"/> + <interface.wsdl interface="http://www.tuscanyscatours.com/Payment/#wsdl.interface(Payment)" /> + <binding.ws uri="http://localhost:8083/Payment" wsdlElement="http://www.tuscanyscatours.com/Payment/#wsdl.service(PaymentService)"/> </service> <reference name="creditCardPaymentPartnerLink"> <binding.ws uri="http://localhost:8081/CreditCardPayment"/> diff --git a/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/CreditCardPayment.wsdl b/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/CreditCardPayment.wsdl index c194d78982..1813c77436 100644 --- a/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/CreditCardPayment.wsdl +++ b/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/CreditCardPayment.wsdl @@ -18,17 +18,17 @@ * under the License. --> <wsdl:definitions name="CreditCardPayment" - targetNamespace="http://www.example.org/CreditCardPayment/" + targetNamespace="http://www.tuscanyscatours.com/CreditCardPayment/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:tns="http://www.example.org/CreditCardPayment/" + xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://www.example.org/CreditCardPayment/" - xmlns:tns="http://www.example.org/CreditCardPayment/"> + targetNamespace="http://www.tuscanyscatours.com/CreditCardPayment/" + xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/"> <xsd:element name="authorize" type="tns:AuthorizeType"/> <xsd:complexType name="AuthorizeType"> @@ -95,7 +95,7 @@ <wsdl:binding name="CreditCardPaymentBinding" type="tns:CreditCardPayment"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="authorize"> - <soap:operation soapAction="http://www.example.org/CreditCardPayment/authorize" /> + <soap:operation soapAction="http://www.tuscanyscatours.com/CreditCardPayment/authorize" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> diff --git a/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/META-INF/sca-contribution.xml index d22f4816ab..8faf8db4ee 100644 --- a/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/META-INF/sca-contribution.xml +++ b/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -19,7 +19,4 @@ --> <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"> <export.java package="payment.creditcard"/> - <export.java package="payment.creditcard.impl"/> - <export.java package="payment.creditcard.ws"/> - <export.java package="payment.creditcard.ws.impl"/> </contribution>
\ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/test/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..666c488b6d --- /dev/null +++ b/sandbox/travelsample/shared-contributions/creditcard-payment-jaxb-contribution/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ +<?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. +--> +<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"> + <import.java package="payment.creditcard"/> +</contribution>
\ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/main/resources/EmailGateway.wsdl b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/main/resources/EmailGateway.wsdl index c103ad947d..7c5c190e1e 100644 --- a/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/main/resources/EmailGateway.wsdl +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/main/resources/EmailGateway.wsdl @@ -18,17 +18,17 @@ * under the License.
-->
<wsdl:definitions name="EmailGateway"
- targetNamespace="http://www.example.org/EmailGateway/"
+ targetNamespace="http://www.tuscanyscatours.com/EmailGateway/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://www.example.org/EmailGateway/"
+ xmlns:tns="http://www.tuscanyscatours.com/EmailGateway/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.example.org/EmailGateway/"
- xmlns:tns="http://www.example.org/EmailGateway/">
+ targetNamespace="http://www.tuscanyscatours.com/EmailGateway/"
+ xmlns:tns="http://www.tuscanyscatours.com/EmailGateway/">
<xsd:element name="sendEmail" type="tns:SendEmailType"/>
<xsd:complexType name="SendEmailType">
@@ -68,7 +68,7 @@ <wsdl:binding name="EmailGatwayBinding" type="tns:EmailGateway">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="sendEmail">
- <soap:operation soapAction="http://www.example.org/EmailGateway/sendEmail" />
+ <soap:operation soapAction="http://www.tuscanyscatours.com/EmailGateway/sendEmail" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/test/resources/EmailGatewayImpl.java b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/test/resources/EmailGatewayImpl.java new file mode 100644 index 0000000000..6e971c3267 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/test/resources/EmailGatewayImpl.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package scatours.emailgateway; + +import org.osoa.sca.annotations.Service; + + +/** + * + */ +@Service(EmailGateway.class) +public class EmailGatewayImpl implements EmailGateway { + + public String sendEmail(EmailType email) { + System.out.println("Sending mail to " + email.getTo()); + return "SENT"; + } + +} diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/test/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..cd9f3c864c --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ +<?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. +--> +<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"> + <import.java package="scatours.emailgateway"/> +</contribution>
\ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/scatours-contribution/src/main/java/scatours/SCAToursImpl.java b/sandbox/travelsample/shared-contributions/scatours-contribution/src/main/java/scatours/SCAToursImpl.java index bfbf05ce02..a2a299d9ed 100644 --- a/sandbox/travelsample/shared-contributions/scatours-contribution/src/main/java/scatours/SCAToursImpl.java +++ b/sandbox/travelsample/shared-contributions/scatours-contribution/src/main/java/scatours/SCAToursImpl.java @@ -40,7 +40,10 @@ import scatours.travelcatalog.TravelCatalogSearch; import scatours.tripbooking.TripBooking; /** - * An implementation of the Trip service + * An implementation of the SCA tours component. This component currently provides + * a front end to the components that the UI communicated with. It allows a conversation + * to be held with the shopping cart as javascript doesn't support conversations. + * Other than that it's just a pass through so we could look to remove it. */ @Scope("COMPOSITE") @Service(interfaces={SCAToursSearch.class, SCAToursBooking.class, SCAToursCart.class}) @@ -60,18 +63,13 @@ public class SCAToursImpl implements SCAToursSearch, SCAToursBooking, SCAToursCa private Map<String,ShoppingCart> carts = new HashMap<String,ShoppingCart>(); private Map<String,TripBooking> trips = new HashMap<String,TripBooking>(); - //private Map<String, TripItem> searchItemsCache = new HashMap<String, TripItem>(); // SCAToursSearch methods public TripItem[] search(TripLeg tripLeg) { - TripItem[] searchItems = travelCatalogSearch.search(tripLeg); - - //for (int i =0; i< searchItems.length; i++){ - // searchItemsCache.put(searchItems[i].getId(), searchItems[i]); - //} - return searchItems; + return travelCatalogSearch.search(tripLeg); + } // SCAToursBooking methods @@ -99,64 +97,7 @@ public class SCAToursImpl implements SCAToursSearch, SCAToursBooking, SCAToursCa } public void checkout(String cartId){ - shoppingCart.checkout("Fred"); - } - -/* - public String addTrip(String cartId){ - String tripId = UUID.randomUUID().toString(); - ServiceReference<TripBooking> tripReference = componentContext.getServiceReference(TripBooking.class, - "tripBooking"); - tripReference.setConversationID(tripId); - trips.put(tripId, tripReference.getService()); - - carts.get(cartId).addItem(tripId); - return tripId; - } - - public void removeTrip(String cartId, String tripId) { - carts.get(cartId).removeItem(tripId); - } - - public void addTripItem(String cartId, String tripId, String tripItemId){ - TripItem item = searchItemsCache.get(tripItemId); - TripItem itemCopy = new TripItem(item); - itemCopy.setTripId(tripId); - trips.get(tripId).addTripItem(itemCopy); - } - - public void removeTripItem(String cartId, String tripId, String tripItemId){ - trips.get(tripId).removeTripItem(tripItemId); - } - - public TripItem[] getTripItems(String cartId) { - List<TripItem> returnTripItems = new ArrayList<TripItem>(); - - for( String tripId : carts.get(cartId).getItems()){ - returnTripItems.addAll(Arrays.asList(trips.get(tripId).getTripItems())); - } - - return returnTripItems.toArray(new TripItem[returnTripItems.size()]); - } - - public double getTotalPrice(String cartId){ - double total = 0.0; - - for( String tripId : carts.get(cartId).getItems()){ - total += trips.get(tripId).getTripPrice(); - } - - return total; - } - - public void checkout(String cartId){ - // get users credentials. Hard coded for now but should - // come from the security context - String customerId = "Fred Bloggs"; - float amount = (float)getTotalPrice(cartId); - - paymentProcess.makePayment(customerId, amount); - } - -*/ + // need to get the user id from the context here + carts.get(cartId).checkout("Fred"); + } } diff --git a/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/main/java/scatours/shoppingcart/ShoppingCartImpl.java b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/main/java/scatours/shoppingcart/ShoppingCartImpl.java index 31b273bf47..feb26f4c27 100644 --- a/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/main/java/scatours/shoppingcart/ShoppingCartImpl.java +++ b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/main/java/scatours/shoppingcart/ShoppingCartImpl.java @@ -32,9 +32,10 @@ import org.osoa.sca.annotations.Reference; import org.osoa.sca.annotations.Scope; import org.osoa.sca.annotations.Service; +import payment.Payment; + import scatours.common.TripItem; -//import scatours.paymentprocess.PaymentProcess; /** * An implementation of the Trip service @@ -43,8 +44,8 @@ import scatours.common.TripItem; @Service(interfaces={ShoppingCart.class}) public class ShoppingCartImpl implements ShoppingCart{ - // @Reference - // protected PaymentProcess paymentProcess; + @Reference + protected Payment payment; @ConversationID protected String cartId; @@ -83,7 +84,18 @@ public class ShoppingCartImpl implements ShoppingCart{ // get the total for all the trips float amount = (float)0.0; - //paymentProcess.makePayment(customerId, amount); + for (TripItem trip : trips){ + if (trip.getType().equals(TripItem.TRIP)){ + amount += trip.getPrice(); + } else { + for (TripItem tripItem : trip.getTripItems()){ + amount += tripItem.getPrice(); + } + } + } + + // Take the payment from the customer + payment.makePaymentMember(customerId, amount); } } diff --git a/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/main/resources/Payment.wsdl b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ +<?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. +--> +<wsdl:definitions name="Payment" + targetNamespace="http://www.tuscanyscatours.com/Payment/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:tns="http://www.tuscanyscatours.com/Payment/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" + xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"> + <wsdl:types> + <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://www.tuscanyscatours.com/Payment/" + xmlns:tns="http://www.tuscanyscatours.com/Payment/"> + + <xsd:complexType name="MakePaymentMemberType"> + <xsd:sequence> + <xsd:element name="CustomerId" type="xsd:string"></xsd:element> + <xsd:element name="Amount" type="xsd:float"></xsd:element> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="makePaymentMember" type="tns:MakePaymentMemberType"/> + + <xsd:complexType name="MakePaymentMemberResponseType"> + <xsd:sequence> + <xsd:element name="Status" type="xsd:string"></xsd:element> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="makePaymentMemberResponse" type="tns:MakePaymentMemberResponseType"/> + + </xsd:schema> + </wsdl:types> + <wsdl:message name="MakePaymentMemberRequest"> + <wsdl:part name="parameters" element="tns:makePaymentMember"></wsdl:part> + </wsdl:message> + <wsdl:message name="MakePaymentMemberResponse"> + <wsdl:part name="parameters" element="tns:makePaymentMemberResponse"></wsdl:part> + </wsdl:message> + <wsdl:portType name="Payment"> + <wsdl:operation name="makePaymentMember"> + <wsdl:input message="tns:MakePaymentMemberRequest"></wsdl:input> + <wsdl:output message="tns:MakePaymentMemberResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="PaymentBinding" type="tns:Payment"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="makePaymentMember"> + <soap:operation soapAction="http://www.tuscanyscatours.com/Payment/makePayment" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="PaymentService"> + <wsdl:port name="PaymentPort" binding="tns:PaymentBinding"> + <soap:address location="http://localhost:8083/Payment" /> + </wsdl:port> + </wsdl:service> + + <plnk:partnerLinkType name="PaymentLinkType"> + <plnk:role name="forward" portType="tns:Payment"/> + </plnk:partnerLinkType> +</wsdl:definitions>
\ No newline at end of file |