summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com')
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java33
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java46
2 files changed, 79 insertions, 0 deletions
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
new file mode 100644
index 0000000000..9f508ecc59
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
@@ -0,0 +1,33 @@
+package com.tuscanyscatours.payment.creditcard;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.3-b02-
+ * Generated source version: 2.1
+ *
+ */
+@WebService(name = "CreditCardPayment", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/")
+public interface CreditCardPayment {
+
+ /**
+ *
+ * @param amount
+ * @param creditCard
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod(action = "http://tuscanyscatours.com/CreditCardPayment/authorize")
+ @WebResult(name = "Status", targetNamespace = "")
+ @RequestWrapper(localName = "authorize", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/", className = "com.tuscanyscatours.payment.creditcard.AuthorizeType")
+ @ResponseWrapper(localName = "authorizeResponse", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/", className = "com.tuscanyscatours.payment.creditcard.AuthorizeResponseType")
+ public String authorize(@WebParam(name = "CreditCard", targetNamespace = "") CreditCardDetailsType creditCard,
+ @WebParam(name = "Amount", targetNamespace = "") float amount);
+
+}
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
new file mode 100644
index 0000000000..ed817a58bb
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
@@ -0,0 +1,46 @@
+/*
+ * 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 com.tuscanyscatours.payment.creditcard.impl;
+
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+
+/**
+ *
+ */
+@Service(CreditCardPayment.class)
+public class CreditCardPaymentImpl implements CreditCardPayment {
+
+ public String authorize(CreditCardDetailsType creditCard, float amount) {
+ if (creditCard != null) {
+ System.out.println("Checking card: name = " + creditCard.getCardOwner().getName()
+ + " number = "
+ + creditCard.getCreditCardNumber()
+ + " for amount "
+ + amount);
+ } else {
+ System.out.println("Checking card is null");
+ }
+
+ return "OK";
+ }
+}