You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/09/02 07:08:11 UTC
svn commit: r691105 - in /tuscany/sandbox/travelsample/payment-contribution:
creditcard.composite pom.xml src/payment/ src/payment/creditcard/
src/payment/creditcard/impl/
src/payment/creditcard/impl/CreditCardPaymentImpl.java
wsdl/CreditCardPayment.wsdl
Author: rfeng
Date: Mon Sep 1 22:08:10 2008
New Revision: 691105
URL: http://svn.apache.org/viewvc?rev=691105&view=rev
Log:
Add the creditcard payment component
Added:
tuscany/sandbox/travelsample/payment-contribution/creditcard.composite
tuscany/sandbox/travelsample/payment-contribution/src/payment/
tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/
tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/
tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java (with props)
Modified:
tuscany/sandbox/travelsample/payment-contribution/pom.xml
tuscany/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl
Added: tuscany/sandbox/travelsample/payment-contribution/creditcard.composite
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/payment-contribution/creditcard.composite?rev=691105&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/payment-contribution/creditcard.composite (added)
+++ tuscany/sandbox/travelsample/payment-contribution/creditcard.composite Mon Sep 1 22:08:10 2008
@@ -0,0 +1,32 @@
+<?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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:c="http://creditcard" targetNamespace="http://creditcard" name="creditcard">
+ <component name="CreditCardPayment">
+ <implementation.java class="payment.creditcard.impl.CreditCardPaymentImpl" />
+ <reference name="creditCardPayment">
+ <binding.ws uri="http://localhost:8080/CreditCardPayment" />
+ </reference>
+ <service name="CreditCardPayment">
+ <t:binding.jsonrpc uri="/jsonrpc/CreditCardPayment">
+ </t:binding.jsonrpc>
+ </service>
+ </component>
+</composite>
\ No newline at end of file
Modified: tuscany/sandbox/travelsample/payment-contribution/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/payment-contribution/pom.xml?rev=691105&r1=691104&r2=691105&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/payment-contribution/pom.xml (original)
+++ tuscany/sandbox/travelsample/payment-contribution/pom.xml Mon Sep 1 22:08:10 2008
@@ -73,10 +73,10 @@
<version>1.0</version>
<executions>
<execution>
- <id>add-test-source</id>
+ <id>add-source</id>
<phase>generate-sources</phase>
<goals>
- <goal>add-test-source</goal>
+ <goal>add-source</goal>
</goals>
<configuration>
<sources>
@@ -93,7 +93,7 @@
<executions>
<execution>
<id>wsimport</id>
- <phase>generate-test-sources</phase>
+ <phase>generate-sources</phase>
<goals>
<goal>wsimport</goal>
</goals>
Added: tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java?rev=691105&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java (added)
+++ tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java Mon Sep 1 22:08:10 2008
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package payment.creditcard.impl;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import payment.creditcard.CreditCardDetailsType;
+import payment.creditcard.CreditCardPayment;
+
+/**
+ *
+ */
+@Service(CreditCardPayment.class)
+public class CreditCardPaymentImpl implements CreditCardPayment {
+ @Reference
+ protected CreditCardPayment creditCardPayment;
+
+ public String authorize(CreditCardDetailsType creditCard, float amount) {
+ // Validate some of the fields in CreditCardDetailsType
+ if (creditCard.getCreditCardType() == null) {
+ return "UnknownCreditCardType";
+ }
+ // Delegate the external web service
+ return creditCardPayment.authorize(creditCard, amount);
+ }
+
+}
Propchange: tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: tuscany/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl?rev=691105&r1=691104&r2=691105&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl (original)
+++ tuscany/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl Mon Sep 1 22:08:10 2008
@@ -1,6 +1,25 @@
<?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="CreditCardPayment" targetNamespace="http://www.example.org/CreditCardPayment/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.example.org/CreditCardPayment/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.example.org/CreditCardPayment/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<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/">